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 authored Feb 20, 2024
1 parent 929c45c commit 97a007f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions webots_ros2_control/src/Ros2Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,10 @@ namespace webots_ros2_control {
webotsSystem->init(mNode, controlHardware[i]);
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
// Configure and activate all components
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 97a007f

Please sign in to comment.