mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 01:42:05 +08:00
ui.cc: fix driverview (#19723)
This commit is contained in:
+5
-2
@@ -72,8 +72,9 @@ void ui_init(UIState *s) {
|
||||
ui_nvg_init(s);
|
||||
|
||||
s->last_frame = nullptr;
|
||||
s->vipc_client = new VisionIpcClient("camerad", VISION_STREAM_RGB_BACK, true);
|
||||
|
||||
s->vipc_client_rear = new VisionIpcClient("camerad", VISION_STREAM_RGB_BACK, true);
|
||||
s->vipc_client_front = new VisionIpcClient("camerad", VISION_STREAM_RGB_FRONT, true);
|
||||
s->vipc_client = s->vipc_client_rear;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -236,6 +237,8 @@ static void ui_read_params(UIState *s) {
|
||||
|
||||
void ui_update_vision(UIState *s) {
|
||||
if (!s->vipc_client->connected && s->started) {
|
||||
s->vipc_client = s->scene.frontview ? s->vipc_client_front : s->vipc_client_rear;
|
||||
|
||||
if (s->vipc_client->connect(false)){
|
||||
ui_init_vision(s);
|
||||
}
|
||||
|
||||
@@ -138,6 +138,8 @@ typedef struct UIScene {
|
||||
|
||||
typedef struct UIState {
|
||||
VisionIpcClient * vipc_client;
|
||||
VisionIpcClient * vipc_client_front;
|
||||
VisionIpcClient * vipc_client_rear;
|
||||
VisionBuf * last_frame;
|
||||
|
||||
// framebuffer
|
||||
|
||||
Reference in New Issue
Block a user