Printing success log only if execution completes

Previous code will print/log "Execution complete" even if the execution was disabled.
This commit is contained in:
Rajendra Singh 2020-01-16 19:13:04 +05:30 committed by Robert Haschke
parent de79dedbfc
commit 8588deb202

View File

@ -121,6 +121,7 @@ int main(int argc, char** argv) {
ROS_INFO_NAMED(LOGNAME, "Planning succeded");
if (pnh.param("execute", false)) {
pick_place_task.execute();
ROS_INFO_NAMED(LOGNAME, "Execution complete");
} else {
ROS_INFO_NAMED(LOGNAME, "Execution disabled");
}
@ -128,8 +129,6 @@ int main(int argc, char** argv) {
ROS_INFO_NAMED(LOGNAME, "Planning failed");
}
ROS_INFO_NAMED(LOGNAME, "Execution complete");
// Keep introspection alive
ros::waitForShutdown();
return 0;