Skip to content

Commit 6038a45

Browse files
omichelYadunund
andauthored
Fix version check (#883)
Signed-off-by: Yadunund <[email protected]> Co-authored-by: Yadunund <[email protected]>
1 parent b65c5ae commit 6038a45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webots_ros2_control/src/Ros2Control.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace webots_ros2_control {
7878
}
7979
for (unsigned int i = 0; i < controlHardware.size(); i++) {
8080
// Necessary hotfix for renamed variables present in "hardware_interface" package for versions above 3.5 (#590)
81-
#if HARDWARE_INTERFACE_VERSION_MAJOR >= 3 && HARDWARE_INTERFACE_VERSION_MINOR >= 5
81+
#if HARDWARE_INTERFACE_VERSION_MAJOR >= 4 || HARDWARE_INTERFACE_VERSION_MAJOR >= 3 && HARDWARE_INTERFACE_VERSION_MINOR >= 5
8282
const std::string pluginName = controlHardware[i].hardware_plugin_name;
8383
auto webotsSystem =
8484
std::unique_ptr<webots_ros2_control::Ros2ControlSystemInterface>(mHardwareLoader->createUnmanagedInstance(pluginName));
@@ -93,7 +93,7 @@ namespace webots_ros2_control {
9393
// Configure and activate all components
9494
// Necessary hotfix for deprecation of component activation present in "hardware_interface" package for versions above 3.15
9595
// (#793)
96-
#if HARDWARE_INTERFACE_VERSION_MAJOR >= 3 && HARDWARE_INTERFACE_VERSION_MINOR >= 15
96+
#if HARDWARE_INTERFACE_VERSION_MAJOR >= 4 || HARDWARE_INTERFACE_VERSION_MAJOR >= 3 && HARDWARE_INTERFACE_VERSION_MINOR >= 15
9797
using lifecycle_msgs::msg::State;
9898
rclcpp_lifecycle::State active_state(State::PRIMARY_STATE_ACTIVE, hardware_interface::lifecycle_state_names::ACTIVE);
9999
resourceManager->set_component_state(controlHardware[i].name, active_state);

0 commit comments

Comments
 (0)