mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-24 04:23:47 +08:00
VisualRadarTracks toggle
This commit is contained in:
@@ -165,6 +165,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
|||||||
{"VisualStyle", {PERSISTENT | BACKUP, INT, "0"}},
|
{"VisualStyle", {PERSISTENT | BACKUP, INT, "0"}},
|
||||||
{"VisualStyleBlend", {PERSISTENT | BACKUP, BOOL, "0"}},
|
{"VisualStyleBlend", {PERSISTENT | BACKUP, BOOL, "0"}},
|
||||||
{"VisualStyleBlendThreshold", {PERSISTENT | BACKUP, INT, "20"}},
|
{"VisualStyleBlendThreshold", {PERSISTENT | BACKUP, INT, "20"}},
|
||||||
|
{"VisualRadarTracks", {PERSISTENT | BACKUP, BOOL, "0"}},
|
||||||
|
|
||||||
// MADS params
|
// MADS params
|
||||||
{"Mads", {PERSISTENT | BACKUP, BOOL, "1"}},
|
{"Mads", {PERSISTENT | BACKUP, BOOL, "1"}},
|
||||||
|
|||||||
@@ -43,14 +43,16 @@ void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sm.alive("liveTracks") && sm.rcv_frame("liveTracks") >= s->scene.started_frame) {
|
if (QString::fromStdString(Params().get("VisualRadarTracks")).toInt()) {
|
||||||
const auto &tracks = sm["liveTracks"].getLiveTracks().getPoints();
|
if (sm.alive("liveTracks") && sm.rcv_frame("liveTracks") >= s->scene.started_frame) {
|
||||||
for (const auto &track : tracks) {
|
const auto &tracks = sm["liveTracks"].getLiveTracks().getPoints();
|
||||||
if (!std::isfinite(track.getDRel()) || !std::isfinite(track.getYRel())) continue;
|
for (const auto &track : tracks) {
|
||||||
QPointF screen_pt;
|
if (!std::isfinite(track.getDRel()) || !std::isfinite(track.getYRel())) continue;
|
||||||
if (mapToScreen(track.getDRel(), -track.getYRel(), path_offset_z, &screen_pt)) {
|
QPointF screen_pt;
|
||||||
float radius = std::clamp(15.0f / (1.0f + track.getDRel() * 0.1f), 3.0f, 8.0f);
|
if (mapToScreen(track.getDRel(), -track.getYRel(), path_offset_z, &screen_pt)) {
|
||||||
drawRadarPoint(painter, screen_pt, track.getVRel(), radius * 3);
|
float radius = std::clamp(15.0f / (1.0f + track.getDRel() * 0.1f), 3.0f, 8.0f);
|
||||||
|
drawRadarPoint(painter, screen_pt, track.getVRel(), radius * 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ VisualsPanel::VisualsPanel(QWidget *parent) : QWidget(parent) {
|
|||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"VisualRadarTracks",
|
||||||
|
tr("Show Radar Tracks"),
|
||||||
|
tr("Shows what the cars radar sees."),
|
||||||
|
"../assets/offroad/icon_monitoring.png",
|
||||||
|
false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"VisualStyleBlend",
|
"VisualStyleBlend",
|
||||||
tr("Blend to Overhead Visual Style"),
|
tr("Blend to Overhead Visual Style"),
|
||||||
|
|||||||
Reference in New Issue
Block a user