90 DEBUG_PRINT(
"Entering EMERGENCY state from DRIVING");
99 DEBUG_PRINT(
"Entering FINISHED state from DRIVING");
105 DEBUG_PRINT(
"Entering EMERGENCY state from FINISHED");
The ASState class manages and transitions between different states of the vehicle system.
void calculateState()
Calculates the state of the vehicle.
CheckupManager _checkupManager
CheckupManager object for handling various checkup operations.
ASState(SystemData *system_data, Communicator *communicator, DigitalSender *digital_sender)
Constructor for the ASState class.
State state
Current state of the vehicle system, initialized to OFF.
The CheckupManager class handles various checkup operations.
bool shouldEnterEmergency(State current_state) const
Performs an emergency checkup.
Metro _ebsSoundTimestamp
Timer for the EBS buzzer sound check.
bool emergencySequenceComplete() const
Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.
bool shouldStayManualDriving() const
Performs a manual driving checkup.
void resetCheckupState()
Resets the checkup state to the initial state.
bool shouldStayOff(DigitalSender *digitalSender)
Performs an off checkup.
bool resTriggered() const
Checks if the RES has been triggered.
bool shouldStayReady() const
Performs a ready to drive checkup.
bool shouldGoReadyFromOff() const
Performs a last re-check for off to ready transition.
bool shouldStayDriving() const
bool shouldStayMissionFinished() const
Performs a mission finished checkup.
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.
static void enterReadyState()
ASSI yellow LED on, ebs valves activated, sdc closed.
static void enterFinishState()
ASSI blue LED on, ebs valves activated, sdc open.
static void enterOffState()
Everything off, sdc open.
void enterDrivingState()
ASSI LEDs yellow flashing, ebs valves deactivated, sdc closed.
void enterEmergencyState()
ASSI LEDs blue flashing, sdc open and buzzer ringing.
static void enterManualState()
Everything off, sdc closed.
void blinkLED(int pin)
Blinks the LED at the given pin.
void reset()
Resets the timer to the current time.
Communicator communicator
The whole model of the system: holds all the data necessary.