Repository navigation
feat(controller): stop the vehicle when the driving stack's heartbeat goes stale - #57
Conversation
|
Hi @youtalk, thanks for this stack. The stop profile and the rpmsg-si channel are what the demo needs. I'd like to fit them into #66 (green in CI) instead of running them beside it, so the SI has one output. The problem. #66 makes the SI publish one supervised output, Proposal: the heartbeat and the fault flag become two more inputs to the #66 supervisor.
For the D5/D6 bench session
Not covered. A stop path that still works when the follower hangs (#64). Neither #57 nor #66 has it: both run in the MPC's timer. Logistics. The stack sits on I can draft the rework on top of #66 if that is easier for you. |
|
Follow-up on #66 and the demo. #66 passes CI and the CARLA rig, but I have not run it with the demo topology. Four things the #57 rework needs:
I read |
1918ae9 to
ae0ccfc
Compare
ae0ccfc to
710d7ae
Compare
|
I reworked the stack as you proposed and rebased it onto Proposal
Follow-up
Bench notes
Logistics#47 merged into |
…s stale The supervisor from #66 now watches /safety_island/vp_heartbeat as one more source. VisionPilot's heartbeat bridge publishes one sample per driving command. A gap over source_timeout_heartbeat_s (0.5 s) latches SI_STOP through the same path as every other source. Like every SourceWatch, the heartbeat is not stale before its first sample. A board that boots without VisionPilot therefore never stops a car that nobody drives. If a heartbeat was seen, re-enable requires it to be fresh. The SI_STOP payload now ramps the speed target, v0 - decel * t, from the ego speed at the latch, floored at 0. The speed target and the acceleration demand then describe the same stop. A speed-tracking actuator such as CARLA's Ackermann controller follows the speed target and uses the acceleration only as a limit. The acceleration demand stays -decel for the whole stop, so the ramp reaching 0 is not a brake release. The ramp reads the odometry only after its first sample. HOLD keeps the plain standstill payload. The X5H build compiles in two defaults, because the board has no environment and loads no node parameters: - SI_DEFAULT_LEGACY_CONTROL_CMD="stop_only". The demo's command arbiter prefers any fresh CR52 command, so the SI must stay silent on control_cmd until it stops the car. - SI_DEFAULT_STOP_DECEL_MPS2=3.0f. The demo's stop gate (D6) was validated at 3.0 m/s^2. Every other target keeps 1.5. The startup line now also prints the stop deceleration. This replaces the standalone StopProfile override of the earlier revision, which wrote its own command to control_cmd and CAN beside ApprovedRequest. Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
710d7ae to
4b4b188
Compare
…valid The SI_STOP speed ramp starts from the odometry speed at the latch. An infinite speed gave an infinite target that never decayed, and the CAN encoder rejected every stop command with "invalid velocity". A speed above max_abs_velocity_mps, the bound the envelope already applies to commanded speed, gave a target no vehicle can follow. stopRampVelocity() now takes that bound. An ego speed that is not within it (NaN, infinite, or too high) starts the stop from 0. Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
What this does
This makes the VisionPilot heartbeat one more source of the SI supervisor from #66. The supervisor watches
/safety_island/vp_heartbeatwith aSourceWatch. A gap longer thansource_timeout_heartbeat_s(0.5 s) latchesSI_STOPinsupervisorStaleReason(), the same path as every other source. The stop goes out throughpublishSiStop(), so it is anApprovedRequestwith afault_id. Only the operator re-enable clears it.The
SI_STOPpayload now ramps the speed target from the ego speed at the latch:v = max(0, v0 - decel * t). The acceleration demand stays-decelfor the whole stop, so the ramp reaching 0 is never a brake release.HOLDkeeps the plain standstill payload.The X5H build compiles in two defaults:
SI_DEFAULT_LEGACY_CONTROL_CMD="stop_only"andSI_DEFAULT_STOP_DECEL_MPS2=3.0f. The SI then stays silent oncontrol_cmduntil it stops the car, and it stops at 3.0 m/s².Why
If VisionPilot stops talking to the safety island, the safety island must stop the vehicle. In the demo no trajectory arrives, so the heartbeat is the only sign that the driving stack is alive. The first revision of this pull request wrote its own stop command beside
ApprovedRequest. That made two writers, andApprovedRequestdid not show the stop. This revision has one writer.With the ramp, the speed target and the acceleration demand describe the same stop. A speed-tracking actuator, such as CARLA's Ackermann controller, follows the speed target and uses the acceleration only as a limit.
The X5H has no environment and loads no node parameters, so its two defaults are compiled in. The demo's command arbiter prefers any fresh CR52 command, so the SI must stay silent until it stops the car. The demo's stop gate (D6) was validated at 3.0 m/s², with a stop distance limit derived from that value. The shared default of 1.5 m/s² matches Autoware's
moderate_stop_service_acceleration. Autoware's emergency values are 2.4 (vehicle_cmd_gate) and 2.5 (mrm_emergency_stop_operator).Behaviour details
stop_onlyand 3.0 m/s² are set only onactuation_x5h. Every other target keepsalwaysand 1.5 m/s². The startup line prints the stop deceleration, so the console shows which value a firmware image carries.How this was verified
./build.sh --platform freertos-posixsucceeds. The controller smoke reachesActuation Safety Island is Live, and the startup line readsheartbeat 0.50s; stop 1.50 m/s^2../build.sh --platform freertos-posix --unit-testsucceeds, and all six host test binaries exit 0.supervision_latch_testnow covers the ramp: the floor at 0, and a negative or NaN ego speed../build.sh --platform freertos-x5hsucceeds at the top of this stack.SI_DEFAULT_LEGACY_CONTROL_CMD="stop_only"andSI_DEFAULT_STOP_DECEL_MPS2=3.0fare in theactuation_x5hcompile flags only.No hardware was used for this pull request.
What this depends on
This is based on #71, which re-lands #47. #47 merged into
feat/freertos-x5h-netifafter #45 had already squash-merged that branch intomain, so its content never reachedmain.Refs: autowarefoundation/openadkit#147