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

RC via MAVLink & MAVLink V2 Support #6738

Merged
merged 18 commits into from
Apr 10, 2021
Merged

RC via MAVLink & MAVLink V2 Support #6738

merged 18 commits into from
Apr 10, 2021

Conversation

harryjph
Copy link
Contributor

@harryjph harryjph commented Mar 24, 2021

Closes #6571

This PR

  • Updates the MAVLink library to V2 (this is the reason this PR is so huge, it's mostly auto generated, sorry 😢)
  • Implements some of the new V2 fields in the messages already in use
  • Adds scripts for both Windows and Mac/Linux to easily automatically generate the MAVLink library should any updates be needed in the future
  • Adds command line option mavlink_version to switch back to MAVLink V1 for backwards compatibility (defaults to V2)
  • Adds serial receiver option "MAVLink". With this receiver option, MAVLink RC Channels Override messages are used as the RC signal. Failsafe works as expected when a message is not received for a long time. Supports up to 18 channels with MAVLink V2, only 8 with MAVLink V1. When using this option, whichever serial port is configured for MAVLink will be used for RC input, and the Serial RX option is ignored.

@harryjph
Copy link
Contributor Author

Hm, looks like I need to make sure docs are updated. Do I just need to run build_docs.sh?

@harryjph harryjph changed the title RC via MAVLink RC via MAVLink & MAVLink V2 Support Mar 24, 2021
@avsaase
Copy link
Member

avsaase commented Mar 24, 2021

You need to run src/utils/update_cli_docs.py

@harryjph
Copy link
Contributor Author

@avsaase Thank you very much!

@harryjph
Copy link
Contributor Author

Looks like this consumes nearly 41k extra flash on F411.... yikes. I'll have to optimize it a lot. Seems like most of it is coming from the MAVLink library which should get mostly optimized away by the compiler... Obviously not...

@nathanjel
Copy link
Contributor

Hey, maybe, just by the way, You could consider addressing #6577 in Your commits? :)

@DzikuVx
Copy link
Member

DzikuVx commented Apr 5, 2021

@harry1453 any chance of optimization of the MAVLink in the next few weeks? I have a feeling F411 are not the only ones that are failing and the same happens with F722.
Maybe the way to go is to enable RC MAVlink override on all targets and MAVLink V2 only on targets with > 512 flash?

@harryjph
Copy link
Contributor Author

harryjph commented Apr 5, 2021

@DzikuVx Yes, I'll get on to this as soon as I can. My current idea for optimization is to try and slim down the MAVLink library and remove all the messages that we aren't using. I don't know why but it appears that the compiler isn't optimizing them out when it should. Failing that we might, as you said, need a compiler switch for MAVLink V2... but that would make things very complicated as the libraries are different and every library call would need the compiler switch.

@nathanjel I'll take a look!

@harryjph
Copy link
Contributor Author

harryjph commented Apr 6, 2021

Turns out the MAVLink library declares every single function as inline.

Target MATEKF411SE
Before: 452121 bytes (91.98%)
After: 455069 bytes (92.58%)

@DzikuVx DzikuVx added this to the 3.0 milestone Apr 7, 2021
@DzikuVx DzikuVx added the Release Notes Add this when a PR needs to be mentioned in the release notes label Apr 9, 2021
@DzikuVx
Copy link
Member

DzikuVx commented Apr 9, 2021

@harry1453 please resolve conflicts and let's merge it. Thanks a lot!

# Conflicts:
#	docs/Settings.md
#	src/main/fc/settings.yaml
#	src/main/target/common.h
#	src/main/telemetry/telemetry.c
@DzikuVx
Copy link
Member

DzikuVx commented Apr 10, 2021

The time has come, let's merge it! Thanks a lot @harry1453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RC via Mavlink
4 participants