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

AP_MSP: multi screen and stats support for DJI FPV OSD #18396

Merged
merged 2 commits into from Sep 15, 2021

Conversation

yaapu
Copy link
Contributor

@yaapu yaapu commented Aug 19, 2021

This adds multiple screens and stats to the DJI MSP Backend.
Support for multiple screens is similar to regular OSD, one has to enable the additional screens with OSDn_ENABLE and switch between them with one of the supported methods defined by OSD_SW_METHOD.

Stats needed a "hack", when a user switches to a screen that has stats enabled with OSDn_STATS_EN = 1, the telemetry for speed, altitude, voltage, current and distance will report min/max values rather than instant values.

The home distance OSD item will alternate every 2 seconds between max home distance and total traveled distance

The message text OSD item will report "STATS hh:mm" where hh:mm is the flight time and just like usual incoming status text messages will be shown with rolling text.

image

stats panels have to be individually enabled

  • OSDn_STATS_EN 1.000000, required to enable the new stats feature
  • OSDn_MESSAGE_EN 1.000000, required to display flight time in stats display mode
  • OSDn_ALTITUDE_EN 1.000000, shows max altitude
  • OSDn_BAT_VOLT_EN 1.000000, shows min voltage
  • OSDn_CURRENT_EN 1.000000, shows max current
  • OSDn_GSPEED_EN 1.000000, shows max ground speed
  • OSDn_HOMEDIST_EN 1.000000, alternates max distance from home and total traveled distance every 2 seconds
  • OSDn_RSSI_EN 1.000000, shows min rssi

Note: to get airspeed max rather than gspeed max just like usual one have to set OSDn_ASPEED_EN =1

A possible layout:

OSD2_ENABLE 1.000000
OSD2_STATS_EN 1.000000
OSD2_MESSAGE_EN 1.000000
OSD2_MESSAGE_X 14.000000
OSD2_MESSAGE_Y 3.000000
OSD2_ARMING_EN 1.000000
OSD2_ARMING_X 12.000000
OSD2_ARMING_Y 0.000000
OSD2_ALTITUDE_EN 1.000000
OSD2_ALTITUDE_X 11.000000
OSD2_ALTITUDE_Y 6.000000
OSD2_BATUSED_EN 1.000000
OSD2_BATUSED_X 12.000000
OSD2_BATUSED_Y 11.000000
OSD2_BAT_VOLT_EN 1.000000
OSD2_BAT_VOLT_X 12.000000
OSD2_BAT_VOLT_Y 8.000000
OSD2_CLK_EN 1.000000
OSD2_CLK_X 12.000000
OSD2_CLK_Y 0.000000
OSD2_CURRENT_EN 1.000000
OSD2_CURRENT_X 11.000000
OSD2_CURRENT_Y 9.000000
OSD2_GPSLAT_EN 1.000000
OSD2_GPSLAT_X 9.000000
OSD2_GPSLAT_Y 13.000000
OSD2_GPSLONG_EN 1.000000
OSD2_GPSLONG_X 9.000000
OSD2_GPSLONG_Y 14.000000
OSD2_GSPEED_EN 1.000000
OSD2_GSPEED_X 13.000000
OSD2_GSPEED_Y 5.000000
OSD2_HOMEDIST_EN 1.000000
OSD2_HOMEDIST_X 13.000000
OSD2_HOMEDIST_Y 7.000000
OSD2_RSSI_EN 1.000000
OSD2_RSSI_X 13.000000
OSD2_RSSI_Y 10.000000

yielding

image

@yaapu yaapu added Library NeedsTesting OSD On screen display WikiNeeded needs wiki update labels Aug 19, 2021
@yaapu yaapu force-pushed the pr/msp_osd_multiscreen branch 6 times, most recently from 895b217 to 1069965 Compare August 22, 2021 10:19
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Light review only

This is going to be cool.

libraries/AP_OSD/AP_OSD_Setting.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP.h Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_Backend.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Outdated Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Outdated Show resolved Hide resolved
libraries/AP_OSD/AP_OSD.h Show resolved Hide resolved
@yaapu yaapu force-pushed the pr/msp_osd_multiscreen branch 4 times, most recently from b379d6a to e9f2c9e Compare August 23, 2021 16:49
@yaapu
Copy link
Contributor Author

yaapu commented Aug 23, 2021

This version does not automatically enable any stats panels but rather gives the user the freedom to enable and place items on screen individually

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Looks like this might need to be rebased on master?

libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Show resolved Hide resolved
libraries/AP_MSP/AP_MSP_Telem_DJI.cpp Outdated Show resolved Hide resolved
libraries/AP_OSD/AP_OSD.h Outdated Show resolved Hide resolved
@peterbarker
Copy link
Contributor

Is it just me or are we blowing a rather large number of parameters that will never be used for all of the _EN stuff?

@peterbarker
Copy link
Contributor

There seems to be more flashing when in stats mode than should be including "ACRO" which makes no sense...
and it is claiming 14 satellites when the plane hasn't seen a single one.

@yaapu
Copy link
Contributor Author

yaapu commented Aug 24, 2021

Is it just me or are we blowing a rather large number of parameters that will never be used for all of the _EN stuff?

I had the same feeling, there also are quite some zombies among the symbols and fonts, so we really have many more "unused" symbols than one might think by looking at the fonts table.
We should do some cleaning, but who's the "we" ?

@yaapu
Copy link
Contributor Author

yaapu commented Aug 24, 2021

There seems to be more flashing when in stats mode than should be including "ACRO" which makes no sense...

not sure I understand this?
Flashing right now is orthogonal to stats mode, it would flash irregardless, are you implying that when stats are enabled we should suspend any kind of flashing?

and it is claiming 14 satellites when the plane hasn't seen a single one.

14 sats when no fix is a known DJI bug, I never really tried to find a hack for it

@yaapu yaapu removed the WikiNeeded needs wiki update label Aug 27, 2021
@yaapu yaapu force-pushed the pr/msp_osd_multiscreen branch 4 times, most recently from 6208cbb to fa5a063 Compare September 3, 2021 14:12
@yaapu yaapu force-pushed the pr/msp_osd_multiscreen branch 2 times, most recently from 4a35c54 to 180a785 Compare September 6, 2021 14:08
@@ -43,9 +43,9 @@ const AP_Param::GroupInfo AP_MSP::var_info[] = {
// @Param: _OPTIONS
// @DisplayName: MSP OSD Options
// @Description: A bitmask to set some MSP specific options
// @Bitmask: 0:EnableTelemetryMode, 1: DJIWorkarounds
Copy link
Contributor

Choose a reason for hiding this comment

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

discussed on call, better to remove the DJI option, and use backend choice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shellixyz any objections in removing the DJI Workaround option altogether and simply enable all DJI workarounds by default? Users should be unaffected

Copy link
Contributor

Choose a reason for hiding this comment

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

No objection 👍

@peterbarker
Copy link
Contributor

Tested locally and works well - thanks, merging!

@peterbarker peterbarker merged commit 94aba33 into ArduPilot:master Sep 15, 2021
Hwurzburg added a commit to Hwurzburg/ardupilot that referenced this pull request Oct 31, 2022
rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this pull request Nov 17, 2022
tridge pushed a commit to tridge/ardupilot that referenced this pull request Nov 21, 2022
rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this pull request Nov 21, 2022
rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this pull request Nov 21, 2022
obox-tech pushed a commit to obox-tech/ardupilot that referenced this pull request Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Library OSD On screen display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants