mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
847 stars 983 forks source link

ROS2 RTK setup - replacement for gcs_bridge #1905

Open diablo1281 opened 8 months ago

diablo1281 commented 8 months ago

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

vooon commented 8 months ago

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 commented 8 months ago

See also:

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

diablo1281 commented 7 months ago

@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?

vooon commented 7 months ago

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