fix lat lon

This commit is contained in:
ajouatom 2025-02-25 19:20:58 +09:00
parent 3687f7a012
commit a4520f75a3
3 changed files with 3 additions and 3 deletions

View File

@ -206,7 +206,7 @@ void MapRenderer::publish(const double render_time, const bool loaded) {
QImage cap = fbo->toImage().convertToFormat(QImage::Format_RGB888, Qt::AutoColor);
auto carrotMan = (*sm)["carrotMan"].getCarrotMan();
bool valid = loaded && (carrotMan.getXPosLat() > 0.0);
bool valid = loaded && (carrotMan.getXPosLat() != 0.0 && carrotMan.getXPosLon() != 0.0);
ever_loaded = ever_loaded || loaded;
uint64_t ts = nanos_since_boot();
VisionBuf* buf = vipc_server->get_buffer(VisionStreamType::VISION_STREAM_MAP);

View File

@ -96,7 +96,7 @@ class RouteEngine:
def update_location(self):
carrot_man = self.sm['carrotMan']
if carrot_man.xPosLat > 0.0:
if carrot_man.xPosLat != 0.0 and carrot_man.xPosLon != 0.0:
self.last_bearing = carrot_man.xPosAngle;
self.last_position = Coordinate(carrot_man.xPosLat, carrot_man.xPosLon)
self.localizer_valid = self.gps_ok = True

View File

@ -185,7 +185,7 @@ void MapWindow::updateState(const UIState &s) {
//bool active_carrot_man = carrotMan.getActiveCarrot() > 1;
//printf("CarrotMan: %f %f %f %f\n", carrotMan.getXPosLat(), carrotMan.getXPosLon(), carrotMan.getXPosAngle(), carrotMan.getXPosSpeed());
if (carrotMan.getXPosLat() > 0.0) {
if (carrotMan.getXPosLat() != 0.0 && carrotMan.getXPosLon() != 0.0) {
lat = carrotMan.getXPosLat();
lon = carrotMan.getXPosLon();
bearing = carrotMan.getXPosAngle();