Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit c311225

Browse files
authored
Fixed rolling compilation (#195)
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent 0521c13 commit c311225

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

gazebo_ros2_control/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ ament_target_dependencies(${PROJECT_NAME}
3939
yaml_cpp_vendor
4040
)
4141

42+
if("$ENV{ROS_DISTRO}" STREQUAL "rolling")
43+
add_definitions(-DROLLING)
44+
endif()
45+
4246
add_library(gazebo_hardware_plugins SHARED
4347
src/gazebo_system.cpp
4448
)

gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element
287287
}
288288

289289
for (unsigned int i = 0; i < control_hardware_info.size(); i++) {
290+
#ifndef ROLLING
291+
std::string robot_hw_sim_type_str_ = control_hardware_info[i].hardware_class_type;
292+
#else
290293
std::string robot_hw_sim_type_str_ = control_hardware_info[i].hardware_plugin_name;
294+
#endif
291295
auto gazeboSystem = std::unique_ptr<gazebo_ros2_control::GazeboSystemInterface>(
292296
impl_->robot_hw_sim_loader_->createUnmanagedInstance(robot_hw_sim_type_str_));
293297

0 commit comments

Comments
 (0)