mavros icon indicating copy to clipboard operation
mavros copied to clipboard

ROS2 RTK setup - replacement for gcs_bridge

Open diablo1281 opened this issue 2 years ago • 7 comments

Issue details

Hi, I am trying to connect RTK node to mavros node. I have a device on the network that sends Mavlink messages with RTCM for all UAVs in the network (it is seen as a vehicle with its own ID). On ROS1 I used gcs_bridge and it worked fine. Now as I updated to ROS2 I can't get it to work. I tried to modify mavros_node to accept additional GCS in the router setup, but messages are not visible in the Mavlink Inspector on QGCS and the drone doesn't receive any RTCM messages.

I would appreciate any help on this topic.

MAVROS version and platform

Mavros: ros2 branch ROS: Humble (compiled from source) Ubuntu: Debian Bullseye RT

Autopilot type and version

[ ] ArduPilot [ X] PX4

Version: 1.13.1

diablo1281 avatar Oct 09 '23 12:10 diablo1281

You don't need gcs_bridge anymore. Just call router to add additional link: https://github.com/mavlink/mavros/blob/ros2/mavros_msgs/srv/EndpointAdd.srv

Note that router doesn't pass messages from the same endpoint type. So message coming from GCS will be routed to FCU, but not to other GCS (i.e. QGC).

vooon avatar Oct 09 '23 17:10 vooon

See also:

https://github.com/mavlink/mavros/blob/e0be266e675db5b3d615404d910c164430d46da9/mavros/include/mavros/mavros_router.hpp#L116-L133

vooon avatar Oct 09 '23 17:10 vooon

@vooon thanks for anwers.

I still didn't get it to work. After trying to create an endpoint for the RTK station there are no incoming messages to MAVROS from it. I did try it through C++ module code and service. Also, I disabled the block for exchanging messages between the same type of endpoint to find out it using QGC. As a result, in Mavlink Inspector I can see UAV and QGC messages, but no RTK. Also, I did try to connect 2 QGC with different IDs and there is some strange behavior - sometimes it connects, sometimes not. Messages are getting laggy also.

I think I tried everything but without luck. Do you have any tips?

diablo1281 avatar Nov 10 '23 09:11 diablo1281

That's odd. Probably you can try to put mavlink-router in front of mavros router as a workaround.

vooon avatar Nov 10 '23 10:11 vooon