mavros icon indicating copy to clipboard operation
mavros copied to clipboard

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

Open AhmedElsafy opened this issue 2 years ago • 8 comments

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

AhmedElsafy avatar May 25 '22 15:05 AhmedElsafy

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.

vooon avatar May 27 '22 12:05 vooon

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.

AhmedElsafy avatar May 27 '22 15:05 AhmedElsafy

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?

vooon avatar May 27 '22 16:05 vooon

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 !

AhmedElsafy avatar May 27 '22 17:05 AhmedElsafy

How do you connect QGC?

vooon avatar May 27 '22 17:05 vooon

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

AhmedElsafy avatar May 27 '22 17:05 AhmedElsafy

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.

vooon avatar May 27 '22 21:05 vooon

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

AhmedElsafy avatar May 30 '22 18:05 AhmedElsafy