File tree 1 file changed +3
-2
lines changed
chapter_1_codes/mastering_ros_demo_pkg/src
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class Demo_actionAction
78
78
if (!as.isActive () || as.isPreemptRequested ()) return ;
79
79
ros::Rate rate (5 );
80
80
ROS_INFO (" %s is processing the goal %d" , action_name.c_str (), goal->count );
81
- for (progress = 0 ; progress < goal->count ; progress++){
81
+ for (progress = 1 ; progress <= goal->count ; progress++){
82
82
// Check for ros
83
83
if (!ros::ok ()){
84
84
result.final_count = progress;
@@ -92,10 +92,11 @@ class Demo_actionAction
92
92
return ;
93
93
}
94
94
95
- if (goal->count = = progress){
95
+ if (goal->count < = progress){
96
96
ROS_INFO (" %s Succeeded at getting to goal %d" , action_name.c_str (), goal->count );
97
97
result.final_count = progress;
98
98
as.setSucceeded (result);
99
+
99
100
}else {
100
101
ROS_INFO (" Setting to goal %d / %d" ,feedback.current_number ,goal->count );
101
102
feedback.current_number = progress;
You can’t perform that action at this time.
0 commit comments