ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Subscribe to remote topic without slowing down the remote machine

asked 2022-12-06 13:30:57 -0500

fhwedel-hoe gravatar image

Hi all

I am using ROS 2 humble in an academic context. We have a model car equiped with a motor and some sensors including a camera. The camera is used for lane detection. All image-processing happens on the car. Within the car's system, data transfer happens via local inter-process-communication faciliated by image_transport::CameraPublisher and the default eProsima Fast DDS.

During development, it is helpful to view the camera output while the car is moving. To achieve this, we rely on ROS 2's integrated network capabilities. On another machine (a laptop) we simply open up an image viewer like rqt. The machines are connected via wireless LAN.

Camera Node ─┬─► Computer Vision Node ──► Motor Control Node
          (wifi)
             └─► Image Viewer

Now for the problem: If the wireless network is saturated, the publisher in the Camera Node starts slowing down. The overall frame-rate decreases to the point the control loop becomes unstable and the car crashes into things. This shows: Subscribing to the remote topic comes with some nasty side-effects – a Heisenbug, but in reverse.

It does not matter if I use rmw_qos_profile_default with RMW_QOS_POLICY_RELIABILITY_RELIABLE or rmw_qos_profile_sensor_data with RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT. I even adjusted the deadline and lifespan to match the desired frame-rate, but it makes no difference. If the network is too busy, I receive no frames at all. I expected frames to be dropped, but at least one frame every couple of seconds should be doable.

I understand that I cannot have reliable real-time wireless data transfer, but connecting a remote subscriber should never affect its internal communication this way. How can I subscribe to the camera without affecting the car's performance?

Kind Regards

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-12-16 12:16:14 -0500

ChuiV gravatar image

DDS was never intended be be used over wireless networks. I've used the zenoh dds bridge before, and it works really well. You may consider trying that: https://github.com/eclipse-zenoh/zeno....

This setup will look like camera node -> zenoh_bridge -> wifi -> zenoh_bridge -> rqt

This way you have localhost traffic between all your on-vehicle nodes, then a separate node just to push that traffic out. Be sure to ensure your laptop's rqt isn't still trying to talk directly to your on-vehicle nodes. You can change your laptops domain id to help.

edit flag offensive delete link more

Comments

Thank you for your suggestion. Yet I hope there is a better solution. For us, the inherent transparent network capabilities always were a significant feature of ROS 1. If those were no longer usable in ROS 2, that would be a huge disappointment.

fhwedel-hoe gravatar image fhwedel-hoe  ( 2022-12-19 04:29:20 -0500 )edit

I totally agree. I wish that dds would work better over wireless networks.

The zenoh dds bridge does help with that by specifically forwarding the ros2 discovery information (with some slight modifications) through the zenoh network. This makes the bridge nearly transparent,

If you're still wanting to do this "pure" ros2, you could take a look at the fastdds "Large Data Rates" document (https://fast-dds.docs.eprosima.com/en...) and see if any of those suggestions help you.

ChuiV gravatar image ChuiV  ( 2022-12-19 06:16:43 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-12-06 13:30:57 -0500

Seen: 114 times

Last updated: Dec 16 '22