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

Missing fields in some ardupilotmega structs #190

Closed
ExpertOfNil opened this issue Aug 10, 2023 · 2 comments
Closed

Missing fields in some ardupilotmega structs #190

ExpertOfNil opened this issue Aug 10, 2023 · 2 comments

Comments

@ExpertOfNil
Copy link

Cargo.toml entry:

[dependencies]
mavlink = "0.11.2"

I've run into an issue, when composing certain structs, where the documentation (and linked source) shows a public field is present, but the field is not recognized locally. Here are a couple examples:

use mavlink::ardupilotmega::{MavMessage, SET_GPS_GLOBAL_ORIGIN_DATA};
let message = MavMessage::SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA {
    target_system: self.ctx.config.drone.system_id,
    latitude: req.latitude,
    longitude: req.longitude,
    altitude: req.altitude,
    time_usec: 0_u64, // no such field
});
use mavlink::ardupilotmega::{MavMessage, ATT_POS_MOCAP_DATA};
let message = MavMessage::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA {
    time_usec: 0,
    q: [1_f32, 0_f32, 0_f32, 0_f32],
    x: 0_f32,
    y: 0_f32,
    z: 0_f32,
    covariance: [0_f32; 21],  // no such field
});

These are the two I can recall off-hand. Any clarity here would be appreciated.

@nknotts
Copy link

nknotts commented Aug 12, 2023

The missing fields are marked as extensions in the message definition xml. To enable extensions, you must add the emit-extensions feature. Example: add to Cargo.toml

mavlink = { version = "0.11.2", features = ["emit-extensions"] }

@ExpertOfNil
Copy link
Author

The missing fields are marked as extensions in the message definition xml. To enable extensions, you must add the emit-extensions feature. Example: add to Cargo.toml

mavlink = { version = "0.11.2", features = ["emit-extensions"] }

Thank you for clearing that up for me!

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

No branches or pull requests

3 participants