Skip to content

[MAVLINK] Add new mavlink messages#6062

Merged
digitalentity merged 7 commits intoiNavFlight:masterfrom
machadofelipe:machado_mavlink_update
Oct 10, 2020
Merged

[MAVLINK] Add new mavlink messages#6062
digitalentity merged 7 commits intoiNavFlight:masterfrom
machadofelipe:machado_mavlink_update

Conversation

@machadofelipe
Copy link
Contributor

20200821_231832

Hi devs, this adds a new mavlink data stream at 1Hz. This is crucial to have system messages for systems such as OpenHD.

  1. Update throttle to also show navigation thr;
  2. Send battery cell count and consumption in battery status;
  3. Send baro or imu temperature in scaled pressure sensor;
  4. Send same OSD system msg as status text.

Please, let me know if I can improve this commit. The messages are based on OSD functions and a bit duplicated, but I saw no better way to avoid messing with the OSD.

If possible, let me know your thoughts about updating iNav to the new Mavlink v2 and also including some msgs from ardupilot dialect. That way we could send ESC temperatures and Wind estimation via Mavlink.

@machadofelipe machadofelipe force-pushed the machado_mavlink_update branch from f451e16 to 178acd6 Compare August 28, 2020 16:58
@machadofelipe machadofelipe force-pushed the machado_mavlink_update branch from 178acd6 to 55ab364 Compare August 28, 2020 17:04
@machadofelipe
Copy link
Contributor Author

Updated the PR. Please review and let me know if I can improve.
Tested both in bench as in the air with MATEKF405SE + QOpenHD and wifibroadcast-osd

Below is the full list of changes:

  • Did the integration with the OSD system messages. For now the added Mavlink Status Text is limited to boards with OSD active, but in a short future I will try to generalize this part a bit more.
  • Break down the failsafe mode to map real ardu modes. When no Receiver is active and mode in iNav is only "Failsafe", there is no real correpondent mode in Ardupilot.
  • In the future it maybe better to do a getMode just for mavlink and find the correct mode without using mapping.
  • Added sensors health report. Very useful for alarms in ezwifibroadcast and old osd in OpenHD.
  • Correct heading to centidegrees added velocity per axis in global_position, as required from mavlink lib.
  • Throttle telemetry reflects the signal used to command (includes navigation throttle).
  • Added message to send battery status with cell average, number of cells, current consumed and energy consumed.
  • Added baro temperature if available or send Imu temp. instead.
  • For the new messages, a new telemetry stream (extra3) was added.
  • Mavlink library update to latest release in v1.0 (better documented and less magic numbers overall)

@machadofelipe
Copy link
Contributor Author

@digitalentity should I change anything to help the review process?

@digitalentity
Copy link
Member

Sorry, this fell through the cracks. Will have a look later on today.

@digitalentity digitalentity added this to the 2.6 milestone Oct 6, 2020
Copy link
Member

@digitalentity digitalentity left a comment

Choose a reason for hiding this comment

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

LGTM from me. @fiam can you have a second look at the changes in the OSD messages code?

@digitalentity digitalentity merged commit 04a0a92 into iNavFlight:master Oct 10, 2020
@machadofelipe machadofelipe deleted the machado_mavlink_update branch December 4, 2020 10:54
@machadofelipe machadofelipe restored the machado_mavlink_update branch December 4, 2020 10:55
@machadofelipe machadofelipe deleted the machado_mavlink_update branch December 4, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants