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()) {
84 bool went_ready =
false;
110 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()) {
144 TEST_ASSERT_EQUAL(
false, reverted_to_off);
159 while (!time.checkWithoutReset()) {
166 while (!time2.checkWithoutReset()) {
172 while (!time3.checkWithoutReset()) {
192 while (!time.checkWithoutReset()) {
201 uint8_t
msg[8] = {
RES_GO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
207 while (!time2.checkWithoutReset()) {
222 while (!time3.checkWithoutReset()) {
259 while (!time.checkWithoutReset()) {
268 uint8_t
msg[8] = {
RES_GO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
432 while (!time3.checkWithoutReset()) {
The ASState class manages and transitions between different states of the vehicle system.
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.
Class that contains definitions of typical messages to send via CAN It serves only as an example of t...
static void res_state_callback(const uint8_t *buf)
Callback RES default callback.
static void c1_callback(const uint8_t *buf)
Callback for data from C1 Teensy.
static void pc_callback(const uint8_t *buf)
Callback for message from AS CU.
static void bamocar_callback(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
constexpr unsigned long READY_TIMEOUT_MS
constexpr unsigned long RELEASE_EBS_TIMEOUT_MS
constexpr int COMPONENT_TIMESTAMP_TIMEOUT
constexpr int INITIAL_CHECKUP_STEP_TIMEOUT
constexpr int EBS_BUZZER_TIMEOUT
bool pneumatic_line_pressure_
Metro pc_alive_timestamp_
Metro steer_alive_timestamp_
Metro res_signal_loss_timestamp_
Metro inversor_alive_timestamp_
Metro releaseEbsTimestamp
The whole model of the system: holds all the data necessary.
DigitalData digital_data_
FailureDetection failure_detection_
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 ...