4#include "../../CAN_IDs.h"
12 value /= WHEEL_PRECISION;
13 if (value < 0) value = 0;
15 msg[0] = LEFT_WHEEL_MSG;
17 for (
int i = 0; i < 4; i++)
18 msg[i + 1] =
static_cast<int>(value) >> (8 * i);
23 const uint8_t state_checkup) {
25 auto normalize_bool = [](
bool value) -> uint8_t {
return value ? 1 : 0; };
27 uint8_t byte0 = (normalize_bool(
true) << 7) |
47 uint8_t byte2 = (state_checkup & 0x0F) |
65 float hydraulic_front_bar =
70 float hydraulic_rear_bar =
79 FloatToBytes front_converter{hydraulic_front_bar};
80 FloatToBytes rear_converter{hydraulic_rear_bar};
82 std::array<uint8_t, 8> data;
83 data[0] = front_converter.bytes[0];
84 data[1] = front_converter.bytes[1];
85 data[2] = front_converter.bytes[2];
86 data[3] = front_converter.bytes[3];
88 data[4] = rear_converter.bytes[0];
89 data[5] = rear_converter.bytes[1];
90 data[6] = rear_converter.bytes[2];
91 data[7] = rear_converter.bytes[3];
bool checkWithoutReset() const
Checks if the interval has passed without resetting the timer.
void create_left_wheel_msg(std::array< uint8_t, 5 > &msg, double value)
Function to create left wheel msg.
std::array< uint8_t, 8 > create_signals_msg_1(const SystemData &system_data, const uint8_t state, const uint8_t state_checkup)
std::array< uint8_t, 8 > create_hydraulic_presures_msg(const SystemData &system_data)
constexpr auto to_underlying(Enum e) noexcept
constexpr int HYDRAULIC_PRESSURE_MAX_BAR
constexpr int HYDRAULIC_PRESSURE_SPAN_ADC
constexpr int HYDRAULIC_PRESSURE_ADC_MIN
volatile bool emergency_signal_
volatile unsigned dc_voltage_
int hydraulic_line_front_pressure
int _hydraulic_line_pressure
bool pneumatic_line_pressure_
bool pneumatic_line_pressure_2_
bool pneumatic_line_pressure_1_
Metro releaseEbsTimestamp
The whole model of the system: holds all the data necessary.
FailureDetection failure_detection_
HardwareData hardware_data_