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: import null as NaN #423

Merged
merged 3 commits into from
Jun 13, 2018
Merged

mission: import null as NaN #423

merged 3 commits into from
Jun 13, 2018

Conversation

julianoes
Copy link
Collaborator

When QGC sets a param as null it means unchanged which should
translate to NaN for mavlink mission items.

Fixes #422.

When QGC sets a param as `null` it means unchanged which should
translate to NaN for mavlink mission items.
julianoes added 2 commits June 8, 2018 14:25
We should add the functionality to support the yaw setting and then test
this here as well.
@julianoes
Copy link
Collaborator Author

According to @nicovanduijn this still doesn't work.

@@ -1203,7 +1203,12 @@ Mission::Result MissionImpl::import_mission_items(Mission::mission_items_t &all_
// Extract parameters of each mission item
std::vector<double> params;
for (auto &p : json_mission_item["params"].array_items()) {
params.push_back(p.number_value());
if (p.is_null()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check for null rightly ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests, yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, its fine.

@shakthi-prashanth-m
Copy link
Contributor

I think QGC should stick to using NaN rather. Isn't it ?

@julianoes
Copy link
Collaborator Author

I think QGC should stick to using NaN rather. Isn't it ?

I think NaN is not supported by the JSON format.

@julianoes
Copy link
Collaborator Author

@shakthi-prashanth-m agreed?

@shakthi-prashanth-m
Copy link
Contributor

shakthi-prashanth-m commented Jun 13, 2018

I think NaN is not supported by the JSON format.

Oh yeah. Sure agreed.

@julianoes julianoes merged commit aa86369 into develop Jun 13, 2018
@julianoes julianoes deleted the fix-json-null branch June 13, 2018 13:31
rt-2pm2 pushed a commit to rt-2pm2/DronecodeSDK that referenced this pull request Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants