File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -130,13 +130,7 @@ namespace mep3_controllers
130130 auto result = std::make_shared<mep3_msgs::action::JointPositionCommand::Result>();
131131 result->set__last_effort (joint->effort_handle ->get ().get_value ());
132132 result->set__last_position (joint->position_handle ->get ().get_value ());
133- if (fabs (joint->position_handle ->get ().get_value () - joint->target_position ) < joint->tolerance )
134- {
135- result->set__result (mep3_msgs::action::JointPositionCommand::Goal::RESULT_SUCCESS);
136- joint->action_server ->succeeded_current (result);
137- joint->active = false ;
138- }
139- else if (joint->action_server ->is_cancel_requested ())
133+ if (joint->action_server ->is_cancel_requested ())
140134 {
141135 result->set__result (mep3_msgs::action::JointPositionCommand::Goal::RESULT_PREEMPTED);
142136 joint->action_server ->terminate_current (result);
@@ -164,6 +158,12 @@ namespace mep3_controllers
164158 joint->active = false ;
165159 RCLCPP_ERROR (get_node ()->get_logger (), " Joint %s overload" , joint->name .c_str ());
166160 }
161+ else if (fabs (joint->position_handle ->get ().get_value () - joint->target_position ) < joint->tolerance )
162+ {
163+ result->set__result (mep3_msgs::action::JointPositionCommand::Goal::RESULT_SUCCESS);
164+ joint->action_server ->succeeded_current (result);
165+ joint->active = false ;
166+ }
167167 else
168168 {
169169 // TODO: If the action is terminated (with the feedback) then it crashes the whole BT.
You can’t perform that action at this time.
0 commit comments