Skip to content

Mavgencpp example - #733

Merged
hamishwillee merged 4 commits into
masterfrom
mavgencpp_example
Jul 16, 2026
Merged

Mavgencpp example#733
hamishwillee merged 4 commits into
masterfrom
mavgencpp_example

Conversation

@hamishwillee

Copy link
Copy Markdown
Collaborator

This updates the MAVLink libary with information about using the C++ 11 library, following addition of the example in mavlink/mavlink#2548

@julianoes I don't actually know much about the differences so I asked Claude to write it based on the example and comparison of the generated outputs. It looks very reasonable, but of course I don't know C++ very well.

Can you sanity check this "at your convenience". If it is too much to do, then we could just cut it back to the example - but it seems like a very useful thing to have this level of docs.

@hamishwillee
hamishwillee requested a review from julianoes July 15, 2026 23:52
Comment thread en/mavgen_cpp/index.md Outdated
Comment thread en/mavgen_cpp/index.md

::: warning
Only include the header file for a single dialect.
If you need to support messages from a _number of dialects_ then create a new "parent" dialect XML file that includes them (and use its generated header as shown above).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread cspell.json
"COLORMODE",
"compid",
"configurators",
"constexpr",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beautiful.

Comment thread en/mavgen_cpp/index.md
Comment on lines +162 to +163
Unlike the C library, the C++ 11 generator does **not** emit a `mavlink::mavlink_get_msg_entry()` lookup function.
`mavlink_parse_char()` needs this internally to find the length and CRC extra of an incoming message id, so you must provide it yourself before parsing will work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's odd, isn't it. I need to look at that at some point.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Very. Thought the same. I wonder if there is a reason for this.

@hamishwillee

hamishwillee commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

@julianoes So is this "good enough"? (i.e. no approval could mean it isn't, or that you forgot, or that you still haven't finished)

@julianoes

Copy link
Copy Markdown
Contributor

I think this is good sorry. We can always improve it later.

@hamishwillee
hamishwillee merged commit ea7e26e into master Jul 16, 2026
3 checks passed
@hamishwillee
hamishwillee deleted the mavgencpp_example branch July 16, 2026 08:30
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.

2 participants