Skip to content

Failed to subscribe ROS 2 topic between pixi and Docker container with Cyclone DDS #292

@atinfinity

Description

@atinfinity

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

I failed to subscribe ROS 2 topic between pixi and Docker container with Cyclone DDS.

Steps to reproduce

Install pixi

curl -fsSL https://pixi.sh/install.sh | bash

Create project

pixi init my_ros2_project -c robostack-humble -c conda-forge
cd my_ros2_project

Install package

pixi add ros-humble-desktop

Launch Docker container

I enabled host networking in Docker Desktop via setting.
And, I launched Docker container.

docker run --rm -it \
           --net=host \
           --ipc=host \
           ros:humble-perception \
           bash

I changed to Cyclone DDS on Docker container.

apt update
apt install ros-humble-rmw-cyclonedds-cpp
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

Pub

I published topic on pixi.

pixi run ros2 topic pub --rate 1 /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}"

Sub

And I tried to subscribe topic on Docker container.
But, I could not subscribe topic between pixi and Docker container.

ros2 topic echo /turtle1/cmd_vel

Expected behavior

I expected the following result between pixi and Docker container.

ros2 topic list
/parameter_events
/rosout
/turtle1/cmd_vel
ros2 topic echo /turtle1/cmd_vel
linear:
  x: 2.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 1.8

Supplementary information

I changed to Fast DDS. As a result, I could subscribe topic.

ros2 topic echo /turtle1/cmd_vel
linear:
  x: 2.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 1.8

Installed packages

The result of `pixi list` longer than 65536 characters.
So, I upload to <https://gist.github.com/atinfinity/77a5273feef1bfa1e48fe6ddb1d4cc3c>

Environment info

$ pixi info
System
------------
       Pixi version: 0.45.0
           Platform: osx-arm64
   Virtual packages: __unix=0=0
                   : __osx=14.4=0
                   : __archspec=1=m1
          Cache dir: /Users/dandelion/Library/Caches/rattler/cache
       Auth storage: /Users/dandelion/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /Users/dandelion/.pixi/bin
    Environment dir: /Users/dandelion/.pixi/envs
       Manifest dir: /Users/dandelion/.pixi/manifests/pixi-global.toml

Workspace
------------
               Name: my_ros2_project
            Version: 0.1.0
      Manifest file: /Users/dandelion/my_ros2_project/pixi.toml
       Last updated: 19-04-2025 16:28:31

Environments
------------
        Environment: default
           Features: default
           Channels: robostack-humble, conda-forge
   Dependency count: 1
       Dependencies: ros-humble-desktop
   Target platforms: osx-arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions