25using ::apollo::drivers::canbus::Byte;
30 Lincoln *chassis_detail)
const {
31 chassis_detail->mutable_eps()->set_steering_angle(
35 chassis_detail->mutable_eps()->set_steering_angle_cmd(
38 chassis_detail->mutable_eps()->set_is_steering_angle_valid(
true);
40 chassis_detail->mutable_eps()->set_vehicle_speed(
45 chassis_detail->mutable_vehicle_spd()->set_vehicle_spd(
47 chassis_detail->mutable_vehicle_spd()->set_is_vehicle_spd_valid(
true);
49 chassis_detail->mutable_eps()->set_epas_torque(
epas_torque(bytes, length));
50 chassis_detail->mutable_eps()->set_steering_enabled(
52 chassis_detail->mutable_eps()->set_driver_override(
54 chassis_detail->mutable_eps()->set_driver_activity(
56 chassis_detail->mutable_eps()->set_watchdog_fault(
58 chassis_detail->mutable_eps()->set_channel_1_fault(
60 chassis_detail->mutable_eps()->set_channel_2_fault(
62 chassis_detail->mutable_eps()->set_calibration_fault(
64 chassis_detail->mutable_eps()->set_connector_fault(
66 chassis_detail->mutable_check_response()->set_is_eps_online(
71 const struct timeval ×tamp,
72 Lincoln *chassis_detail)
const {
73 chassis_detail->mutable_eps()->set_timestamp_65(
74 static_cast<double>(timestamp.tv_sec) +
75 static_cast<double>(timestamp.tv_usec) / 1000000.0);
76 Parse(bytes, length, chassis_detail);
80 int32_t length)
const {
81 Byte frame_high(bytes + 1);
82 int32_t high = frame_high.get_byte(0, 8);
83 Byte frame_low(bytes + 0);
84 int32_t low = frame_low.get_byte(0, 8);
85 int32_t value = (high << 8) | low;
87 value = value - 0x10000;
90 return value * 0.100000;
94 int32_t length)
const {
95 Byte frame_high(bytes + 3);
96 int32_t high = frame_high.get_byte(0, 8);
97 Byte frame_low(bytes + 2);
98 int32_t low = frame_low.get_byte(0, 8);
99 int32_t value = (high << 8) | low;
100 if (value > 0x8000) {
101 value = value - 0x10000;
104 return value * 0.100000;
108 int32_t length)
const {
109 Byte frame_high(bytes + 5);
110 int32_t high = frame_high.get_byte(0, 8);
111 Byte frame_low(bytes + 4);
112 int32_t low = frame_low.get_byte(0, 8);
113 int32_t value = (high << 8) | low;
114 return value * 0.010000;
118 int32_t length)
const {
119 Byte frame(bytes + 6);
120 int32_t x = frame.get_byte(0, 8);
128 Byte frame(bytes + 7);
129 return frame.is_bit_1(0);
133 int32_t length)
const {
135 Byte frame(bytes + 7);
136 return frame.is_bit_1(1);
140 int32_t length)
const {
141 Byte frame(bytes + 7);
142 return frame.is_bit_1(2);
146 int32_t length)
const {
147 Byte frame(bytes + 7);
148 return frame.is_bit_1(3);
152 int32_t length)
const {
153 Byte frame(bytes + 7);
154 return frame.is_bit_1(4);
158 int32_t length)
const {
159 Byte frame(bytes + 7);
160 return frame.is_bit_1(5);
164 int32_t length)
const {
165 Byte frame(bytes + 7);
166 return frame.is_bit_1(6);
170 int32_t length)
const {
171 Byte frame(bytes + 7);
172 return frame.is_bit_1(7);
double epas_torque(const std::uint8_t *bytes, int32_t length) const
calculate epas torque based on byte array.
bool is_enabled(const std::uint8_t *bytes, int32_t length) const
check enabled bit based on byte array.
double reported_steering_angle_cmd(const std::uint8_t *bytes, int32_t length) const
calculate reported steering angle command 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.
bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const
check channel 2 fault bit based on byte array.
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
bool is_watchdog_counter_fault(const std::uint8_t *bytes, int32_t length) const
check watchdog counter fault 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.
bool is_driver_override(const std::uint8_t *bytes, int32_t length) const
check driver override bit based on byte array.
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_calibration_fault(const std::uint8_t *bytes, int32_t length) const
check calibration fault bit based on byte array.
double steering_angle(const std::uint8_t *bytes, int32_t length) const
calculate steering angle based on byte array.
double vehicle_speed(const std::uint8_t *bytes, int32_t length) const
calculate vehicle speed based on byte array.
the class of steering_65.h (for lincoln vehicle)