Skip to content

Commit

Permalink
webots_ros2_control: remove usage of deprecated activate_all_componen…
Browse files Browse the repository at this point in the history
  • Loading branch information
skpawar1305 committed Feb 20, 2024
1 parent 929c45c commit a57bed6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions webots_ros2_control/src/Ros2Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,9 @@ namespace webots_ros2_control {
resourceManager->import_component(std::move(webotsSystem), controlHardware[i]);

// Configure and activate all components
// Necessary hotfix for deprecation of component activation present in "hardware_interface" package for versions above 3.15
// (#793)
#if HARDWARE_INTERFACE_VERSION_MAJOR >= 4 || HARDWARE_INTERFACE_VERSION_MAJOR >= 3 && HARDWARE_INTERFACE_VERSION_MINOR >= 15
using lifecycle_msgs::msg::State;
rclcpp_lifecycle::State active_state(State::PRIMARY_STATE_ACTIVE, hardware_interface::lifecycle_state_names::ACTIVE);
resourceManager->set_component_state(controlHardware[i].name, active_state);
#else
resourceManager->activate_all_components();
#endif
resourceManager->load_urdf(urdfString, false, false);
}

Expand Down

0 comments on commit a57bed6

Please sign in to comment.