Skip to content

Commit deca703

Browse files
author
Aron Svastits
committed
use enums in hwif state requests
1 parent 9894740 commit deca703

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kuka_rox_hardware_interface/src/robot_manager_node.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ RobotManagerNode::on_configure(const rclcpp_lifecycle::State &)
118118
auto hw_request =
119119
std::make_shared<SetHardwareComponentState::Request>();
120120
hw_request->name = "iisy_hardware";
121-
hw_request->target_state.label = "inactive";
121+
hw_request->target_state.id = State::PRIMARY_STATE_INACTIVE;
122122
auto hw_response =
123123
kroshu_ros2_core::sendRequest<SetHardwareComponentState::Response>(
124124
change_hardware_state_client_, hw_request, 0, 2000);
@@ -140,7 +140,7 @@ RobotManagerNode::on_cleanup(const rclcpp_lifecycle::State &)
140140
auto hw_request =
141141
std::make_shared<SetHardwareComponentState::Request>();
142142
hw_request->name = "iisy_hardware";
143-
hw_request->target_state.label = "inactive";
143+
hw_request->target_state.id = State::PRIMARY_STATE_UNCONFIGURED;
144144
auto hw_response =
145145
kroshu_ros2_core::sendRequest<SetHardwareComponentState::Response>(
146146
change_hardware_state_client_, hw_request, 0, 2000);
@@ -150,9 +150,9 @@ RobotManagerNode::on_cleanup(const rclcpp_lifecycle::State &)
150150
}
151151

152152
if (is_configured_pub_->is_activated()) {
153-
is_configured_pub_->on_deactivate();
154153
is_configured_msg_.data = false;
155154
is_configured_pub_->publish(is_configured_msg_);
155+
is_configured_pub_->on_deactivate();
156156
}
157157
return SUCCESS;
158158
}
@@ -208,7 +208,7 @@ RobotManagerNode::on_activate(const rclcpp_lifecycle::State &)
208208
auto hw_request =
209209
std::make_shared<SetHardwareComponentState::Request>();
210210
hw_request->name = "iisy_hardware";
211-
hw_request->target_state.label = "active";
211+
hw_request->target_state.id = State::PRIMARY_STATE_ACTIVE;
212212
auto hw_response =
213213
kroshu_ros2_core::sendRequest<SetHardwareComponentState::Response>(
214214
change_hardware_state_client_, hw_request, 0, 2000);
@@ -274,7 +274,7 @@ RobotManagerNode::on_deactivate(const rclcpp_lifecycle::State &)
274274
auto hw_request =
275275
std::make_shared<SetHardwareComponentState::Request>();
276276
hw_request->name = "iisy_hardware";
277-
hw_request->target_state.label = "inactive";
277+
hw_request->target_state.id = State::PRIMARY_STATE_INACTIVE;
278278
auto hw_response =
279279
kroshu_ros2_core::sendRequest<SetHardwareComponentState::Response>(
280280
change_hardware_state_client_, hw_request, 0, 2000);

0 commit comments

Comments
 (0)