Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cea422b075 | |||
| dc7e0a2db7 | |||
| f896dfe25a | |||
| 2ce6e8fe0c | |||
| 3bd0c942e8 | |||
| 12da9acfdd |
@@ -12,19 +12,19 @@
|
|||||||
* Trip lifecycle state machine:
|
* Trip lifecycle state machine:
|
||||||
*
|
*
|
||||||
* WAITING:
|
* WAITING:
|
||||||
* - Process starts in this state. Idle.
|
* - Process starts in this state
|
||||||
* - Waits for valid system time (year >= 2024) AND car in drive gear
|
* - Waits for valid system time (year >= 2024) AND car in drive gear
|
||||||
* - Transitions to RECORDING when both conditions met
|
* - Transitions to RECORDING when both conditions met
|
||||||
*
|
*
|
||||||
* RECORDING:
|
* RECORDING:
|
||||||
* - Actively encoding frames, car is in drive
|
* - Actively encoding frames, car is in drive
|
||||||
* - Gear shift into PARK → close trip immediately → WAITING (idle)
|
* - Car leaves drive → start 10-min idle timer → IDLE_TIMEOUT
|
||||||
* - Ignition off → close trip → WAITING
|
|
||||||
*
|
*
|
||||||
* IDLE_TIMEOUT (deprecated, retained for safety):
|
* IDLE_TIMEOUT:
|
||||||
* - Was used to keep recording across brief drive-thru / fuel stops.
|
* - Car left drive, still recording with timer running
|
||||||
* - Now unreachable: drive→park transitions close the trip immediately
|
* - Car re-enters drive → cancel timer → RECORDING
|
||||||
* and a fresh trip starts on the next drive engagement.
|
* - Timer expires → close trip → WAITING
|
||||||
|
* - Ignition off → close trip → WAITING
|
||||||
*
|
*
|
||||||
* Graceful shutdown (DashcamShutdown param):
|
* Graceful shutdown (DashcamShutdown param):
|
||||||
* - thermald sets DashcamShutdown="1" before device power-off
|
* - thermald sets DashcamShutdown="1" before device power-off
|
||||||
@@ -301,11 +301,10 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case RECORDING:
|
case RECORDING:
|
||||||
// CLEARPILOT: close trip immediately on park (no idle timer). User wants
|
if (!in_drive) {
|
||||||
// dashcam idle in park, fresh trip on each drive engagement.
|
idle_timer_start = now;
|
||||||
if (gear == cereal::CarState::GearShifter::PARK) {
|
state = IDLE_TIMEOUT;
|
||||||
LOGW("dashcamd: gear in park, closing trip");
|
LOGW("dashcamd: car left drive, starting 10-min idle timer");
|
||||||
close_trip();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -681,12 +681,7 @@ class Controls:
|
|||||||
self.LoC.reset(v_pid=CS.vEgo)
|
self.LoC.reset(v_pid=CS.vEgo)
|
||||||
self.frogpilot_variables.no_lat_lane_change = False
|
self.frogpilot_variables.no_lat_lane_change = False
|
||||||
self.FPCC.noLatLaneChange = False
|
self.FPCC.noLatLaneChange = False
|
||||||
# Call LaC.update with active=False so we get the right lac_log subtype
|
lac_log = log.ControlsState.LateralDebugState.new_message()
|
||||||
# for this car's lateralTuning (torque vs pid vs angle). Internally it
|
|
||||||
# early-returns when active is False — cheap.
|
|
||||||
lp = self.sm['liveParameters']
|
|
||||||
_, _, lac_log = self.LaC.update(False, CS, self.VM, lp, self.steer_limited, 0.0,
|
|
||||||
self.sm['liveLocationKalman'], model_data=self.sm['modelV2'])
|
|
||||||
return CC, lac_log
|
return CC, lac_log
|
||||||
|
|
||||||
# Update VehicleModel
|
# Update VehicleModel
|
||||||
|
|||||||
@@ -34,21 +34,13 @@ def plannerd_thread():
|
|||||||
while True:
|
while True:
|
||||||
sm.update()
|
sm.update()
|
||||||
if sm.updated['modelV2']:
|
if sm.updated['modelV2']:
|
||||||
# CLEARPILOT: skip the planning compute while parked, but KEEP publishing
|
# CLEARPILOT: skip planning while parked. The downstream consumer (controlsd)
|
||||||
# at the normal cadence so consumers' alive flags stay healthy. Skipping
|
# already short-circuits in park, so longitudinalPlan/uiPlan staleness is fine.
|
||||||
# publishes entirely caused longitudinalPlan to go alive=False at
|
if sm['carState'].gearShifter == car.CarState.GearShifter.park:
|
||||||
# controlsd, which fires a real commIssue the moment we shift out of park.
|
continue
|
||||||
# Stale published values are fine — controlsd's own park short-circuit
|
longitudinal_planner.update(sm)
|
||||||
# ignores the longitudinalPlan content while parked anyway.
|
|
||||||
parked = sm['carState'].gearShifter == car.CarState.GearShifter.park
|
|
||||||
if not parked:
|
|
||||||
longitudinal_planner.update(sm)
|
|
||||||
longitudinal_planner.publish(sm, pm)
|
longitudinal_planner.publish(sm, pm)
|
||||||
# publish_ui_plan reads longitudinal_planner.a_desired_trajectory_full
|
publish_ui_plan(sm, pm, longitudinal_planner)
|
||||||
# which is only set inside update(). Skip it while parked — uiPlan is
|
|
||||||
# UI-only, not on controlsd's commIssue check list, so going silent is fine.
|
|
||||||
if not parked:
|
|
||||||
publish_ui_plan(sm, pm, longitudinal_planner)
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
plannerd_thread()
|
plannerd_thread()
|
||||||
|
|||||||
@@ -85,15 +85,11 @@ def frogpilot_thread():
|
|||||||
frogpilot_planner = FrogPilotPlanner(CP)
|
frogpilot_planner = FrogPilotPlanner(CP)
|
||||||
frogpilot_planner.update_frogpilot_params()
|
frogpilot_planner.update_frogpilot_params()
|
||||||
|
|
||||||
# CLEARPILOT: skip planner compute while parked, but KEEP publishing at
|
# CLEARPILOT: skip planner work while parked.
|
||||||
# the normal cadence so frogpilotPlan stays alive at consumers. Skipping
|
|
||||||
# publishes entirely caused commIssue ("not_alive: frogpilotPlan") at
|
|
||||||
# controlsd the moment we shifted out of park.
|
|
||||||
parked = sm['carState'].gearShifter == car.CarState.GearShifter.park
|
parked = sm['carState'].gearShifter == car.CarState.GearShifter.park
|
||||||
if sm.updated['modelV2']:
|
if sm.updated['modelV2'] and not parked:
|
||||||
if not parked:
|
frogpilot_planner.update(sm['carState'], sm['controlsState'], sm['frogpilotCarControl'], sm['frogpilotNavigation'],
|
||||||
frogpilot_planner.update(sm['carState'], sm['controlsState'], sm['frogpilotCarControl'], sm['frogpilotNavigation'],
|
sm['liveLocationKalman'], sm['modelV2'], sm['radarState'])
|
||||||
sm['liveLocationKalman'], sm['modelV2'], sm['radarState'])
|
|
||||||
frogpilot_planner.publish(sm, pm)
|
frogpilot_planner.publish(sm, pm)
|
||||||
|
|
||||||
if not time_validated:
|
if not time_validated:
|
||||||
|
|||||||
Reference in New Issue
Block a user