mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
884 stars 992 forks source link

Mission waypoint list does not update when a new mission file is uploaded to PX4 #1749

Open AhmedElsafy opened 2 years ago

AhmedElsafy commented 2 years ago

This is only bug and feature tracker, please use it to report bugs or request features.


Issue details

MAVROS topic /mavros/mission/waypoints does not update when new mission file is uploaded from the Ground station software

MAVROS version and platform

Mavros: 0.18.4 ROS: Kinetic Ubuntu: 16.04

Autopilot type and version

PX4

Version: 1.13-beta

Diagnostics

Subscribing to the topic and uploading a new mission file

rostopic echo -c /mavros/mission/waypoints

When the service /mavros/mission pull is called, the topic is updated

vooon commented 2 years ago

Did you use different interface to upload mission than mavros uses?

Mission protocol does not broadcast changes. Plugin may catch mission messages directed to gcs and schedule a pull only if mavros used as a proxy. Anyway it's not guaranteed to update. You must pull waypoints.

AhmedElsafy commented 2 years ago

I used QGC to upload the mission file while subscribing to the waypoints topic, but I see no UORB message with the waypoints list, there are two UORB messages mission and mission_result and they both do not describe the mission list, so that tells me the plugin mechanism is generating the list through pulling the file, the problem is when the list changes from QGC, nothing will trigger it to pull again I guess. Is there any recommended way to avoid that, I dont find it visable to keep pulling every iteration in the ros while loop.

vooon commented 2 years ago

Mavros works with MAVLink, not uORB. If the message traffic between GCS and FCU comes trough mavros, it's possible to detect mission update. Otherwise you cannot get any signal that the list have been updated.

Anyway, why do you need to renew the list so often?

AhmedElsafy commented 2 years ago

I have developed a ros node running on boot in the background that subscribes to the mission list and at a mission item with a certain mav cmd number, the ros node takes over in offboard mode and perform a specific actions, activate servos etc. At the first run on boot, everything works as expected, second run with an updated mission file, the ros node still acts as per the old list becuase the new list was never published.

I can see on the MAVLINK inspector, PX4 does not publish the list, so I guess the only solution for now is to have a timed mavros pull service to update the mission list every 10 sec maybe !

vooon commented 2 years ago

How do you connect QGC?

AhmedElsafy commented 2 years ago

QGC is connected throw mav radio (SIK) on the first telemtry port, ros running on the OBC connected to a second telemetry port with a different mavlink forwarding

vooon commented 2 years ago

If you connect SiK to the OBC and let gcs_url to proxy your telemetry, you'll be able to catch list update. But at the same time, that setup less fault tolerant.

AhmedElsafy commented 2 years ago

for now as a work around I will add a subscriber to the flight mode topic with a call back function that calls the mission list pull service when the flight mode is switched to Mission mode