Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
ROS_REPO: [main, testing]
ROS_DISTRO: [humble, jazzy, rolling]
ROS_DISTRO: [humble, jazzy, kilted, rolling]
runs-on: ubuntu-latest
env:
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
ROS_REPO: [main, testing]
ROS_DISTRO: [humble, jazzy, rolling]
ROS_DISTRO: [humble, jazzy, kilted, rolling]
runs-on: ubuntu-latest
env:
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}
Expand Down
5 changes: 0 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ RUN apt-get update && apt-get install -y \
gdb \
git

# HOTFIX: https://github.com/ros-controls/ros2_control/pull/1960
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 && \
apt install -y --allow-downgrades /tmp/hotfix.deb && \
rm -f /tmp/hotfix.deb || true

COPY ./docker/bashrc /tmp/bashrc
COPY ./docker/webots.conf /${DOCKERUSER}/.config/Cyberbotics/Webots-R${WEBOTS_VERSION}.conf
RUN cat /tmp/bashrc >> /${DOCKERUSER}/.bashrc
Expand Down
5 changes: 5 additions & 0 deletions webots_ros2_control/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package webots_ros2_control
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2025.0.1 (XXXX-XX-XX)
------------------
* Replaces ament_target_dependencies with target_link_libraries.
* Adds ROS Kilted Kaiju support.

2023.1.3 (2024-08-07)
------------------
* Added support for the new `ros2_control` API affecting resource_manager and controller_manager.
Expand Down
56 changes: 40 additions & 16 deletions webots_ros2_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if($ENV{ROS_DISTRO} MATCHES "humble")
add_compile_definitions(HUMBLE)
elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
add_compile_definitions(JAZZY)
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
add_compile_definitions(KILTED)
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
add_compile_definitions(ROLLING)
endif()
Expand Down Expand Up @@ -50,15 +52,26 @@ target_include_directories(
${PROJECT_NAME}
PRIVATE
include
${webots_ros2_driver_INCLUDE_DIRS}
)
ament_target_dependencies(
${PROJECT_NAME}
hardware_interface
controller_manager
pluginlib
rclcpp
webots_ros2_driver
)
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
ament_target_dependencies(
${PROJECT_NAME}
hardware_interface
controller_manager
pluginlib
rclcpp
webots_ros2_driver
)
else()
target_link_libraries(${PROJECT_NAME}
PUBLIC
hardware_interface::hardware_interface
controller_manager::controller_manager
pluginlib::pluginlib
rclcpp::rclcpp
)
endif()

# Prevent pluginlib from using boost
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
Expand All @@ -74,15 +87,26 @@ target_include_directories(
${PROJECT_NAME}_system
PRIVATE
include
${webots_ros2_driver_INCLUDE_DIRS}
)
ament_target_dependencies(
${PROJECT_NAME}_system
hardware_interface
pluginlib
rclcpp
rclcpp_lifecycle
webots_ros2_driver
)
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
ament_target_dependencies(
${PROJECT_NAME}_system
hardware_interface
pluginlib
rclcpp
rclcpp_lifecycle
webots_ros2_driver
)
else()
target_link_libraries(${PROJECT_NAME}_system
PUBLIC
hardware_interface::hardware_interface
pluginlib::pluginlib
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
)
endif()

# Prevent pluginlib from using boost
target_compile_definitions(${PROJECT_NAME}_system PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
Expand Down
2 changes: 1 addition & 1 deletion webots_ros2_control/src/Ros2Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace webots_ros2_control {

WebotsResourceManager(const WebotsResourceManager &) = delete;

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

std::vector<hardware_interface::HardwareInfo> controlHardware;
Expand Down
5 changes: 5 additions & 0 deletions webots_ros2_driver/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package webots_ros2_driver
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2025.0.1 (XXXX-XX-XX)
------------------
* Replaces ament_target_dependencies with target_link_libraries.
* Adds ROS Kilted Kaiju support.

2023.1.3 (2024-08-07)
------------------
* Make webots_ros2_driver scripts executable.
Expand Down
119 changes: 82 additions & 37 deletions webots_ros2_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
add_compile_definitions(JAZZY)
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
add_compile_definitions(ROLLING)
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
add_compile_definitions(KILTED)
endif()

# ROS2 Packages
Expand All @@ -36,6 +38,8 @@ elseif($ENV{ROS_DISTRO} MATCHES "iron")
find_package(Python 3.10 EXACT REQUIRED COMPONENTS Development)
elseif($ENV{ROS_DISTRO} MATCHES "jazzy")
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
elseif($ENV{ROS_DISTRO} MATCHES "kilted")
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
elseif($ENV{ROS_DISTRO} MATCHES "rolling")
find_package(Python 3.12 EXACT REQUIRED COMPONENTS Development)
endif()
Expand Down Expand Up @@ -108,27 +112,46 @@ add_executable(driver
src/utils/Math.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(driver
rosgraph_msgs
rclcpp
pluginlib
sensor_msgs
std_msgs
tf2_geometry_msgs
tf2_ros
vision_msgs
webots_ros2_msgs
tinyxml2_vendor
TinyXML2
)

if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
ament_target_dependencies(driver
rosgraph_msgs
rclcpp
pluginlib
sensor_msgs
std_msgs
tf2_geometry_msgs
tf2_ros
vision_msgs
webots_ros2_msgs
tinyxml2_vendor
TinyXML2
)
target_link_libraries(driver
${WEBOTS_LIB}
${Python_LIBRARIES}
yaml-cpp
)
else()
target_link_libraries(driver
${rosgraph_msgs_TARGETS}
rclcpp::rclcpp
pluginlib::pluginlib
${sensor_msgs_TARGETS}
${std_msgs_TARGETS}
tf2_geometry_msgs::tf2_geometry_msgs
tf2_ros::tf2_ros
${vision_msgs_TARGETS}
${webots_ros2_msgs_TARGETS}
tinyxml2::tinyxml2
${WEBOTS_LIB}
${Python_LIBRARIES}
yaml-cpp
)
endif()
add_dependencies(driver
compile-lib-vehicle
)
target_link_libraries(driver
${WEBOTS_LIB}
${Python_LIBRARIES}
yaml-cpp
)
install(
DIRECTORY include/
DESTINATION include
Expand All @@ -146,19 +169,30 @@ add_library(
src/plugins/Ros2SensorPlugin.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(${PROJECT_NAME}_imu
rclcpp
sensor_msgs
webots_ros2_msgs
pluginlib
tf2_ros
)
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
ament_target_dependencies(${PROJECT_NAME}_imu
rclcpp
sensor_msgs
webots_ros2_msgs
pluginlib
tf2_ros
)
target_link_libraries(${PROJECT_NAME}_imu
${WEBOTS_LIB}
)
else()
target_link_libraries(${PROJECT_NAME}_imu
rclcpp::rclcpp
${sensor_msgs_TARGETS}
${webots_ros2_msgs_TARGETS}
pluginlib::pluginlib
tf2_ros::tf2_ros
${WEBOTS_LIB}
)
endif()
add_dependencies(${PROJECT_NAME}_imu
compile-lib-vehicle
)
target_link_libraries(${PROJECT_NAME}_imu
${WEBOTS_LIB}
)
install(TARGETS ${PROJECT_NAME}_imu
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
Expand All @@ -174,18 +208,28 @@ add_library(
src/plugins/Ros2SensorPlugin.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(${PROJECT_NAME}_rgbd
rclcpp
sensor_msgs
pluginlib
tf2_ros
)
if ($ENV{ROS_DISTRO} MATCHES "humble" OR $ENV{ROS_DISTRO} MATCHES "jazzy")
ament_target_dependencies(${PROJECT_NAME}_rgbd
rclcpp
sensor_msgs
pluginlib
tf2_ros
)
target_link_libraries(${PROJECT_NAME}_rgbd
${WEBOTS_LIB}
)
else()
target_link_libraries(${PROJECT_NAME}_rgbd
rclcpp::rclcpp
${sensor_msgs_TARGETS}
pluginlib::pluginlib
tf2_ros::tf2_ros
${WEBOTS_LIB}
)
endif()
add_dependencies(${PROJECT_NAME}_rgbd
compile-lib-vehicle
)
target_link_libraries(${PROJECT_NAME}_rgbd
${WEBOTS_LIB}
)
install(TARGETS ${PROJECT_NAME}_rgbd
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
Expand Down Expand Up @@ -272,4 +316,5 @@ ament_export_libraries(
${PROJECT_NAME}_rgbd
${WEBOTS_LIB_PATH}
)

ament_package()
2 changes: 1 addition & 1 deletion webots_ros2_epuck/launch/robot_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def generate_launch_description():

robot_description_path = os.path.join(package_dir, 'resource', 'epuck_webots.urdf')
ros2_control_params = os.path.join(package_dir, 'resource', 'ros2_control.yml')
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy'])
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['kilted', 'rolling', 'jazzy'])
if use_twist_stamped:
mappings = [('/diffdrive_controller/cmd_vel', '/cmd_vel'), ('/diffdrive_controller/odom', '/odom')]
else:
Expand Down
2 changes: 0 additions & 2 deletions webots_ros2_husarion/resource/rosbot_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ rosbot_base_controller:
# min_velocity - When unspecified, -max_velocity is used
max_acceleration: 1.0 # m/s^2
# min_acceleration - When unspecified, -max_acceleration is used.
max_jerk: 0.0 # m/s^3

angular:
z:
Expand All @@ -44,4 +43,3 @@ rosbot_base_controller:
# min_velocity - When unspecified, -max_velocity is used
max_acceleration: 4.0 # rad/s^2
# min_acceleration - When unspecified, -max_acceleration is used.
max_jerk: 0.0 # rad/s^3
2 changes: 0 additions & 2 deletions webots_ros2_husarion/resource/rosbot_xl_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ rosbot_xl_base_controller:
# min_velocity - When unspecified, -max_velocity is used
max_acceleration: 1.0 # m/s^2
# min_acceleration - When unspecified, -max_acceleration is used.
max_jerk: 0.0 # m/s^3

angular:
z:
Expand All @@ -44,4 +43,3 @@ rosbot_xl_base_controller:
# min_velocity - When unspecified, -max_velocity is used
max_acceleration: 4.0 # rad/s^2
# min_acceleration - When unspecified, -max_acceleration is used.
max_jerk: 0.0 # rad/s^3
2 changes: 1 addition & 1 deletion webots_ros2_tests/test/test_system_epuck.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def on_range_message_received(message):
self.wait_for_messages(self.__node, Range, '/tof', condition=on_range_message_received)

def testMovement(self):
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy'])
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy', 'kilted'])

if use_twist_stamped:
publisher = self.__node.create_publisher(TwistStamped, '/cmd_vel', 1)
Expand Down
4 changes: 2 additions & 2 deletions webots_ros2_tests/test/test_system_epuck_with_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
def generate_test_description():
initialize_webots_test()
# If ROS_DISTRO is rolling, skip the test as some required packages are missing (cf. ci_after_init.bash)
if 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy']):
pytest.skip('ROS_DISTRO is rolling or jazzy, skipping this test')
if 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy', 'kilted']):
pytest.skip('ROS_DISTRO is rolling, jazzy or kilted, skipping this test')

epuck_with_tools_webots = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
2 changes: 1 addition & 1 deletion webots_ros2_tests/test/test_system_rosbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def setUp(self):
self.__node = rclpy.create_node('driver_tester')

def testMovement(self):
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy'])
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy', 'kilted'])

publisher = None
if use_twist_stamped:
Expand Down
2 changes: 1 addition & 1 deletion webots_ros2_tests/test/test_system_rosbot_xl.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def setUp(self):
self.__node = rclpy.create_node('driver_tester')

def testMovement(self):
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy'])
use_twist_stamped = 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy', 'kilted'])

publisher = None
if use_twist_stamped:
Expand Down
4 changes: 2 additions & 2 deletions webots_ros2_tests/test/test_system_tiago.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
def generate_test_description():
initialize_webots_test()
# If ROS_DISTRO is rolling, skip the test as some required packages are missing (cf. ci_after_init.bash)
if 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy']):
pytest.skip('ROS_DISTRO is rolling or jazzy, skipping this test')
if 'ROS_DISTRO' in os.environ and (os.environ['ROS_DISTRO'] in ['rolling', 'jazzy', 'kilted']):
pytest.skip('ROS_DISTRO is rolling, jazzy or kilted, skipping this test')

tiago_webots = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
Loading
Loading