d3ngit / djihdfpv_mavlink_to_msp_V2

DJI_mavlink_to_MSP_V2
57 stars 23 forks source link

question on the osd positions #12

Open ramiss opened 4 years ago

ramiss commented 4 years ago

Hi,

Thanks so much for this library. I am trying to expand and add the ability to show nav_status (and others). I have no problem sending the message and figuring out the message id, etc. Where I am stuck is on the OSD position. Specifically the struct msp_osd_config_t, which doesn't seem to have a listing for "nav_status"

Your listing of variables in struct msp_osd_config_t is more than I've found in any other repository so far. Can it be expanded? Is there an even larger list you could point me to?

Thanks for any help.

Richard

d3ngit commented 4 years ago

I think I took the list from here https://github.com/betaflight/betaflight/blob/master/src/main/osd/osd.h

I don't see any nav_status

typedef enum { OSD_RSSI_VALUE, OSD_MAIN_BATT_VOLTAGE, OSD_CROSSHAIRS, OSD_ARTIFICIAL_HORIZON, OSD_HORIZON_SIDEBARS, OSD_ITEM_TIMER_1, OSD_ITEM_TIMER_2, OSD_FLYMODE, OSD_CRAFT_NAME, OSD_THROTTLE_POS, OSD_VTX_CHANNEL, OSD_CURRENT_DRAW, OSD_MAH_DRAWN, OSD_GPS_SPEED, OSD_GPS_SATS, OSD_ALTITUDE, OSD_ROLL_PIDS, OSD_PITCH_PIDS, OSD_YAW_PIDS, OSD_POWER, OSD_PIDRATE_PROFILE, OSD_WARNINGS, OSD_AVG_CELL_VOLTAGE, OSD_GPS_LON, OSD_GPS_LAT, OSD_DEBUG, OSD_PITCH_ANGLE, OSD_ROLL_ANGLE, OSD_MAIN_BATT_USAGE, OSD_DISARMED, OSD_HOME_DIR, OSD_HOME_DIST, OSD_NUMERICAL_HEADING, OSD_NUMERICAL_VARIO, OSD_COMPASS_BAR, OSD_ESC_TMP, OSD_ESC_RPM, OSD_REMAINING_TIME_ESTIMATE, OSD_RTC_DATETIME, OSD_ADJUSTMENT_RANGE, OSD_CORE_TEMPERATURE, OSD_ANTI_GRAVITY, OSD_G_FORCE, OSD_MOTOR_DIAG, OSD_LOG_STATUS, OSD_FLIP_ARROW, OSD_LINK_QUALITY, OSD_FLIGHT_DIST, OSD_STICK_OVERLAY_LEFT, OSD_STICK_OVERLAY_RIGHT, OSD_DISPLAY_NAME, OSD_ESC_RPM_FREQ, OSD_RATE_PROFILE_NAME, OSD_PID_PROFILE_NAME, OSD_PROFILE_NAME, OSD_RSSI_DBM_VALUE, OSD_RC_CHANNELS, OSD_CAMERA_FRAME, OSD_EFFICIENCY, OSD_ITEM_COUNT // MUST BE LAST } osd_items_e;

d3ngit commented 4 years ago

If you added/removed something from the list you would need to change at least the OSD_ITEM_COUNT to the correct number.

ramiss commented 4 years ago

Thank you for the response, it was helpful in fixing one of my assumptions. After looking through the code again and comparing to other MSP code, it seems that the OSD items, and the enumerated order that those positions are sent, are very specific to the protocol. In other words, the protocol relies on the config parameters being ordered a certain way and, if you adjust that then you add to the count and the list. My initial assumption was a bit off on this logic.

I do see what you mean about nav_status not being an OSD option. Flight Mode is actually what I am trying to achieve, so I'm working on implementing that.

Thanks again!