#
# See component_params.pbtxt for message topics with settings in
# message_queue{} which raise faults if topics aren't showing messages
# from other components:
# /driving/vehicle/common/zci#message-queue
#
# 100 - RSM
# 200 - Body/EMU related
# 300 - Planner
# 400 - Dispatch
# 500 - BOX
# 600 - TUX
#
component: RideState
owner: cmadere@zoox.com
proto_imports:
  - "vehicle/ride_state_machine/diagnostics/rsm_diagnostic_ff.proto"
namespace: zoox::ride_state_machine::diagnostics
faults:
  - id: 100
    name: UnexpectedDoorState
    severity: WARNING
    description: Doors are in an unexpected state based on RSM's current state.
  - id: 101
    name: UnexpectedPlannerState
    severity: WARNING
    triggers_nogo: false
    set_condition: When Planner reports kStandby while RSM is in Driving states.
    clear_condition: When Planner reports anything other than kStandby while RSM is in Driving states.
    troubleshooting_steps: If you expect to be on a mission, particularly Rider a mission, and Planner has faulted, getting Planner back to running should correct this. If you are resetting a mission and Planner has been cleared NOT through RSM, then you may need to ForceReset RSM to clear it's mission state.
    description: Planner is in an unexpected state based on RSM's current state. This tyipcally means RSM expects Planner to be kDrivingToDest but it is not.
  - id: 102
    name: HighLevelStatus
    severity: INFO
    description: A very high level status of what state RSM is currently in.
    freeze_frame: proto.RideStateFreezeFrame
  - id: 103
    name: WaitingForDoorOperationReady
    severity: WARNING
    description: Door operation safety signal is taking a long time, RSM will not allow BOX/DIM door control.
  - id: 200
    name: L3DoorStatusInvalid
    severity: INFO
    description: L3 platform measurements message is missing door status.
  - id: 201
    name: MissingBodyFeedback
    severity: WARNING
    triggers_nogo: false
    set_condition: When RSM has never received BodyFeedback messages on EMU BodyFeedback topic.
    clear_condition: When RSM receives BodyFeedback message on EMU BodyFeedback topic.
    troubleshooting_steps: Verify EMU (EMU-North) is operational and BodyFeedback topic is being replayed on PCU from EMU.
    description: RideStateMachine requires EMU BodyFeedback for various functions and cannot process rider input/output without it. It is expected that EMU BodyFeedback is always available.
  - id: 202
    name: StaleBodyFeedback
    severity: WARNING
    triggers_nogo: false
    set_condition: When RSM did not receive BodyFeedback from EMU in the current tick.
    clear_condition: When RSM receives BodyFeedback message on EMU BodyFeedback topic.
    troubleshooting_steps: Verify EMU (EMU-North) is operational and BodyFeedback topic is being replayed on PCU from EMU at the configured rate.
    description: RideStateMachine received BodyFeedback, but not recently enough to be sure it's still accurate. BodyFeedback should arrive at least once per RSM tick.
  - id: 203
    name: MissingDriveFeedback
    severity: WARNING
    triggers_nogo: false
    set_condition: When RSM has never received DriveFeedback messages on EMU DriveFeedback topic.
    clear_condition: When RSM receives DriveFeedback message on EMU DriveFeedback topic.
    troubleshooting_steps: Verify EMU (EMU-North) is operational and DriveFeedback topic is being replayed on PCU from EMU.
    description: RideStateMachine requires EMU DriveFeedback for various functions and cannot process rider input/output without it. It is expected that EMU DriveFeedback is always available.
  - id: 204
    name: StaleDriveFeedback
    severity: WARNING
    triggers_nogo: false
    set_condition: When RSM did not receive DriveFeedback from EMU in the current tick.
    clear_condition: When RSM receives DriveFeedback message on EMU DriveFeedback topic.
    troubleshooting_steps: Verify EMU (EMU-North) is operational and DriveFeedback topic is being replayed on PCU from EMU at the configured rate.
    description: RideStateMachine received DriveFeedback, but not recently enough to be sure it's still accurate. DriveFeedback should arrive at least once per RSM tick.
  - id: 300
    name: NoPlannerMission
    severity: INFO
    description: Planner has no mission.
  - id: 301
    name: NoPlannerMissionRoutePoints
    severity: INFO
    description: Mission route has no route points.
  - id: 500
    name: MissingBoxReport
    severity: WARNING
    description: One or more BOX units are not reporting status (NW/NE/SW/SE).
    freeze_frame: proto.MissingBoxFreezeFrame
