Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
CheckupManager Class Reference

The CheckupManager class handles various checkup operations. More...

#include <checkupManager.hpp>

Collaboration diagram for CheckupManager:
Collaboration graph

Public Types

enum class  CheckupState {
  WAIT_FOR_ASMS , START_TOGGLING_WATCHDOG , TOGGLING_WATCHDOG , STOP_TOGGLING_WATCHDOG ,
  CHECK_WATCHDOG , START_TOGGLING_WATCHDOG_AGAIN , CHECK_EBS_STORAGE , CHECK_BRAKE_PRESSURE ,
  CLOSE_SDC , WAIT_FOR_ASATS , WAIT_FOR_TS , EBS_CHECKS ,
  CHECK_TIMESTAMPS , CHECKUP_COMPLETE
}
 The CheckupState enum represents the different states of the initial checkup process. The checkup process is a sequence of checks that the vehicle must pass before it can transition to ready state. More...
 
enum class  EbsPressureTestPhase {
  DISABLE_ACTUATOR_1 , CHECK_ACTUATOR_2 , ENABLE_ACTUATOR_1 , DISABLE_ACTUATOR_2 ,
  CHECK_ACTUATOR_1 , ENABLE_ACTUATOR_2 , COMPLETE
}
 
enum class  CheckupError {
  WAITING_FOR_RESPONSE , ERROR_WD_STAYED_READY , ERROR_WD_TOGGLE , ERROR_TIMESTAMPS_EMERGENCY ,
  ERROR , SUCCESS
}
 

Public Member Functions

 CheckupManager (SystemData *system_data)
 Constructor for the CheckupManager class.
 
void reset_checkup_state ()
 Resets the checkup state to the initial state.
 
bool should_stay_manual_driving () const
 Performs a manual driving checkup.
 
bool should_stay_off ()
 Performs an off checkup.
 
CheckupError initial_checkup_sequence ()
 Performs an initial checkup.
 
bool should_go_ready_from_off () const
 Performs a last re-check for off to ready transition.
 
bool should_stay_ready () const
 Performs a ready to drive checkup.
 
bool should_enter_emergency (State current_state) const
 Performs an emergency checkup.
 
bool should_enter_emergency_in_ready_state () const
 
bool should_enter_emergency_in_driving_state () const
 
bool should_stay_driving () const
 
bool should_stay_mission_finished () const
 Performs a mission finished checkup.
 
bool emergency_sequence_complete () const
 Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.
 
bool res_triggered () const
 Checks if the RES has been triggered.
 

Public Attributes

Metro _ebs_sound_timestamp_ {EBS_BUZZER_TIMEOUT}
 Timer for the EBS buzzer sound check.
 
CheckupState checkup_state_
 Current state of the checkup process.
 
EbsPressureTestPhase pressure_test_phase_ {EbsPressureTestPhase::DISABLE_ACTUATOR_1}
 

Detailed Description

The CheckupManager class handles various checkup operations.

Definition at line 14 of file checkupManager.hpp.

Member Enumeration Documentation

◆ CheckupError

enum class CheckupManager::CheckupError
strong

This is for easier debugging in case initial checkup fails

Enumerator
WAITING_FOR_RESPONSE 
ERROR_WD_STAYED_READY 
ERROR_WD_TOGGLE 
ERROR_TIMESTAMPS_EMERGENCY 
ERROR 
SUCCESS 

Definition at line 100 of file checkupManager.hpp.

◆ CheckupState

enum class CheckupManager::CheckupState
strong

The CheckupState enum represents the different states of the initial checkup process. The checkup process is a sequence of checks that the vehicle must pass before it can transition to ready state.

Enumerator
WAIT_FOR_ASMS 
START_TOGGLING_WATCHDOG 
TOGGLING_WATCHDOG 
STOP_TOGGLING_WATCHDOG 
CHECK_WATCHDOG 
START_TOGGLING_WATCHDOG_AGAIN 
CHECK_EBS_STORAGE 
CHECK_BRAKE_PRESSURE 
CLOSE_SDC 
WAIT_FOR_ASATS 
WAIT_FOR_TS 
EBS_CHECKS 
CHECK_TIMESTAMPS 

activate and deactivate ebs and -> check pressures are correct

CHECKUP_COMPLETE 

Definition at line 70 of file checkupManager.hpp.

◆ EbsPressureTestPhase

Enumerator
DISABLE_ACTUATOR_1 
CHECK_ACTUATOR_2 
ENABLE_ACTUATOR_1 
DISABLE_ACTUATOR_2 
CHECK_ACTUATOR_1 
ENABLE_ACTUATOR_2 
COMPLETE 

Definition at line 87 of file checkupManager.hpp.

Constructor & Destructor Documentation

◆ CheckupManager()

CheckupManager::CheckupManager ( SystemData system_data)
inlineexplicit

Constructor for the CheckupManager class.

Parameters
system_dataPointer to the system data object.

Definition at line 118 of file checkupManager.hpp.

Member Function Documentation

◆ emergency_sequence_complete()

bool CheckupManager::emergency_sequence_complete ( ) const
inline

Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.

Definition at line 457 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initial_checkup_sequence()

CheckupManager::CheckupError CheckupManager::initial_checkup_sequence ( )
inline

Performs an initial checkup.

Definition at line 205 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ res_triggered()

bool CheckupManager::res_triggered ( ) const
inline

Checks if the RES has been triggered.

This function checks whether the RES has been triggered or not.

Definition at line 464 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ reset_checkup_state()

void CheckupManager::reset_checkup_state ( )
inline

Resets the checkup state to the initial state.

Definition at line 181 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ should_enter_emergency()

bool CheckupManager::should_enter_emergency ( State  current_state) const
inline

Performs an emergency checkup.

Definition at line 386 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_enter_emergency_in_driving_state()

bool CheckupManager::should_enter_emergency_in_driving_state ( ) const

Definition at line 404 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_enter_emergency_in_ready_state()

bool CheckupManager::should_enter_emergency_in_ready_state ( ) const

Definition at line 395 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_go_ready_from_off()

bool CheckupManager::should_go_ready_from_off ( ) const
inline

Performs a last re-check for off to ready transition.

Definition at line 365 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_stay_driving()

bool CheckupManager::should_stay_driving ( ) const
inline

Definition at line 441 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ should_stay_manual_driving()

bool CheckupManager::should_stay_manual_driving ( ) const
inline

Performs a manual driving checkup.

Definition at line 186 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ should_stay_mission_finished()

bool CheckupManager::should_stay_mission_finished ( ) const
inline

Performs a mission finished checkup.

Definition at line 450 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ should_stay_off()

bool CheckupManager::should_stay_off ( )
inline

Performs an off checkup.

Definition at line 196 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_stay_ready()

bool CheckupManager::should_stay_ready ( ) const
inline

Performs a ready to drive checkup.

Definition at line 375 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _ebs_sound_timestamp_

Metro CheckupManager::_ebs_sound_timestamp_ {EBS_BUZZER_TIMEOUT}

Timer for the EBS buzzer sound check.

Definition at line 62 of file checkupManager.hpp.

◆ checkup_state_

CheckupState CheckupManager::checkup_state_
Initial value:

Current state of the checkup process.

Definition at line 109 of file checkupManager.hpp.

◆ pressure_test_phase_

EbsPressureTestPhase CheckupManager::pressure_test_phase_ {EbsPressureTestPhase::DISABLE_ACTUATOR_1}

Definition at line 112 of file checkupManager.hpp.


The documentation for this class was generated from the following file: