Added navigation message and view.
This commit is contained in:
@@ -90,6 +90,9 @@ void menuTelemetryMavlink(uint8_t event) {
|
|||||||
case MENU_BATT:
|
case MENU_BATT:
|
||||||
menuTelemetryMavlinkBattery();
|
menuTelemetryMavlinkBattery();
|
||||||
break;
|
break;
|
||||||
|
case MENU_NAV:
|
||||||
|
menuTelemetryMavlinkNavigation();
|
||||||
|
break;
|
||||||
case MENU_GPS:
|
case MENU_GPS:
|
||||||
menuTelemetryMavlinkGPS();
|
menuTelemetryMavlinkGPS();
|
||||||
break;
|
break;
|
||||||
@@ -337,6 +340,42 @@ void menuTelemetryMavlinkBattery(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! \brief Navigation dislplay
|
||||||
|
* \details Shows Navigation telemetry.
|
||||||
|
*/
|
||||||
|
void menuTelemetryMavlinkNavigation(void) {
|
||||||
|
|
||||||
|
mav_title(PSTR("NAV"), MAVLINK_menu);
|
||||||
|
|
||||||
|
uint8_t x, y, ynum;
|
||||||
|
x = 7 * FWNUM;
|
||||||
|
// x = xnum + 0 * FW;
|
||||||
|
ynum = 2 * FH;
|
||||||
|
y = FH;
|
||||||
|
|
||||||
|
|
||||||
|
x = 0;
|
||||||
|
lcd_puts (x, y, PSTR("Course"));
|
||||||
|
lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.course, (DBLSIZE | UNSIGN));
|
||||||
|
lcd_puts(x + 7 * FWNUM, ynum, PSTR("o"));
|
||||||
|
x += 8 * (2 * FWNUM);
|
||||||
|
lcd_puts(x, y, PSTR("Heading"));
|
||||||
|
lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.heading, (DBLSIZE | UNSIGN));
|
||||||
|
lcd_puts(x + 7 * FWNUM, ynum, PSTR("o"));
|
||||||
|
y += 3 * FH;
|
||||||
|
ynum += 3 * FH;
|
||||||
|
|
||||||
|
x = 0;
|
||||||
|
lcd_puts (x, y, PSTR("Bearing"));
|
||||||
|
lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.bearing, (DBLSIZE | UNSIGN));
|
||||||
|
lcd_puts(x + 7 * FWNUM, ynum + FH, PSTR("o"));
|
||||||
|
x += 8 * (2 * FWNUM);
|
||||||
|
/* lcd_puts(x, y, PSTR("PC RSSI"));
|
||||||
|
lcd_outdezAtt(x + 7 * FWNUM, ynum, telemetry_data.pc_rssi, (DBLSIZE | UNSIGN));
|
||||||
|
lcd_puts(x + 7 * FWNUM, ynum + FH, PSTR("%"));
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief GPS information menu
|
/*! \brief GPS information menu
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ void mav_title(const pm_char * s, uint8_t index);
|
|||||||
void menuTelemetryMavlinkInfos(void);
|
void menuTelemetryMavlinkInfos(void);
|
||||||
void menuTelemetryMavlinkFlightMode(void);
|
void menuTelemetryMavlinkFlightMode(void);
|
||||||
void menuTelemetryMavlinkBattery(void);
|
void menuTelemetryMavlinkBattery(void);
|
||||||
|
void menuTelemetryMavlinkNavigation(void);
|
||||||
void menuTelemetryMavlinkGPS(void);
|
void menuTelemetryMavlinkGPS(void);
|
||||||
#ifdef DUMP_RX_TX
|
#ifdef DUMP_RX_TX
|
||||||
void lcd_outhex2(uint8_t x, uint8_t y, uint8_t val);
|
void lcd_outhex2(uint8_t x, uint8_t y, uint8_t val);
|
||||||
@@ -70,6 +71,7 @@ enum mavlink_menu_ {
|
|||||||
MENU_INFO = 0, //
|
MENU_INFO = 0, //
|
||||||
MENU_MODE,
|
MENU_MODE,
|
||||||
MENU_BATT,
|
MENU_BATT,
|
||||||
|
MENU_NAV,
|
||||||
MENU_GPS, //
|
MENU_GPS, //
|
||||||
#ifdef DUMP_RX_TX
|
#ifdef DUMP_RX_TX
|
||||||
MENU_DUMP_RX, //
|
MENU_DUMP_RX, //
|
||||||
|
|||||||
@@ -192,6 +192,15 @@ static inline void REC_MAVLINK_MSG_ID_RADIO(const mavlink_message_t* msg) {
|
|||||||
// telemetry_data.pc_rssi = mavlink_msg_radio_get_rssi(msg);
|
// telemetry_data.pc_rssi = mavlink_msg_radio_get_rssi(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \brief Navigaion output message
|
||||||
|
static inline void REC_MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT(const mavlink_message_t* msg) {
|
||||||
|
telemetry_data.bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \brief Hud navigation message
|
||||||
|
static inline void REC_MAVLINK_MSG_ID_VFR_HUD(const mavlink_message_t* msg) {
|
||||||
|
telemetry_data.heading = mavlink_msg_vfr_hud_get_heading(msg);
|
||||||
|
}
|
||||||
|
|
||||||
/*! \brief Hardbeat message
|
/*! \brief Hardbeat message
|
||||||
*/
|
*/
|
||||||
@@ -389,6 +398,13 @@ static inline void handleMessage(mavlink_message_t* p_rxmsg) {
|
|||||||
break;
|
break;
|
||||||
case MAVLINK_MSG_ID_RADIO:
|
case MAVLINK_MSG_ID_RADIO:
|
||||||
REC_MAVLINK_MSG_ID_RADIO(p_rxmsg);
|
REC_MAVLINK_MSG_ID_RADIO(p_rxmsg);
|
||||||
|
break;
|
||||||
|
case MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT:
|
||||||
|
REC_MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT(p_rxmsg);
|
||||||
|
break;
|
||||||
|
case MAVLINK_MSG_ID_VFR_HUD:
|
||||||
|
REC_MAVLINK_MSG_ID_VFR_HUD(p_rxmsg);
|
||||||
|
break;
|
||||||
case MAVLINK_MSG_ID_HIL_CONTROLS:
|
case MAVLINK_MSG_ID_HIL_CONTROLS:
|
||||||
REC_MAVLINK_MSG_ID_HIL_CONTROLS(p_rxmsg);
|
REC_MAVLINK_MSG_ID_HIL_CONTROLS(p_rxmsg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -163,11 +163,11 @@ typedef struct Telemetry_Data_ {
|
|||||||
uint8_t satellites_visible; ///< Number of satellites visible
|
uint8_t satellites_visible; ///< Number of satellites visible
|
||||||
Location_t loc_current;
|
Location_t loc_current;
|
||||||
float eph;
|
float eph;
|
||||||
float course;
|
uint16_t course;
|
||||||
float v; // Ground speed
|
float v; // Ground speed
|
||||||
// Navigation
|
// Navigation
|
||||||
float heading;
|
uint16_t heading;
|
||||||
float bearing;
|
uint16_t bearing;
|
||||||
|
|
||||||
#ifdef MAVLINK_PARAMS
|
#ifdef MAVLINK_PARAMS
|
||||||
// Params
|
// Params
|
||||||
|
|||||||
Reference in New Issue
Block a user