diff --git a/selfdrive/navd/map_renderer.cc b/selfdrive/navd/map_renderer.cc index 51676bb3a3..203470bb42 100644 --- a/selfdrive/navd/map_renderer.cc +++ b/selfdrive/navd/map_renderer.cc @@ -11,7 +11,7 @@ #include "selfdrive/ui/qt/maps/map_helpers.h" const float DEFAULT_ZOOM = 13.5; // Don't go below 13 or features will start to disappear -const int HEIGHT = 512, WIDTH = 512; +const int HEIGHT = 256, WIDTH = 256; const int NUM_VIPC_BUFFERS = 4; const int EARTH_CIRCUMFERENCE_METERS = 40075000; @@ -177,12 +177,10 @@ void MapRenderer::publish(const double render_time) { uint8_t* dst = (uint8_t*)buf->addr; uint8_t* src = cap.bits(); - // RGB to greyscale and crop + // RGB to greyscale memset(dst, 128, buf->len); - for (int r = 0; r < HEIGHT/2; r++) { - for (int c = 0; c < WIDTH/2; c++) { - dst[r*WIDTH/2 + c] = src[((HEIGHT/4 + r)*WIDTH + (c+WIDTH/4)) * 3]; - } + for (int i = 0; i < WIDTH * HEIGHT; i++) { + dst[i] = src[i * 3]; } vipc_server->send(buf, &extra); diff --git a/selfdrive/navd/map_renderer.py b/selfdrive/navd/map_renderer.py index ec0edea89c..aa5682169f 100755 --- a/selfdrive/navd/map_renderer.py +++ b/selfdrive/navd/map_renderer.py @@ -10,7 +10,7 @@ from cffi import FFI from common.ffi_wrapper import suffix from common.basedir import BASEDIR -HEIGHT = WIDTH = SIZE = 512 +HEIGHT = WIDTH = SIZE = 256 METERS_PER_PIXEL = 2