Skip to content

Commit 2575a90

Browse files
committed
Using the name of the final state of configuration when using action.
1 parent a3c9553 commit 2575a90

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

gpio_controllers/include/gpio_controllers/gpio_tool_controller.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ class GpioToolController : public controller_interface::ControllerInterface
155155
std::unordered_set<std::string> command_if_ios_;
156156
std::unordered_set<std::string> state_if_ios_;
157157

158-
using EngagingSrvType = example_interfaces::srv::Trigger;
159-
using ResetSrvType = example_interfaces::srv::Trigger;
158+
using EngagingSrvType = std_srvs::srv::Trigger;
159+
using ResetSrvType = std_srvs::srv::Trigger;
160160
using ConfigSrvType = control_msgs::srv::SetGPIOToolConfig;
161161
using DynInterfaceMsg = control_msgs::msg::DynamicInterfaceValues;
162162
using EngagingActionType = control_msgs::action::GPIOToolCommand;
@@ -273,13 +273,6 @@ class GpioToolController : public controller_interface::ControllerInterface
273273
rclcpp_action::CancelResponse handle_engaging_cancel(
274274
std::shared_ptr<rclcpp_action::ServerGoalHandle<EngagingActionType>> goal_handle);
275275

276-
/**
277-
* @brief Handles the accepted goal for the tool action.
278-
* @param goal_handle The handle of the accepted goal.
279-
*/
280-
void handle_engaging_accepted(
281-
std::shared_ptr<rclcpp_action::ServerGoalHandle<EngagingActionType>> goal_handle);
282-
283276
/**
284277
* @brief Handles the goal for the gripper configuration action.
285278
* @param uuid The UUID of the goal.

gpio_controllers/src/gpio_tool_controller.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,6 @@ rclcpp_action::CancelResponse GpioToolController::handle_engaging_cancel(
10991099
return rclcpp_action::CancelResponse::ACCEPT;
11001100
}
11011101

1102-
void GpioToolController::handle_engaging_accepted(
1103-
std::shared_ptr<rclcpp_action::ServerGoalHandle<EngagingActionType>> goal_handle)
1104-
{
1105-
handle_action_accepted<EngagingActionType>(goal_handle);
1106-
}
1107-
11081102
rclcpp_action::GoalResponse GpioToolController::handle_config_goal(
11091103
const rclcpp_action::GoalUUID & /*uuid*/, std::shared_ptr<const ConfigActionType::Goal> goal)
11101104
{
@@ -1140,13 +1134,15 @@ void GpioToolController::handle_action_accepted(
11401134
if (current_tool_action_.load() == ToolAction::IDLE)
11411135
{
11421136
result->success = true;
1137+
result->resulting_state_name = current_state_;
11431138
result->message = "Tool action successfully executed!";
11441139
goal_handle->succeed(result);
11451140
break;
11461141
}
11471142
else if (current_tool_transition_.load() == GPIOToolTransition::HALTED)
11481143
{
11491144
result->success = false;
1145+
result->resulting_state_name = current_state_;
11501146
result->message = "Tool action canceled or halted! Check the error, reset the tool using '~/reset_halted' service and set to sensible state.";
11511147
goal_handle->abort(result);
11521148
break;

0 commit comments

Comments
 (0)