mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-23 10:13:53 +08:00
* navd: render simple map * render route * offscreen rendering * cleanup * more cleanup * render into visionIPC * rename class * split position update from route update * stop broadcast if not active * gate vipc server behind flag * add python library * faster * no vipc from python * put behind extras * only send when loaded * add glFlush just to be sure * cleanup settings into helper function * function ordering * broadcast thumbnails * put behind param * adjust zoom level * add route to python bindings * revert that freq change * add logging if map rendering is enabled * use rlogs if available * bump cereal
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include <QApplication>
|
|
#include <QCommandLineParser>
|
|
#include <QDebug>
|
|
#include <QThread>
|
|
#include <csignal>
|
|
|
|
#include "selfdrive/ui/qt/util.h"
|
|
#include "selfdrive/ui/qt/maps/map_helpers.h"
|
|
#include "selfdrive/ui/navd/route_engine.h"
|
|
#include "selfdrive/ui/navd/map_renderer.h"
|
|
#include "selfdrive/hardware/hw.h"
|
|
#include "selfdrive/common/params.h"
|
|
|
|
void sigHandler(int s) {
|
|
qInfo() << "Shutting down";
|
|
std::signal(s, SIG_DFL);
|
|
|
|
qApp->quit();
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
qInstallMessageHandler(swagLogMessageHandler);
|
|
|
|
QApplication app(argc, argv);
|
|
std::signal(SIGINT, sigHandler);
|
|
std::signal(SIGTERM, sigHandler);
|
|
|
|
QCommandLineParser parser;
|
|
parser.setApplicationDescription("Navigation server. Runs stand-alone, or using pre-computer route");
|
|
parser.addHelpOption();
|
|
parser.process(app);
|
|
const QStringList args = parser.positionalArguments();
|
|
|
|
|
|
RouteEngine* route_engine = new RouteEngine();
|
|
|
|
if (Params().getBool("NavdRender")) {
|
|
MapRenderer * m = new MapRenderer(get_mapbox_settings());
|
|
QObject::connect(route_engine, &RouteEngine::positionUpdated, m, &MapRenderer::updatePosition);
|
|
QObject::connect(route_engine, &RouteEngine::routeUpdated, m, &MapRenderer::updateRoute);
|
|
}
|
|
|
|
return app.exec();
|
|
}
|