Update annotated_camera.cc

This commit is contained in:
huifan 2024-11-16 10:37:36 +08:00
parent 7c672feb0b
commit 7fe8da1ab2
1 changed files with 9 additions and 8 deletions

View File

@ -911,29 +911,30 @@ void AnnotatedCameraWidget::drawLead(QPainter &painter, const cereal::ModelDataV
if (auto_speed_distance){
if (v_ego > 50) {
if (leadtimeGapScaledInt > 3000) {
paramsMemory.putInt("StoppingDistance", 5);
params.putInt("StoppingDistance", 5);
} else {
paramsMemory.putInt("StoppingDistance", 4);
params.putInt("StoppingDistance", 4);
}
} else if (v_ego >= 30) { // 表示 30 <= v_ego <= 50
if (leadtimeGapScaledInt > 2000) {
paramsMemory.putInt("StoppingDistance", 3);
params.putInt("StoppingDistance", 3);
} else {
paramsMemory.putInt("StoppingDistance", 2);
params.putInt("StoppingDistance", 2);
}
} else if (v_ego >= 10) { // 表示 10 <= v_ego < 30
if (leadtimeGapScaledInt > 2000) {
paramsMemory.putInt("StoppingDistance", 3);
params.putInt("StoppingDistance", 3);
} else {
paramsMemory.putInt("StoppingDistance", 2);
params.putInt("StoppingDistance", 2);
}
} else { // 表示 v_ego < 10
if (leadtimeGapScaledInt > 1000) {
paramsMemory.putInt("StoppingDistance", 1);
params.putInt("StoppingDistance", 1);
} else {
paramsMemory.putInt("StoppingDistance", 0);
params.putInt("StoppingDistance", 0);
}
}
updateFrogPilotToggles();
}