25using ::apollo::drivers::canbus::Byte;
30 Lincoln *chassis_detail)
const {
31 chassis_detail->mutable_gas()->set_throttle_input(
pedal_input(bytes, length));
32 chassis_detail->mutable_gas()->set_throttle_cmd(
pedal_cmd(bytes, length));
33 chassis_detail->mutable_gas()->set_throttle_output(
35 chassis_detail->mutable_gas()->set_watchdog_source(
37 chassis_detail->mutable_gas()->set_throttle_enabled(
39 chassis_detail->mutable_gas()->set_driver_override(
41 chassis_detail->mutable_gas()->set_driver_activity(
43 chassis_detail->mutable_gas()->set_watchdog_fault(
45 chassis_detail->mutable_gas()->set_channel_1_fault(
47 chassis_detail->mutable_gas()->set_channel_2_fault(
49 chassis_detail->mutable_gas()->set_connector_fault(
51 chassis_detail->mutable_check_response()->set_is_vcu_online(
56 int32_t length)
const {
58 Byte frame_high(bytes + 1);
59 int32_t high = frame_high.get_byte(0, 8);
60 Byte frame_low(bytes + 0);
61 int32_t low = frame_low.get_byte(0, 8);
62 int32_t value = (high << 8) | low;
64 double output = 100.0 * value * 1.52590218966964e-05;
65 output = ProtocolData::BoundedValue(0.0, 100.0, output);
71 Byte frame_high(bytes + 3);
72 int32_t high = frame_high.get_byte(0, 8);
73 Byte frame_low(bytes + 2);
74 int32_t low = frame_low.get_byte(0, 8);
75 int32_t value = (high << 8) | low;
77 double output = 100.0 * value * 1.52590218966964e-05;
78 output = ProtocolData::BoundedValue(0.0, 100.0, output);
83 int32_t length)
const {
85 Byte frame_high(bytes + 5);
86 int32_t high = frame_high.get_byte(0, 8);
87 Byte frame_low(bytes + 4);
88 int32_t low = frame_low.get_byte(0, 8);
89 int32_t value = (high << 8) | low;
91 double output = 100.0 * value * 1.52590218966964e-05;
92 output = ProtocolData::BoundedValue(0.0, 100.0, output);
97 int32_t length)
const {
98 Byte frame(bytes + 6);
99 int32_t x = frame.get_byte(4, 4);
104 Byte frame(bytes + 7);
105 return frame.is_bit_1(0);
109 int32_t length)
const {
110 Byte frame(bytes + 7);
111 return frame.is_bit_1(1);
115 int32_t length)
const {
116 Byte frame(bytes + 7);
117 return frame.is_bit_1(2);
121 int32_t length)
const {
122 Byte frame(bytes + 7);
123 return frame.is_bit_1(3);
127 int32_t length)
const {
128 Byte frame(bytes + 7);
129 return frame.is_bit_1(4);
133 int32_t length)
const {
134 Byte frame(bytes + 7);
135 return frame.is_bit_1(5);
139 int32_t length)
const {
140 Byte frame(bytes + 7);
141 return frame.is_bit_1(7);
bool is_driver_override(const std::uint8_t *bytes, int32_t length) const
check driver override bit based on byte array.
double pedal_cmd(const std::uint8_t *bytes, int32_t length) const
calculate pedal command based on byte array.
double pedal_output(const std::uint8_t *bytes, int32_t length) const
calculate pedal output based on byte array.
bool is_connector_fault(const std::uint8_t *bytes, int32_t length) const
check connector fault bit based on byte array.
double pedal_input(const std::uint8_t *bytes, int32_t length) const
calculate pedal input based on byte array.
bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const
check channel 2 fault bit based on byte array.
bool is_watchdog_counter_fault(const std::uint8_t *bytes, int32_t length) const
check watchdog counter fault bit based on byte array.
bool is_enabled(const std::uint8_t *bytes, int32_t length) const
check enabled bit based on byte array.
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
bool is_channel_1_fault(const std::uint8_t *bytes, int32_t length) const
check channel 1 fault bit based on byte array.
bool is_driver_activity(const std::uint8_t *bytes, int32_t length) const
check driver activity bit based on byte array.
int32_t watchdog_counter_source(const std::uint8_t *bytes, int32_t length) const
calculate watchdog counter source based on byte array.
the class of Throttle63 (for lincoln vehicle)