-
Notifications
You must be signed in to change notification settings - Fork 20
Added camera temperature widget #11
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
Open
MarioFPVdev
wants to merge
15
commits into
gehee:main
Choose a base branch
from
MarioFPVdev:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
81a7fca
Update osd.h
MarioFPVdev b516669
Update osd.c
MarioFPVdev 7964966
Update mavlink.c
MarioFPVdev c960598
Merge branch 'gehee:main' into main
MarioFPVdev 16b0e81
Update osd.c
MarioFPVdev 0b777c1
Update osd.c
MarioFPVdev d8b6821
Update osd.c
MarioFPVdev d2aa464
Update osd.c
MarioFPVdev be41df1
Update osd.c
MarioFPVdev 6c8b1fb
Update fpvue_config.h
MarioFPVdev ab9d8c4
Update main.cpp
MarioFPVdev c6836bc
Update osd.c
MarioFPVdev a5efc28
Update osd.c
MarioFPVdev 1d0d0cd
Update osd.c
MarioFPVdev d85e5ff
Update osd.c
MarioFPVdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| #define fpvue_VERSION_MAJOR 0 | ||
| #define fpvue_VERSION_MINOR 13 | ||
| #define fpvue_VERSION_MINOR 12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,8 +50,8 @@ void modeset_paint_buffer(struct modeset_buf *buf) { | |
| surface = cairo_image_surface_create_for_data(buf->map, CAIRO_FORMAT_ARGB32, buf->width, buf->height, buf->stride); | ||
| cr = cairo_create (surface); | ||
|
|
||
| cairo_select_font_face (cr, "Roboto", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); | ||
| cairo_set_font_size (cr, 20); | ||
| cairo_select_font_face (cr, "Roboto", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); | ||
| cairo_set_font_size (cr, 22); | ||
|
|
||
| if (osd_vars.enable_video || osd_vars.enable_wfbng ) { | ||
| // stats height | ||
|
|
@@ -108,9 +108,9 @@ void modeset_paint_buffer(struct modeset_buf *buf) { | |
| } | ||
| avg_bw = avg_bw / avg_cnt; | ||
| if (avg_bw < 1000) { | ||
| sprintf(msg, "%.2f Kbps", avg_bw / 125 ); | ||
| sprintf(msg, "%.2f Kbps", avg_bw / 85 ); | ||
| } else { | ||
| sprintf(msg, "%.2f Mbps", avg_bw / 125000 ); | ||
| sprintf(msg, "%.2f Mbps", avg_bw / 85000 ); | ||
| } | ||
| row_count++; | ||
| cairo_set_source_surface (cr, net_icon, osd_x+22, stats_top_margin+row_count*stats_row_height-19); | ||
|
|
@@ -141,58 +141,19 @@ void modeset_paint_buffer(struct modeset_buf *buf) { | |
| return; | ||
| } | ||
|
|
||
| cairo_set_source_rgba (cr, 255.0, 255.0, 255.0, 1); | ||
| cairo_set_source_rgba (cr, 0.0, 255.0, 255.0, 1); | ||
| // Mavlink elements | ||
| uint32_t x_center = buf->width / 2; | ||
| if (osd_vars.telemetry_level > 1){ | ||
| // TODO(geehe) How to draw lines with cairo? | ||
| // // Artificial Horizon | ||
| // int32_t offset_pitch = osd_vars.telemetry_pitch * 4; | ||
| // int32_t offset_roll = osd_vars.telemetry_roll * 4; | ||
| // int32_t y_pos_left = ((int32_t)buf->height / 2 - 2 + offset_pitch + offset_roll); | ||
| // int32_t y_pos_right = ((int32_t)buf->height / 2 - 2 + offset_pitch - offset_roll); | ||
|
|
||
| // for (int i = 0; i < 4; i++) { | ||
| // if (y_pos_left > 0 && y_pos_left < buf->height && | ||
| // y_pos_right > 0 && y_pos_right < buf->height) { | ||
| // //fbg_line(cr, x_center - 180, y_pos_left + i, x_center + 180, y_pos_right + i, 255, 255, 255); | ||
| // } | ||
| // } | ||
|
|
||
| // // Vertical Speedometer | ||
| // int32_t offset_vspeed = osd_vars.telemetry_vspeed * 5; | ||
| // int32_t y_pos_vspeed = ((int32_t)buf->height / 2 - offset_vspeed); | ||
| // for (int i = 0; i < 8; i++) { | ||
| // if (y_pos_vspeed > 0 && y_pos_vspeed < buf->height) { | ||
| // //fbg_line(cr, x_center + 242 + i, buf->height / 2, x_center + 242 + i, y_pos_vspeed, 255, 255, 255); | ||
| // } | ||
| // } | ||
|
|
||
| // for (int i = 0; i < 25; i++) { | ||
| // uint32_t width = (i == 12) ? 10 : 0; | ||
|
|
||
| // // fbg_line(cr, x_center - 240 - width, | ||
| // // buf->height / 2 - 120 + i * 10, x_center - 220, | ||
| // // buf->height / 2 - 120 + i * 10, 255, 255, 255); | ||
| // // fbg_line(cr, x_center - 240 - width, | ||
| // // buf->height / 2 - 120 + i * 10 + 1, x_center - 220, | ||
| // // buf->height / 2 - 120 + i * 10 + 1, 255, 255, 255); | ||
|
|
||
| // // fbg_line(cr, x_center + 220, buf->height / 2 - 120 + i * 10, | ||
| // // x_center + 240 + width, buf->height / 2 - 120 + i * 10, 255, 255, 255); | ||
| // // fbg_line(cr, x_center + 220, buf->height / 2 - 120 + i * 10 + 1, | ||
| // // x_center + 240 + width, buf->height / 2 - 120 + i * 10 + 1, 255, 255, 255); | ||
| // } | ||
|
|
||
| // OSD telemetry | ||
| sprintf(msg, "ALT:%.00fM", osd_vars.telemetry_altitude); | ||
| cairo_move_to(cr, x_center + (20) + 260, buf->height / 2 - 8); | ||
| cairo_move_to(cr, x_center + (20) + 260, buf->height - 60); | ||
| cairo_show_text(cr, msg); | ||
| sprintf(msg, "SPD:%.00fKM/H", osd_vars.telemetry_gspeed); | ||
| cairo_move_to(cr, x_center - (16 * 3) - 360, buf->height / 2 - 8); | ||
| cairo_move_to(cr, x_center - 350, buf->height - 60); | ||
| cairo_show_text(cr, msg); | ||
| sprintf(msg, "VSPD:%.00fM/S", osd_vars.telemetry_vspeed); | ||
| cairo_move_to(cr, x_center + (20) + 260, buf->height / 2 + 22); | ||
| cairo_move_to(cr, x_center + (20) + 260, buf->height - 30); | ||
| cairo_show_text(cr, msg); | ||
| } | ||
|
|
||
|
|
@@ -208,7 +169,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); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
|
@@ -255,58 +219,14 @@ void modeset_paint_buffer(struct modeset_buf *buf) { | |
| cairo_move_to(cr, x_center - 350, buf->height - 30); | ||
| cairo_show_text(cr, msg); | ||
| } | ||
|
|
||
| sprintf(msg, "RSSI:%.00f", osd_vars.telemetry_rssi); | ||
| cairo_move_to(cr, x_center - 50, buf->height - 30); | ||
| cairo_show_text(cr, msg); | ||
|
|
||
| // Print rate stats | ||
| struct timespec current_timestamp; | ||
| if (!clock_gettime(CLOCK_MONOTONIC_COARSE, ¤t_timestamp)) { | ||
| double interval = getTimeInterval(¤t_timestamp, &last_timestamp); | ||
| if (osd_vars.telemetry_arm > 1700){ | ||
| seconds = seconds + interval; | ||
| } | ||
| if (interval > 1) { | ||
| last_timestamp = current_timestamp; | ||
| rx_rate = ((float)stats_rx_bytes+(((float)stats_rx_bytes*25)/100)) / 1024.0f * 8; | ||
| stats_rx_bytes = 0; | ||
| } | ||
| } | ||
|
|
||
| char hud_frames_rx[32]; | ||
| if (osd_vars.telemetry_level > 1){ | ||
| cairo_move_to(cr, x_center - strlen(hud_frames_rx) / 2 * 16, 40); | ||
| cairo_show_text(cr, hud_frames_rx); | ||
| } else { | ||
| cairo_move_to(cr, buf->width - 300, buf->height - 60); | ||
| cairo_show_text(cr, hud_frames_rx); | ||
| sprintf(msg, "TIME:%.2d:%.2d", minutes,seconds); | ||
| cairo_move_to(cr, buf->width - 300, buf->height - 90); | ||
| cairo_show_text(cr, msg); | ||
| if(seconds > 59){ | ||
| seconds = 0; | ||
| ++minutes; | ||
| } | ||
| if(minutes > 59){ | ||
| seconds = 0; | ||
| minutes = 0; | ||
| } | ||
| } | ||
| float percent = rx_rate / (1024 * 10); | ||
| if (percent > 1) { | ||
| percent = 1; | ||
| } | ||
|
|
||
| uint32_t width = (strlen(hud_frames_rx) * 16) * percent; | ||
| if (osd_vars.telemetry_level > 1){ | ||
| cairo_set_source_rgba(cr, 255, 255, 255, 0.8); // R, G, B, A | ||
| cairo_rectangle(cr, x_center - strlen(hud_frames_rx) / 2 * 16, 64, width, 8); | ||
| } else { | ||
| cairo_set_source_rgba(cr, 255, 255, 255, 0.8); // R, G, B, A | ||
| cairo_rectangle(cr, buf->width - 300, buf->height - 36, width, 8); | ||
| } | ||
| cairo_fill(cr); | ||
| cairo_fill(cr); | ||
| } | ||
|
|
||
| int osd_thread_signal; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 ?