Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mission upload broken on mavros 0.23.0 with PX4 #957

Closed
ndepal opened this issue Feb 26, 2018 · 6 comments
Closed

Mission upload broken on mavros 0.23.0 with PX4 #957

ndepal opened this issue Feb 26, 2018 · 6 comments

Comments

@ndepal
Copy link

ndepal commented Feb 26, 2018

On Mavros 0.23.0 uploading a mission to PX4 via the waypoint push service is broken.
PX4 (SITL) rejects the mission waypoints with the warning

WARN [mavlink] WPM: Unexpected mission type (112 0)

Mavros retries the upload a few times an then fails.

Adding the line

ret.mission_type = (uint8_t)mavlink::common::MAV_MISSION_TYPE::MISSION;

below https://github.com/mavlink/mavros/blob/master/mavros/src/plugins/waypoint.cpp#L106 fixes the issue.

MAVROS version and platform

Mavros: 0.23.0, default px4.launch
ROS: Kinetic
Ubuntu: 16.04

Autopilot type and version

PX4
Version: 1.7.3

@vooon
Copy link
Member

vooon commented Feb 26, 2018

Problem is here because in Mavlink v2 MISSION_ITEM now have extension field, that should be filled with some value.
I suppose that for v1 PX4 fills with TYPE::MISSION.
And i'm not fully sure that this is not PX4 bug, because for extended fields you should expect that it might be zero in software that know nothing about that ext.

@ndepal
Copy link
Author

ndepal commented Feb 26, 2018

The problem isn't that it's zero when it shouldn't be. It's 112 when it should be 0.

@LorenzMeier
Copy link
Member

@vooon Sounds like there are missing field initializers / no default constructor? That will likely remain an issue whenever we add fields to messages.

@vooon
Copy link
Member

vooon commented Feb 26, 2018

@LorenzMeier if i remember correctly in C++11 "Class Instance{};" should be zeroed.

Message classes do not have initialisers, i wanted to use "initialiser list" feature of C++11,
but it do not work because class should not have virtual members...

@vooon
Copy link
Member

vooon commented Feb 26, 2018

And of-course C-C++ interop unit test do not have case to that situation.

@oceanusxiv
Copy link

I can confirm that @ndepal fix does resolve the issue, I think his fix should be sufficient for this situation? Since the plugin is explicitly to push mission waypoints, unless we want to generalize to pushing geofence and rally points, which are the two other types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants