- What command did you use to launch the Docker container?
- Are you able to ping the Docker container's IP address from the host machine?
- Are you using the Docker Desktop application?
ROS2 communication between docker container and Matlab.
8 次查看(过去 30 天)
显示 更早的评论
Hello,
I followed this guide to set up a docker container to run gazebo: https://www.mathworks.com/help/ros/ug/install-and-set-up-docker-for-ros-2-and-gazebo.html. I'm now trying to follow this guide to connect to the docker container from Simulink: https://www.mathworks.com/help/ros/ug/connect-to-a-ros-enabled-robot-from-simulink-over-ros2.html. I'm using an intel macOS with Sequoia.
The issue I'm having is that I'm not able to get the ros2 topics to show up in Matlab. They are showing correctly according to the guide inside the container, but on the matlab side they are not reflecting. I've set the domain ID on both sides to be 25 and to use rmw_fastrtps_cpp. On the matlab side the only topics that are being picked up are /parameter_events and /rosout.
Any insight into why Matlab is not picking up the topics that are reflecting inside the docker container would be greatly appreciated.
Thanks!
4 个评论
Abhishek
2025-8-11
Could you try launching the container using the host network driver (--net=host)? This option was previously unavailable on macOS, but starting with Docker Desktop v4.34, it is now supported. Here is the link to example: https://docs.docker.com/engine/network/drivers/host/
Additionally, could you verify whether communication is working between two containers? For example, you can create two containers: run a publisher in one and a subscriber in the other. You may use the ROS 2 demo pub-sub example:
To create publisher:
source /opt/ros/jazzy/setup.bash
ros2 run demo_nodes_cpp talker
To create subscriber:
source /opt/ros/jazzy/setup.bash
ros2 run demo_nodes_cpp listener
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!