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

Proposal: Support for optional values in MISSION_ITEM_INT.[x|y] #1286

Closed
DonLakeFlyer opened this issue Dec 24, 2019 · 6 comments · Fixed by #1303
Closed

Proposal: Support for optional values in MISSION_ITEM_INT.[x|y] #1286

DonLakeFlyer opened this issue Dec 24, 2019 · 6 comments · Fixed by #1303
Labels
Dev Call Issues to be discussed during the Dev Call

Comments

@DonLakeFlyer
Copy link
Contributor

As the spec currently stands the x and y values of MISSION_ITEM_INT have no mechanism to indicate an optional value. With MISSION_ITEM this is commonly done by setting the value to a NaN. Without this it limits the parameter usage for mission items which are not location based and use x/y for other things than a lat/lon. Even given that I would contend that the ability to support am optional value in lat/lon can be useful as well. For example a TAKEOFF item that has optional location with it.

We can accomplish this by spec'ing a max int value in x/y indicates the lack of an optional value.

The reason to spec that at the MISSION_ITEM_INT level as opposed to each individual message is to give a gcs enough information to handle this internally. At least for QGC it stores mission items with doubles internally and converts them as they come on. In order to do that correctly it needs to know that for any MISSION_ITEM_INT a max int value in x/y means optional. And it should convert it to a NaN on the way in.

@LorenzMeier
Copy link
Member

How about INT32_MAX?

@DonLakeFlyer
Copy link
Contributor Author

How about INT32_MAX?

Yup

@hamishwillee hamishwillee added the Dev Call Issues to be discussed during the Dev Call label Jan 9, 2020
@hamishwillee
Copy link
Collaborator

@auturgy Any thoughts on this one?

@hamishwillee
Copy link
Collaborator

@DonLakeFlyer
FMI, can you give me an example of an optional parameter in a command?
i.e. For an update message I get this - we use NAN to indicate perhaps that this sensor does not output a particular bit of information. But I don't get it for commands.

Do either of these work better for you ... ?

A modification of the params:

<field type="float" name="param4"> PARAM4, see MAV_CMD enum. NaN indicates an optional value.</field>
<field type="int32_t" name="x">PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7. INT32_MAX indicates an optional value.</field>

Or in the description

Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used to indicate optional parameters in float and integer params (respectively)., See also https://mavlink.io/en/services/mission.html.

@DonLakeFlyer
Copy link
Contributor Author

FMI, can you give me an example of an optional parameter in a command?

Look at MAV_CMD_DO_ORBIT. That has NaN support in param 5/6/7

@hamishwillee
Copy link
Collaborator

Thanks. See #1303 for proposed wording. You need to review :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev Call Issues to be discussed during the Dev Call
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants