Render map at 256x256 and don't crop (#28101)

old-commit-hash: 861e18a1a8
beeps
Mitchell Goff 2 years ago committed by GitHub
parent a6f06fc98c
commit 6a8ff997dc
  1. 10
      selfdrive/navd/map_renderer.cc
  2. 2
      selfdrive/navd/map_renderer.py

@ -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);

@ -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

Loading…
Cancel
Save