Apollo 10.0
自动驾驶开放平台
apollo::canbus::lincoln::Steering65类 参考

one of the protocol data of lincoln vehicle 更多...

#include <steering_65.h>

类 apollo::canbus::lincoln::Steering65 继承关系图:
apollo::canbus::lincoln::Steering65 的协作图:

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
virtual void Parse (const std::uint8_t *bytes, int32_t length, const struct timeval &timestamp, Lincoln *chassis_detail) const
 
double steering_angle (const std::uint8_t *bytes, int32_t length) const
 calculate steering angle 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.
 
double vehicle_speed (const std::uint8_t *bytes, int32_t length) const
 calculate vehicle speed based on byte array.
 
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.
 
bool is_driver_override (const std::uint8_t *bytes, int32_t length) const
 check driver override 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.
 
bool is_watchdog_counter_fault (const std::uint8_t *bytes, int32_t length) const
 check watchdog counter fault 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_channel_2_fault (const std::uint8_t *bytes, int32_t length) const
 check channel 2 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.
 
bool is_connector_fault (const std::uint8_t *bytes, int32_t length) const
 check connector fault bit based on byte array.
 
- Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Lincoln >
 ProtocolData ()=default
 construct protocol data.
 
virtual ~ProtocolData ()=default
 destruct protocol data.
 
virtual uint32_t GetPeriod () const
 
virtual int32_t GetLength () const
 
virtual void Parse (const uint8_t *bytes, int32_t length, ::apollo::canbus::Lincoln *sensor_data) const
 
virtual void UpdateData (uint8_t *data)
 
virtual void UpdateData_Heartbeat (uint8_t *data)
 
virtual void Reset ()
 

静态 Public 属性

static const int32_t ID = 0x65
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Lincoln >
static std::uint8_t CalculateCheckSum (const uint8_t *input, const uint32_t length)
 static function, used to calculate the checksum of input array.
 
static T BoundedValue (T lower, T upper, T val)
 

详细描述

one of the protocol data of lincoln vehicle

在文件 steering_65.h42 行定义.

成员函数说明

◆ epas_torque()

double apollo::canbus::lincoln::Steering65::epas_torque ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate epas torque based on byte array.

config detail: {'name': 'torque', 'offset': 0.0, 'precision': 0.0625, 'len': 8, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 48, 'type': 'double', 'order': 'intel', 'physical_unit': '"Nm"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of epas torque

在文件 steering_65.cc117 行定义.

118 {
119 Byte frame(bytes + 6);
120 int32_t x = frame.get_byte(0, 8);
121 if (x > 0x7F) {
122 x -= 0x100;
123 }
124 return x * 0.062500;
125}

◆ is_calibration_fault()

bool apollo::canbus::lincoln::Steering65::is_calibration_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check calibration fault bit based on byte array.

config detail: {'name': 'fltcal', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 62, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of calibration fault bit

在文件 steering_65.cc163 行定义.

164 {
165 Byte frame(bytes + 7);
166 return frame.is_bit_1(6);
167}

◆ is_channel_1_fault()

bool apollo::canbus::lincoln::Steering65::is_channel_1_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check channel 1 fault bit based on byte array.

config detail: {'name': 'flt1', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 60, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of steering angle

在文件 steering_65.cc151 行定义.

152 {
153 Byte frame(bytes + 7);
154 return frame.is_bit_1(4);
155}

◆ is_channel_2_fault()

bool apollo::canbus::lincoln::Steering65::is_channel_2_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check channel 2 fault bit based on byte array.

config detail: {'name': 'flt2', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 61, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of channel 2 fault bit

在文件 steering_65.cc157 行定义.

158 {
159 Byte frame(bytes + 7);
160 return frame.is_bit_1(5);
161}

◆ is_connector_fault()

bool apollo::canbus::lincoln::Steering65::is_connector_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check connector fault bit based on byte array.

config detail: {'name': 'fltcon', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of connector fault bit

在文件 steering_65.cc169 行定义.

170 {
171 Byte frame(bytes + 7);
172 return frame.is_bit_1(7);
173}

◆ is_driver_activity()

bool apollo::canbus::lincoln::Steering65::is_driver_activity ( const std::uint8_t *  bytes,
int32_t  length 
) const

check driver activity bit based on byte array.

config detail: {'name': 'driver', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 58, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of driver activity

在文件 steering_65.cc139 行定义.

140 {
141 Byte frame(bytes + 7);
142 return frame.is_bit_1(2);
143}

◆ is_driver_override()

bool apollo::canbus::lincoln::Steering65::is_driver_override ( const std::uint8_t *  bytes,
int32_t  length 
) const

check driver override bit based on byte array.

config detail: {'name': 'override', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 57, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of driver override

在文件 steering_65.cc132 行定义.

133 {
134 // Cleared on rising edge of EN bit in command message
135 Byte frame(bytes + 7);
136 return frame.is_bit_1(1);
137}

◆ is_enabled()

bool apollo::canbus::lincoln::Steering65::is_enabled ( const std::uint8_t *  bytes,
int32_t  length 
) const

check enabled bit based on byte array.

config detail: {'name': 'en', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 56, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of enabled bit

在文件 steering_65.cc127 行定义.

127 {
128 Byte frame(bytes + 7);
129 return frame.is_bit_1(0);
130}

◆ is_watchdog_counter_fault()

bool apollo::canbus::lincoln::Steering65::is_watchdog_counter_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check watchdog counter fault based on byte array.

config detail: {'name': 'fltwdc', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'f_type': 'valid', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 59, 'type': 'bool', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of watchdog counter fault

在文件 steering_65.cc145 行定义.

146 {
147 Byte frame(bytes + 7);
148 return frame.is_bit_1(3);
149}

◆ Parse() [1/2]

void apollo::canbus::lincoln::Steering65::Parse ( const std::uint8_t *  bytes,
int32_t  length,
const struct timeval &  timestamp,
Lincoln chassis_detail 
) const
virtual

在文件 steering_65.cc70 行定义.

72 {
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);
77}
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const

◆ Parse() [2/2]

void apollo::canbus::lincoln::Steering65::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Lincoln chassis_detail 
) const
virtual

在文件 steering_65.cc29 行定义.

30 {
31 chassis_detail->mutable_eps()->set_steering_angle(
32 steering_angle(bytes, length));
33 // no steering angle speed
34
35 chassis_detail->mutable_eps()->set_steering_angle_cmd(
36 reported_steering_angle_cmd(bytes, length));
37 // ?
38 chassis_detail->mutable_eps()->set_is_steering_angle_valid(true);
39 // vehicle speed from steering, kph -> mps
40 chassis_detail->mutable_eps()->set_vehicle_speed(
41 vehicle_speed(bytes, length) / 3.6);
42
43 // speed, as it has a higher accuracy
44 // kph -> mps
45 chassis_detail->mutable_vehicle_spd()->set_vehicle_spd(
46 vehicle_speed(bytes, length) / 3.6);
47 chassis_detail->mutable_vehicle_spd()->set_is_vehicle_spd_valid(true);
48
49 chassis_detail->mutable_eps()->set_epas_torque(epas_torque(bytes, length));
50 chassis_detail->mutable_eps()->set_steering_enabled(
51 is_enabled(bytes, length));
52 chassis_detail->mutable_eps()->set_driver_override(
53 is_driver_override(bytes, length));
54 chassis_detail->mutable_eps()->set_driver_activity(
55 is_driver_activity(bytes, length));
56 chassis_detail->mutable_eps()->set_watchdog_fault(
57 is_watchdog_counter_fault(bytes, length));
58 chassis_detail->mutable_eps()->set_channel_1_fault(
59 is_channel_1_fault(bytes, length));
60 chassis_detail->mutable_eps()->set_channel_2_fault(
61 is_channel_2_fault(bytes, length));
62 chassis_detail->mutable_eps()->set_calibration_fault(
63 is_calibration_fault(bytes, length));
64 chassis_detail->mutable_eps()->set_connector_fault(
65 is_connector_fault(bytes, length));
66 chassis_detail->mutable_check_response()->set_is_eps_online(
67 !is_driver_override(bytes, length));
68}
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.
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.

◆ reported_steering_angle_cmd()

double apollo::canbus::lincoln::Steering65::reported_steering_angle_cmd ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate reported steering angle command based on byte array.

config detail: {'name': 'cmd', 'offset': 0.0, 'precision': 0.1, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[-470|470]', 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of reported steering angle command

在文件 steering_65.cc93 行定义.

94 {
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;
102 }
103
104 return value * 0.100000;
105}

◆ steering_angle()

double apollo::canbus::lincoln::Steering65::steering_angle ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate steering angle based on byte array.

config detail: {'name': 'angle', 'offset': 0.0, 'precision': 0.1, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[-470|470]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of steering angle

在文件 steering_65.cc79 行定义.

80 {
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;
86 if (value > 0x8000) {
87 value = value - 0x10000;
88 }
89
90 return value * 0.100000;
91}

◆ vehicle_speed()

double apollo::canbus::lincoln::Steering65::vehicle_speed ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate vehicle speed based on byte array.

config detail: {'name': 'speed', 'offset': 0.0, 'precision': 0.01, 'len': 16, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 32, 'type': 'double', 'order': 'intel', 'physical_unit': '"kph"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of vehicle speed

在文件 steering_65.cc107 行定义.

108 {
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;
115}

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Steering65::ID = 0x65
static

在文件 steering_65.h45 行定义.


该类的文档由以下文件生成: