96 DEBUG_PRINT(
"Entering EMERGENCY state from DRIVING");
104 DEBUG_PRINT(
"Entering FINISHED state from DRIVING");
110 DEBUG_PRINT(
"Entering EMERGENCY state from FINISHED");
The ASState class manages and transitions between different states of the vehicle system.
ASState(SystemData *system_data, Communicator *communicator, DigitalSender *digital_sender)
Constructor for the ASState class.
void calculate_state()
Calculates the state of the vehicle.
CheckupManager _checkup_manager_
CheckupManager object for handling various checkup operations.
State state_
Current state of the vehicle system, initialized to OFF.
The CheckupManager class handles various checkup operations.
bool should_stay_manual_driving() const
Performs a manual driving checkup.
bool should_enter_emergency(State current_state) const
Performs an emergency checkup.
bool should_stay_off(DigitalSender *digital_sender)
Performs an off checkup.
Metro _ebs_sound_timestamp_
Timer for the EBS buzzer sound check.
bool emergency_sequence_complete() const
Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.
bool should_stay_ready() const
Performs a ready to drive checkup.
bool should_go_ready_from_off() const
Performs a last re-check for off to ready transition.
void reset_checkup_state()
Resets the checkup state to the initial state.
bool should_stay_mission_finished() const
Performs a mission finished checkup.
bool res_triggered() const
Checks if the RES has been triggered.
bool should_stay_driving() const
Class that contains definitions of typical messages to send via CAN It serves only as an example of t...
Class responsible for controlling digital outputs in the Master Teensy.
void enter_emergency_state()
ASSI LEDs blue flashing, sdc open and buzzer ringing.
void blink_led(int pin)
Blinks the LED at the given pin.
static void enter_finish_state()
ASSI blue LED on, ebs valves activated, sdc open.
static void enter_manual_state()
Everything off, sdc closed.
void enter_driving_state()
ASSI LEDs yellow flashing, ebs valves deactivated, sdc closed.
static void enter_ready_state()
ASSI yellow LED on, ebs valves activated, sdc closed.
static void enter_off_state()
Everything off, sdc open.
void reset()
Resets the timer to the current time.
constexpr int ASSI_BLUE_PIN
constexpr int ASSI_YELLOW_PIN
Communicator communicator
DigitalSender digital_sender
The whole model of the system: holds all the data necessary.