7#define HYDRAULIC_PRESSURE_HIGH 0xf8
8#define HYDRAULIC_PRESSURE_LOW 0x01
9#define BAMOCAR_VDC_HIGH 0x11
42 while (!time.checkWithoutReset()) {
49 while (!time2.checkWithoutReset()) {
83 bool went_ready =
false;
109 while (!time2.checkWithoutReset()) {
120 TEST_ASSERT_EQUAL(
false, went_ready);
128 bool reverted_to_off =
false;
135 uint8_t bamo_msg2[] = {
VDC_BUS, 0x00, 0x00};
139 while (!time3.checkWithoutReset()) {
142 reverted_to_off =
true;
145 TEST_ASSERT_EQUAL(
false, reverted_to_off);
160 while (!time.checkWithoutReset()){
167 while (!time2.checkWithoutReset()){
173 while (!time3.checkWithoutReset()){
193 while (!time.checkWithoutReset()){
202 uint8_t
msg[8] = {
RES_GO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
208 while (!time2.checkWithoutReset()){
223 while (!time3.checkWithoutReset()){
260 while (!time.checkWithoutReset()){
269 uint8_t
msg[8] = {
RES_GO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
431 while (!time3.checkWithoutReset()) {
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.
State state
Current state of the vehicle system, initialized to OFF.
CheckupState checkupState
Current state of the checkup process.
Class that contains definitions of typical messages to send via CAN It serves only as an example of t...
static void c1Callback(const uint8_t *buf)
Callback for data from C1 Teensy.
static void resStateCallback(const uint8_t *buf)
Callback RES default callback.
static void pcCallback(const uint8_t *buf)
Callback for message from AS CU.
static void bamocarCallback(const uint8_t *buf)
Callback from inversor, for alive signal and data.
Class responsible for controlling digital outputs in the Master Teensy.
Our own implementation of Metro class.
void reset()
Resets the timer to the current time.
bool checkWithoutReset() const
Checks if the interval has passed without resetting the timer.
constexpr auto RIGHT_WHEEL_CODE
constexpr auto MISSION_FINISHED
constexpr auto HYDRAULIC_LINE
#define COMPONENT_TIMESTAMP_TIMEOUT
#define EBS_BUZZER_TIMEOUT
#define INITIAL_CHECKUP_STEP_TIMEOUT
bool pneumatic_line_pressure
Metro resSignalLossTimestamp
Metro inversorAliveTimestamp
Metro steerAliveTimestamp
Metro releaseEbsTimestamp
The whole model of the system: holds all the data necessary.
FailureDetection failureDetection
constexpr unsigned long READY_TIMEOUT_MS
constexpr unsigned long RELEASE_EBS_TIMEOUT_MS
void test_off_to_ready_wayback_impossible()
Test function to validate AS_READY doesn't revert to AS_Ready.
void test_driving_to_finished_to_off()
Test function to validate AS_DRIVING to AS_FINISHED transition and AS_FINISHED to AS_OFF after.
void test_flow_finished()
Test function to validate flow diagram conditions to go AS_FINISHED.
Communicator communicator
void test_ready_to_emg_to_off()
Test function to validate AS_READY to AS_Emergency and the AS_EMERGENCY to AS_OFF transition.
void test_off_to_ready_success(void)
Test function to validate AS_OFF to AS_Ready transition normal and successful transition.
void test_finished_to_emg()
Test function to validate AS_FINISHED to AS_EMERGENCY transition if RES is activated after mission fi...
void test_flow_emergency()
Test function to validate flow diagram conditions to go AS_EMERGENCY.
void test_ready_to_driving_to_emg2()
Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if failure...
DigitalSender digitalSender
#define HYDRAULIC_PRESSURE_HIGH
void to_ready()
Auxiliary function to set state as ready.
void test_flow_ready()
Test function to validate flow diagram conditions to go AS_READY.
#define HYDRAULIC_PRESSURE_LOW
void reset()
Auxiliary function to reset data values.
void test_off_to_manual_wayback()
Test function to validate AS_OFF to AS_Manual transition and the other way around.
void test_off_to_ready_recheck()
Test function to validate AS_OFF to AS_Ready transition with checks reverting to invalid mid transiti...
void test_flow_driving()
Test function to validate flow diagram conditions to go AS_DRIVING.
void test_ready_to_driving_to_emg()
Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if brakes ...