Skip to content
10 changes: 9 additions & 1 deletion mavlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ void* __MAVLINK_THREAD__(void* arg) {
case MAVLINK_MSG_ID_HEARTBEAT:
// handle_heartbeat(&message);
break;

case MAVLINK_MSG_ID_RAW_IMU:
Copy link
Owner

Choose a reason for hiding this comment

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

MAVLINK_MSG_ID_RAW_IMU seems to be for IMU data:
https://docs.ros.org/en/melodic/api/rosflight/html/mavlink__msg__raw__imu_8h.html#a597d5ddd09d163766bb8afe327d12085
isn't there a message for temperature in mavlink ?

{
mavlink_raw_imu_t imu;
mavlink_msg_raw_imu_decode(&message, &imu);
osd_vars.telemetry_raw_imu = imu.temperature;
}
break;

case MAVLINK_MSG_ID_SYS_STATUS:
{
Expand Down Expand Up @@ -291,4 +299,4 @@ void* __MAVLINK_THREAD__(void* arg) {

printf("Mavlink thread done.\n");
return 0;
}
}
5 changes: 4 additions & 1 deletion osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ void modeset_paint_buffer(struct modeset_buf *buf) {
sprintf(msg, "THR:%.00f%%", osd_vars.telemetry_throttle);
cairo_move_to(cr, 40, buf->height - 120);
cairo_show_text(cr, msg);

sprintf(msg, "TEMP:%.00fC", osd_vars.telemetry_raw_imu/100);
Copy link
Owner

Choose a reason for hiding this comment

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

Can you indicate that this is the AIR Temp ?

cairo_move_to(cr, 40, buf->height - 150);
cairo_show_text(cr, msg);

if (osd_vars.telemetry_level > 1){
sprintf(msg, "SATS:%.00f", osd_vars.telemetry_sats);
cairo_move_to(cr,buf->width - 140, buf->height - 30);
Expand Down
1 change: 1 addition & 0 deletions osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct osd_vars {
float telemetry_vspeed;
float telemetry_rssi;
float telemetry_throttle;
float telemetry_raw_imu;
float telemetry_resolution;
float telemetry_arm;
float armed;
Expand Down