MAVSDK-Proto icon indicating copy to clipboard operation
MAVSDK-Proto copied to clipboard

mission_raw: add planned home position

Open JonasVautherin opened this issue 2 years ago • 9 comments

Goes with https://github.com/mavlink/MAVSDK/pull/2115

The thing is that now it forces everybody to set that value (we can't have it optional with the auto-generation) :thinking:. I wonder if that's reasonable or not :thinking:.

Do users even use the MissionImportData directly, or is it just used in the implementation somehow?

@RomanBapst: what do you think?

JonasVautherin avatar Aug 15 '23 10:08 JonasVautherin

The thing is that now it forces everybody to set that value

Ok now it has a has_planned_home_position boolean to say whether that field is set or not :+1:.

JonasVautherin avatar Aug 15 '23 15:08 JonasVautherin

But this won't have any effect for PX4, which would be confusing.

I think it is just part of the parsing of a QGC .plan, in this case made for PX4 :thinking:. My understanding is that we already do parse it, it's just that we ignore this element (and therefore lose it in translation). In this case Roman needs this element for the PX4 integration tests, I believe.

Are we talking about the ArduPilot feature where home needs to be in 0

I am not completely sure what this "planned home position" is. Maybe @RomanBapst can elaborate a bit here?

JonasVautherin avatar Aug 16 '23 08:08 JonasVautherin

@julianoes For the PX4 integration tests I need to be able to move the mission to the location of the vehicle. We already do this here However, what we do is to move the mission such that the first waypoint coincides with the vehicle position. For a VTOL mission this is not correct as the first waypoint is a VTOL takeoff which actually specifies a transition direction and should not be places over the vehicle. That's why I needed to get hold of the planned home position which I saw MAVSDK did not expose yet and thus the PR.

RomanBapst avatar Aug 16 '23 10:08 RomanBapst

I see. So what's the behavior if someone sets that field and then the home position is different from the planned one? Is everything shifted?

julianoes avatar Aug 17 '23 00:08 julianoes

So what's the behavior if someone sets that field and then the home position is different from the planned one? Is everything shifted?

@julianoes This is not really the problem of MAVSDK, is it? All that MAVSDK does it telling the user that the plan file which has been loaded contains a planned home position and the values are such and such. The integrator can use that (I am using is for integration testing) but MAVSDK should not care. Does that make sense?

RomanBapst avatar Aug 17 '23 08:08 RomanBapst

Oh, now I understand! This has nothing to do with upload. Sorry, I missed that. Hm, ok. Would be nice to have an example that shows how to use the value, if set. Or at least make it very clear from the description of the field. And make sure to fix the linting/CI.

julianoes avatar Aug 18 '23 02:08 julianoes

This won't go into v1.4 though but I'd say v2/main.

julianoes avatar Aug 24 '23 00:08 julianoes

@julianoes I will try to add an example. Maybe loading a VTOL mission from a plan file and making sure that the distance between planned home and the VTOL takeoff item is more than X?

RomanBapst avatar Aug 24 '23 05:08 RomanBapst

Sure, whatever you would use it for.

julianoes avatar Aug 25 '23 03:08 julianoes