Skip to content

Commit a12cf80

Browse files
authored
Add ROS Kilted support (#1040)
* Add ROS Kilted support * fix version guards * ament_target_dependencies deprecation fix * test * kilted test * revert * tests * kilted * fix rosbot kilted * fix * changelog
1 parent 7169ebb commit a12cf80

File tree

21 files changed

+148
-78
lines changed

21 files changed

+148
-78
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
ROS_REPO: [main, testing]
19-
ROS_DISTRO: [humble, jazzy, rolling]
19+
ROS_DISTRO: [humble, jazzy, kilted, rolling]
2020
runs-on: ubuntu-latest
2121
env:
2222
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}

.github/workflows/test_develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
ROS_REPO: [main, testing]
17-
ROS_DISTRO: [humble, jazzy, rolling]
17+
ROS_DISTRO: [humble, jazzy, kilted, rolling]
1818
runs-on: ubuntu-latest
1919
env:
2020
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}

docker/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ RUN apt-get update && apt-get install -y \
3939
gdb \
4040
git
4141

42-
# HOTFIX: https://github.com/ros-controls/ros2_control/pull/1960
43-
RUN [ "${ROS_DISTRO}" = "humble" ] && wget -O /tmp/hotfix.deb http://snapshots.ros.org/humble/2024-08-28/ubuntu/pool/main/r/ros-humble-hardware-interface/ros-humble-hardware-interface_2.43.0-1jammy.20240823.145349_amd64.deb && \
44-
apt install -y --allow-downgrades /tmp/hotfix.deb && \
45-
rm -f /tmp/hotfix.deb || true
46-
4742
COPY ./docker/bashrc /tmp/bashrc
4843
COPY ./docker/webots.conf /${DOCKERUSER}/.config/Cyberbotics/Webots-R${WEBOTS_VERSION}.conf
4944
RUN cat /tmp/bashrc >> /${DOCKERUSER}/.bashrc

webots_ros2_control/CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for package webots_ros2_control
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2025.0.1 (XXXX-XX-XX)
6+
------------------
7+
* Replaces ament_target_dependencies with target_link_libraries.
8+
* Adds ROS Kilted Kaiju support.
9+
510
2023.1.3 (2024-08-07)
611
------------------
712
* Added support for the new `ros2_control` API affecting resource_manager and controller_manager.

webots_ros2_control/CMakeLists.txt

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if($ENV{ROS_DISTRO} MATCHES "humble")
66
add_compile_definitions(HUMBLE)
77
elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
88
add_compile_definitions(JAZZY)
9+
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
10+
add_compile_definitions(KILTED)
911
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
1012
add_compile_definitions(ROLLING)
1113
endif()
@@ -50,15 +52,26 @@ target_include_directories(
5052
${PROJECT_NAME}
5153
PRIVATE
5254
include
55+
${webots_ros2_driver_INCLUDE_DIRS}
5356
)
54-
ament_target_dependencies(
55-
${PROJECT_NAME}
56-
hardware_interface
57-
controller_manager
58-
pluginlib
59-
rclcpp
60-
webots_ros2_driver
61-
)
57+
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
58+
ament_target_dependencies(
59+
${PROJECT_NAME}
60+
hardware_interface
61+
controller_manager
62+
pluginlib
63+
rclcpp
64+
webots_ros2_driver
65+
)
66+
else()
67+
target_link_libraries(${PROJECT_NAME}
68+
PUBLIC
69+
hardware_interface::hardware_interface
70+
controller_manager::controller_manager
71+
pluginlib::pluginlib
72+
rclcpp::rclcpp
73+
)
74+
endif()
6275

6376
# Prevent pluginlib from using boost
6477
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
@@ -74,15 +87,26 @@ target_include_directories(
7487
${PROJECT_NAME}_system
7588
PRIVATE
7689
include
90+
${webots_ros2_driver_INCLUDE_DIRS}
7791
)
78-
ament_target_dependencies(
79-
${PROJECT_NAME}_system
80-
hardware_interface
81-
pluginlib
82-
rclcpp
83-
rclcpp_lifecycle
84-
webots_ros2_driver
85-
)
92+
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
93+
ament_target_dependencies(
94+
${PROJECT_NAME}_system
95+
hardware_interface
96+
pluginlib
97+
rclcpp
98+
rclcpp_lifecycle
99+
webots_ros2_driver
100+
)
101+
else()
102+
target_link_libraries(${PROJECT_NAME}_system
103+
PUBLIC
104+
hardware_interface::hardware_interface
105+
pluginlib::pluginlib
106+
rclcpp::rclcpp
107+
rclcpp_lifecycle::rclcpp_lifecycle
108+
)
109+
endif()
86110

87111
# Prevent pluginlib from using boost
88112
target_compile_definitions(${PROJECT_NAME}_system PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

webots_ros2_control/src/Ros2Control.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace webots_ros2_control {
9797

9898
WebotsResourceManager(const WebotsResourceManager &) = delete;
9999

100-
bool load_and_initialize_components(const std::string &urdf, unsigned int update_rate) override {
100+
bool load_and_initialize_components(const std::string &urdf, unsigned int /* update_rate */) override {
101101
components_are_loaded_and_initialized_ = true;
102102

103103
std::vector<hardware_interface::HardwareInfo> controlHardware;

webots_ros2_driver/CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for package webots_ros2_driver
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2025.0.1 (XXXX-XX-XX)
6+
------------------
7+
* Replaces ament_target_dependencies with target_link_libraries.
8+
* Adds ROS Kilted Kaiju support.
9+
510
2023.1.3 (2024-08-07)
611
------------------
712
* Make webots_ros2_driver scripts executable.

webots_ros2_driver/CMakeLists.txt

Lines changed: 82 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
1212
add_compile_definitions(JAZZY)
1313
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
1414
add_compile_definitions(ROLLING)
15+
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
16+
add_compile_definitions(KILTED)
1517
endif()
1618

1719
# ROS2 Packages
@@ -36,6 +38,8 @@ elseif($ENV{ROS_DISTRO} MATCHES "iron")
3638
find_package(Python 3.10 EXACT REQUIRED COMPONENTS Development)
3739
elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
3840
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
41+
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
42+
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
3943
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
4044
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
4145
endif()
@@ -108,27 +112,46 @@ add_executable(driver
108112
src/utils/Math.cpp
109113
src/utils/Utils.cpp
110114
)
111-
ament_target_dependencies(driver
112-
rosgraph_msgs
113-
rclcpp
114-
pluginlib
115-
sensor_msgs
116-
std_msgs
117-
tf2_geometry_msgs
118-
tf2_ros
119-
vision_msgs
120-
webots_ros2_msgs
121-
tinyxml2_vendor
122-
TinyXML2
123-
)
115+
116+
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
117+
ament_target_dependencies(driver
118+
rosgraph_msgs
119+
rclcpp
120+
pluginlib
121+
sensor_msgs
122+
std_msgs
123+
tf2_geometry_msgs
124+
tf2_ros
125+
vision_msgs
126+
webots_ros2_msgs
127+
tinyxml2_vendor
128+
TinyXML2
129+
)
130+
target_link_libraries(driver
131+
${WEBOTS_LIB}
132+
${Python_LIBRARIES}
133+
yaml-cpp
134+
)
135+
else()
136+
target_link_libraries(driver
137+
${rosgraph_msgs_TARGETS}
138+
rclcpp::rclcpp
139+
pluginlib::pluginlib
140+
${sensor_msgs_TARGETS}
141+
${std_msgs_TARGETS}
142+
tf2_geometry_msgs::tf2_geometry_msgs
143+
tf2_ros::tf2_ros
144+
${vision_msgs_TARGETS}
145+
${webots_ros2_msgs_TARGETS}
146+
tinyxml2::tinyxml2
147+
${WEBOTS_LIB}
148+
${Python_LIBRARIES}
149+
yaml-cpp
150+
)
151+
endif()
124152
add_dependencies(driver
125153
compile-lib-vehicle
126154
)
127-
target_link_libraries(driver
128-
${WEBOTS_LIB}
129-
${Python_LIBRARIES}
130-
yaml-cpp
131-
)
132155
install(
133156
DIRECTORY include/
134157
DESTINATION include
@@ -146,19 +169,30 @@ add_library(
146169
src/plugins/Ros2SensorPlugin.cpp
147170
src/utils/Utils.cpp
148171
)
149-
ament_target_dependencies(${PROJECT_NAME}_imu
150-
rclcpp
151-
sensor_msgs
152-
webots_ros2_msgs
153-
pluginlib
154-
tf2_ros
155-
)
172+
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
173+
ament_target_dependencies(${PROJECT_NAME}_imu
174+
rclcpp
175+
sensor_msgs
176+
webots_ros2_msgs
177+
pluginlib
178+
tf2_ros
179+
)
180+
target_link_libraries(${PROJECT_NAME}_imu
181+
${WEBOTS_LIB}
182+
)
183+
else()
184+
target_link_libraries(${PROJECT_NAME}_imu
185+
rclcpp::rclcpp
186+
${sensor_msgs_TARGETS}
187+
${webots_ros2_msgs_TARGETS}
188+
pluginlib::pluginlib
189+
tf2_ros::tf2_ros
190+
${WEBOTS_LIB}
191+
)
192+
endif()
156193
add_dependencies(${PROJECT_NAME}_imu
157194
compile-lib-vehicle
158195
)
159-
target_link_libraries(${PROJECT_NAME}_imu
160-
${WEBOTS_LIB}
161-
)
162196
install(TARGETS ${PROJECT_NAME}_imu
163197
RUNTIME DESTINATION bin
164198
ARCHIVE DESTINATION lib
@@ -174,18 +208,28 @@ add_library(
174208
src/plugins/Ros2SensorPlugin.cpp
175209
src/utils/Utils.cpp
176210
)
177-
ament_target_dependencies(${PROJECT_NAME}_rgbd
178-
rclcpp
179-
sensor_msgs
180-
pluginlib
181-
tf2_ros
182-
)
211+
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
212+
ament_target_dependencies(${PROJECT_NAME}_rgbd
213+
rclcpp
214+
sensor_msgs
215+
pluginlib
216+
tf2_ros
217+
)
218+
target_link_libraries(${PROJECT_NAME}_rgbd
219+
${WEBOTS_LIB}
220+
)
221+
else()
222+
target_link_libraries(${PROJECT_NAME}_rgbd
223+
rclcpp::rclcpp
224+
${sensor_msgs_TARGETS}
225+
pluginlib::pluginlib
226+
tf2_ros::tf2_ros
227+
${WEBOTS_LIB}
228+
)
229+
endif()
183230
add_dependencies(${PROJECT_NAME}_rgbd
184231
compile-lib-vehicle
185232
)
186-
target_link_libraries(${PROJECT_NAME}_rgbd
187-
${WEBOTS_LIB}
188-
)
189233
install(TARGETS ${PROJECT_NAME}_rgbd
190234
RUNTIME DESTINATION bin
191235
ARCHIVE DESTINATION lib
@@ -272,4 +316,5 @@ ament_export_libraries(
272316
${PROJECT_NAME}_rgbd
273317
${WEBOTS_LIB_PATH}
274318
)
319+
275320
ament_package()

webots_ros2_epuck/launch/robot_launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def generate_launch_description():
8888

8989
robot_description_path = os.path.join(package_dir, 'resource', 'epuck_webots.urdf')
9090
ros2_control_params = os.path.join(package_dir, 'resource', 'ros2_control.yml')
91-
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy'])
91+
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['kilted', 'rolling', 'jazzy'])
9292
if use_twist_stamped:
9393
mappings = [('/diffdrive_controller/cmd_vel', '/cmd_vel'), ('/diffdrive_controller/odom', '/odom')]
9494
else:

webots_ros2_husarion/resource/rosbot_controllers.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ rosbot_base_controller:
3333
# min_velocity - When unspecified, -max_velocity is used
3434
max_acceleration: 1.0 # m/s^2
3535
# min_acceleration - When unspecified, -max_acceleration is used.
36-
max_jerk: 0.0 # m/s^3
3736

3837
angular:
3938
z:
@@ -44,4 +43,3 @@ rosbot_base_controller:
4443
# min_velocity - When unspecified, -max_velocity is used
4544
max_acceleration: 4.0 # rad/s^2
4645
# min_acceleration - When unspecified, -max_acceleration is used.
47-
max_jerk: 0.0 # rad/s^3

0 commit comments

Comments
 (0)