Skip to content

Commit

Permalink
add rmw zenoh support to rmw plugin
Browse files Browse the repository at this point in the history
Fixes #307
  • Loading branch information
tfoote committed Feb 1, 2025
1 parent 66fe159 commit 3885a3f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/rocker/rmw_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RMW(RockerExtension):
rmw_map = {
'cyclonedds': ['ros-${ROS_DISTRO}-rmw-cyclonedds-cpp'],
'fastrtps' : ['ros-${ROS_DISTRO}-rmw-fastrtps-cpp'],
'zenoh' : ['ros-${ROS_DISTRO}-rmw-zenoh-cpp'],
# TODO(tfoote) Enable connext with license acceptance method
# 'connextdds': ['ros-${ROS_DISTRO}-rmw-connextdds'],
}
Expand Down
2 changes: 1 addition & 1 deletion src/rocker/templates/rmw_snippet.Dockerfile.em
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@[ if rmw ]@
RUN \
if [ -z "${ROS_DISTRO}" ]; then echo "ROS_DISTRO is unset cannot override RMW" ; exit 1 ; fi ;\
if dpkg -l @(' '.join(packages)) > /dev/null 2>&1; then \
if ! dpkg -l @(' '.join(packages)) | grep -q ^ii ; then \
apt-get update \
&& DEBIAN_FRONTENT=non-interactive apt-get install -qy --no-install-recommends\
@(' '.join(packages)) \
Expand Down
16 changes: 10 additions & 6 deletions test/test_rmw_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ def test_rmw_extension(self):
plugins = list_plugins()
rmw_plugin = plugins['rmw']

rmws_to_test = ['fastrtps', 'cyclonedds', 'zenoh']

p = rmw_plugin()
self.assertTrue(plugin_load_parser_correctly(rmw_plugin))

mock_cliargs = {'rmw': ['cyclonedds']}
dig = DockerImageGenerator([rmw_plugin()], mock_cliargs, 'ros:rolling')
self.assertEqual(dig.build(), 0)
self.assertEqual(dig.run(command='dpkg -l ros-rolling-rmw-cyclonedds-cpp'), 0)
self.assertIn('-e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp', dig.generate_docker_cmd('', mode='dry-run'))
dig.clear_image()

for rmw_name in rmws_to_test:
mock_cliargs = {'rmw': [rmw_name]}
dig = DockerImageGenerator([rmw_plugin()], mock_cliargs, 'ros:rolling')
self.assertEqual(dig.build(), 0, msg=f'dig.build for rmw {rmw_name} failed')
self.assertEqual(dig.run(command=f'dpkg -l ros-rolling-rmw-{rmw_name}-cpp'), 0)
self.assertIn(f'-e RMW_IMPLEMENTATION=rmw_{rmw_name}_cpp', dig.generate_docker_cmd('', mode='dry-run'))
dig.clear_image()

0 comments on commit 3885a3f

Please sign in to comment.