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

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

#include <misc_69.h>

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

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
int32_t turn_signal_status (const std::uint8_t *bytes, int32_t length) const
 calculate the turn signal status based on byte array.
 
int32_t high_beam_status (const std::uint8_t *bytes, int32_t length) const
 calculate the high beam status based on byte array.
 
int32_t wiper_status (const std::uint8_t *bytes, int32_t length) const
 calculate the wiper status based on byte array.
 
int32_t ambient_light_status (const std::uint8_t *bytes, int32_t length) const
 calculate the ambient light status based on byte array.
 
bool is_acc_on_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc on pressed bit based on byte array.
 
bool is_acc_off_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc off pressed bit based on byte array.
 
bool is_acc_resume_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc resume pressed bit based on byte array.
 
bool is_acc_cancel_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc cancel pressed bit based on byte array.
 
bool is_acc_on_or_off_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc on or off pressed bit based on byte array.
 
bool is_acc_resume_or_cancel_pressed (const std::uint8_t *bytes, int32_t length) const
 check acc resume or cancel pressed bit based on byte array.
 
bool is_acc_increment_set_speed_pressed (const std::uint8_t *bytes, int32_t length) const
 check the acc increment set speed pressed bit based on byte array.
 
bool is_acc_decrement_set_speed_pressed (const std::uint8_t *bytes, int32_t length) const
 check the acc decrement set speed pressed bit based on byte array.
 
bool is_acc_increment_following_gap_pressed (const std::uint8_t *bytes, int32_t length) const
 check the acc increment following gap pressed bit based on byte array.
 
bool is_acc_decrement_following_gap_pressed (const std::uint8_t *bytes, int32_t length) const
 check the acc decrement following gap pressed bit based on byte array.
 
bool is_lka_on_or_off_pressed (const std::uint8_t *bytes, int32_t length) const
 check the lka on or off pressed bit based on byte array.
 
bool is_canbus_fault (const std::uint8_t *bytes, int32_t length) const
 check the canbus fault bit based on byte array.
 
bool is_driver_door_open (const std::uint8_t *bytes, int32_t length) const
 check the driver door open bit based on byte array.
 
bool is_passenger_door_open (const std::uint8_t *bytes, int32_t length) const
 check the passenger door open bit based on byte array.
 
bool is_rear_left_door_open (const std::uint8_t *bytes, int32_t length) const
 check the passenger door open bit based on byte array.
 
bool is_rear_right_door_open (const std::uint8_t *bytes, int32_t length) const
 check the rear right door open bit based on byte array.
 
bool is_hood_open (const std::uint8_t *bytes, int32_t length) const
 check the hood open bit based on byte array.
 
bool is_trunk_open (const std::uint8_t *bytes, int32_t length) const
 check the trunk open bit based on byte array.
 
bool is_passenger_detected (const std::uint8_t *bytes, int32_t length) const
 check the passenger detected bit based on byte array.
 
bool is_passenger_airbag_enabled (const std::uint8_t *bytes, int32_t length) const
 check the passenger airbag enabled bit based on byte array.
 
bool is_driver_belt_buckled (const std::uint8_t *bytes, int32_t length) const
 check the driver belt buckled bit based on byte array.
 
bool is_passenger_belt_buckled (const std::uint8_t *bytes, int32_t length) const
 check the passenger belt buckled 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 = 0x69
 

额外继承的成员函数

- 静态 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

在文件 misc_69.h40 行定义.

成员函数说明

◆ ambient_light_status()

int32_t apollo::canbus::lincoln::Misc69::ambient_light_status ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate the ambient light status based on byte array.

config detail: {'name': 'ambient', 'offset': 0.0, 'precision': 1.0, 'len': 3, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 8, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of ambient light

在文件 misc_69.cc245 行定义.

246 {
247 Byte frame(bytes + 1);
248 int32_t x = frame.get_byte(0, 3);
249 return x;
250}

◆ high_beam_status()

int32_t apollo::canbus::lincoln::Misc69::high_beam_status ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate the high beam status based on byte array.

config detail: {'name': 'hibeam', 'offset': 0.0, 'precision': 1.0, 'len': 2, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 2, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of high beam status

在文件 misc_69.cc232 行定义.

233 {
234 Byte frame(bytes + 0);
235 int32_t x = frame.get_byte(2, 2);
236 return x;
237}

◆ is_acc_cancel_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_cancel_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc cancel pressed bit based on byte array.

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

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

在文件 misc_69.cc270 行定义.

271 {
272 Byte frame(bytes + 1);
273 return frame.is_bit_1(6);
274}

◆ is_acc_decrement_following_gap_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_decrement_following_gap_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the acc decrement following gap pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc decrement following gap pressed bit

在文件 misc_69.cc306 行定义.

307 {
308 Byte frame(bytes + 2);
309 return frame.is_bit_1(5);
310}

◆ is_acc_decrement_set_speed_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_decrement_set_speed_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the acc decrement set speed pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc decrement set speed pressed bit

在文件 misc_69.cc294 行定义.

295 {
296 Byte frame(bytes + 2);
297 return frame.is_bit_1(3);
298}

◆ is_acc_increment_following_gap_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_increment_following_gap_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the acc increment following gap pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc increment following gap pressed bit

在文件 misc_69.cc300 行定义.

301 {
302 Byte frame(bytes + 2);
303 return frame.is_bit_1(4);
304}

◆ is_acc_increment_set_speed_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_increment_set_speed_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the acc increment set speed pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc increment set speed pressed bit

在文件 misc_69.cc288 行定义.

289 {
290 Byte frame(bytes + 2);
291 return frame.is_bit_1(2);
292}

◆ is_acc_off_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_off_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc off pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of acc off pressed bit

在文件 misc_69.cc258 行定义.

259 {
260 Byte frame(bytes + 1);
261 return frame.is_bit_1(4);
262}

◆ is_acc_on_or_off_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_on_or_off_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc on or off pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc on or off pressed bit

在文件 misc_69.cc276 行定义.

277 {
278 Byte frame(bytes + 2);
279 return frame.is_bit_1(0);
280}

◆ is_acc_on_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_on_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc on pressed bit based on byte array.

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

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

在文件 misc_69.cc252 行定义.

253 {
254 Byte frame(bytes + 1);
255 return frame.is_bit_1(3);
256}

◆ is_acc_resume_or_cancel_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_resume_or_cancel_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc resume or cancel pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of acc resume or cancel pressed bit

在文件 misc_69.cc282 行定义.

283 {
284 Byte frame(bytes + 2);
285 return frame.is_bit_1(1);
286}

◆ is_acc_resume_pressed()

bool apollo::canbus::lincoln::Misc69::is_acc_resume_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check acc resume pressed bit based on byte array.

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

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

在文件 misc_69.cc264 行定义.

265 {
266 Byte frame(bytes + 1);
267 return frame.is_bit_1(5);
268}

◆ is_canbus_fault()

bool apollo::canbus::lincoln::Misc69::is_canbus_fault ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the canbus fault bit based on byte array.

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

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

在文件 misc_69.cc318 行定义.

318 {
319 Byte frame(bytes + 2);
320 return frame.is_bit_1(7);
321}

◆ is_driver_belt_buckled()

bool apollo::canbus::lincoln::Misc69::is_driver_belt_buckled ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the driver belt buckled bit based on byte array.

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

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

在文件 misc_69.cc369 行定义.

370 {
371 Byte frame(bytes + 4);
372 return frame.is_bit_1(0);
373}

◆ is_driver_door_open()

bool apollo::canbus::lincoln::Misc69::is_driver_door_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the driver door open bit based on byte array.

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

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

在文件 misc_69.cc323 行定义.

324 {
325 Byte frame(bytes + 3);
326 return frame.is_bit_1(0);
327}

◆ is_hood_open()

bool apollo::canbus::lincoln::Misc69::is_hood_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the hood open bit based on byte array.

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

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

在文件 misc_69.cc347 行定义.

347 {
348 Byte frame(bytes + 3);
349 return frame.is_bit_1(4);
350}

◆ is_lka_on_or_off_pressed()

bool apollo::canbus::lincoln::Misc69::is_lka_on_or_off_pressed ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the lka on or off pressed bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of lka on or off pressed bit

在文件 misc_69.cc312 行定义.

313 {
314 Byte frame(bytes + 2);
315 return frame.is_bit_1(6);
316}

◆ is_passenger_airbag_enabled()

bool apollo::canbus::lincoln::Misc69::is_passenger_airbag_enabled ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the passenger airbag enabled bit based on byte array.

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

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

在文件 misc_69.cc363 行定义.

364 {
365 Byte frame(bytes + 3);
366 return frame.is_bit_1(7);
367}

◆ is_passenger_belt_buckled()

bool apollo::canbus::lincoln::Misc69::is_passenger_belt_buckled ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the passenger belt buckled bit based on byte array.

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

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

在文件 misc_69.cc375 行定义.

376 {
377 Byte frame(bytes + 4);
378 return frame.is_bit_1(1);
379}

◆ is_passenger_detected()

bool apollo::canbus::lincoln::Misc69::is_passenger_detected ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the passenger detected bit based on byte array.

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

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

在文件 misc_69.cc357 行定义.

358 {
359 Byte frame(bytes + 3);
360 return frame.is_bit_1(6);
361}

◆ is_passenger_door_open()

bool apollo::canbus::lincoln::Misc69::is_passenger_door_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the passenger door open bit based on byte array.

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

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

在文件 misc_69.cc329 行定义.

330 {
331 Byte frame(bytes + 3);
332 return frame.is_bit_1(1);
333}

◆ is_rear_left_door_open()

bool apollo::canbus::lincoln::Misc69::is_rear_left_door_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the passenger door open bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of rear left door open bit

在文件 misc_69.cc335 行定义.

336 {
337 Byte frame(bytes + 3);
338 return frame.is_bit_1(2);
339}

◆ is_rear_right_door_open()

bool apollo::canbus::lincoln::Misc69::is_rear_right_door_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the rear right door open bit based on byte array.

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

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the boolean value of rear right door open bit

在文件 misc_69.cc341 行定义.

342 {
343 Byte frame(bytes + 3);
344 return frame.is_bit_1(3);
345}

◆ is_trunk_open()

bool apollo::canbus::lincoln::Misc69::is_trunk_open ( const std::uint8_t *  bytes,
int32_t  length 
) const

check the trunk open bit based on byte array.

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

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

在文件 misc_69.cc352 行定义.

352 {
353 Byte frame(bytes + 3);
354 return frame.is_bit_1(5);
355}

◆ Parse()

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

在文件 misc_69.cc29 行定义.

30 {
31 int32_t turn_light_type = turn_signal_status(bytes, length);
32 switch (turn_light_type) {
33 case 0:
34 chassis_detail->mutable_light()->set_turn_light_type(
36 break;
37 case 1:
38 chassis_detail->mutable_light()->set_turn_light_type(Light::TURN_LEFT_ON);
39 break;
40 case 2:
41 chassis_detail->mutable_light()->set_turn_light_type(
43 break;
44 case 3:
45 break;
46 default:
47 break;
48 }
49
50 int32_t hi_beam_status = high_beam_status(bytes, length);
51 switch (hi_beam_status) {
52 case 0:
53 chassis_detail->mutable_light()->set_lincoln_lamp_type(Light::BEAM_NULL);
54 break;
55 case 1:
56 chassis_detail->mutable_light()->set_lincoln_lamp_type(
58 break;
59 case 2:
60 chassis_detail->mutable_light()->set_lincoln_lamp_type(Light::BEAM_HIGH);
61 break;
62 case 3:
63 default:
64 chassis_detail->mutable_light()->set_lincoln_lamp_type(
66 break;
67 }
68
69 // wiper status, non-compatible
70 int32_t wiper = wiper_status(bytes, length);
71 switch (wiper) {
72 case 0:
73 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_OFF);
74 break;
75 case 1:
76 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_AUTO_OFF);
77 break;
78 case 2:
79 chassis_detail->mutable_light()->set_lincoln_wiper(
81 break;
82 case 3:
83 chassis_detail->mutable_light()->set_lincoln_wiper(
85 break;
86 case 4:
87 chassis_detail->mutable_light()->set_lincoln_wiper(
89 break;
90 case 5:
91 chassis_detail->mutable_light()->set_lincoln_wiper(
93 break;
94 case 6:
95 chassis_detail->mutable_light()->set_lincoln_wiper(
97 break;
98 case 7:
99 chassis_detail->mutable_light()->set_lincoln_wiper(
101 break;
102 case 8:
103 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_WASH);
104 break;
105 case 9:
106 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_AUTO_LOW);
107 break;
108 case 10:
109 chassis_detail->mutable_light()->set_lincoln_wiper(
111 break;
112 case 11:
113 chassis_detail->mutable_light()->set_lincoln_wiper(
115 break;
116 case 12:
117 chassis_detail->mutable_light()->set_lincoln_wiper(
119 break;
120 case 13:
121 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_RESERVED);
122 break;
123 case 14:
124 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_STALLED);
125 break;
126 case 15:
127 chassis_detail->mutable_light()->set_lincoln_wiper(Light::WIPER_NO_DATA);
128 break;
129 }
130
131 int32_t ambient = ambient_light_status(bytes, length);
132 switch (ambient) {
133 case 0:
134 chassis_detail->mutable_light()->set_lincoln_ambient(Light::AMBIENT_DARK);
135 break;
136 case 1:
137 chassis_detail->mutable_light()->set_lincoln_ambient(
139 break;
140 case 2:
141 chassis_detail->mutable_light()->set_lincoln_ambient(
143 break;
144 case 3:
145 chassis_detail->mutable_light()->set_lincoln_ambient(
147 break;
148 case 4:
149 chassis_detail->mutable_light()->set_lincoln_ambient(
151 break;
152 case 7:
153 chassis_detail->mutable_light()->set_lincoln_ambient(
155 break;
156 default:
157 chassis_detail->mutable_light()->set_lincoln_ambient(
159 break;
160 }
161
162 // acc button related
163 chassis_detail->mutable_basic()->set_acc_on_button(
164 is_acc_on_pressed(bytes, length));
165 chassis_detail->mutable_basic()->set_acc_off_button(
166 is_acc_off_pressed(bytes, length));
167 chassis_detail->mutable_basic()->set_acc_res_button(
168 is_acc_resume_pressed(bytes, length));
169 chassis_detail->mutable_basic()->set_acc_cancel_button(
170 is_acc_cancel_pressed(bytes, length));
171 chassis_detail->mutable_basic()->set_acc_on_off_button(
172 is_acc_on_or_off_pressed(bytes, length));
173 chassis_detail->mutable_basic()->set_acc_res_cancel_button(
174 is_acc_resume_or_cancel_pressed(bytes, length));
175 chassis_detail->mutable_basic()->set_acc_inc_spd_button(
177 chassis_detail->mutable_basic()->set_acc_dec_spd_button(
179 chassis_detail->mutable_basic()->set_acc_inc_gap_button(
181 chassis_detail->mutable_basic()->set_acc_dec_gap_button(
183 chassis_detail->mutable_basic()->set_lka_button(
184 is_lka_on_or_off_pressed(bytes, length));
185 chassis_detail->mutable_basic()->set_canbus_fault(
186 is_canbus_fault(bytes, length));
187
188 // driver door
189 if (is_driver_door_open(bytes, length)) {
190 chassis_detail->mutable_safety()->set_is_driver_car_door_close(false);
191 } else {
192 chassis_detail->mutable_safety()->set_is_driver_car_door_close(true);
193 }
194
195 chassis_detail->mutable_safety()->set_is_passenger_door_open(
196 is_passenger_door_open(bytes, length));
197 chassis_detail->mutable_safety()->set_is_rearleft_door_open(
198 is_rear_left_door_open(bytes, length));
199 chassis_detail->mutable_safety()->set_is_rearright_door_open(
200 is_rear_right_door_open(bytes, length));
201 chassis_detail->mutable_safety()->set_is_hood_open(
202 is_hood_open(bytes, length));
203 chassis_detail->mutable_safety()->set_is_trunk_open(
204 is_trunk_open(bytes, length));
205 chassis_detail->mutable_safety()->set_is_passenger_detected(
206 is_passenger_detected(bytes, length));
207 chassis_detail->mutable_safety()->set_is_passenger_airbag_enabled(
208 is_passenger_airbag_enabled(bytes, length));
209
210 // airbag ? driver airbag?
211 // chassis_detail->mutable_basic()->set_is_air_bag_deployed(
212 // is_passenger_airbag_enabled(bytes, length));
213
214 // driver buckled
215 chassis_detail->mutable_safety()->set_is_driver_buckled(
216 is_driver_belt_buckled(bytes, length));
217 chassis_detail->mutable_safety()->set_is_passenger_buckled(
218 is_passenger_belt_buckled(bytes, length));
219
220 // has error?, non-compatible
221 // chassis_detail->mutable_safety()->set_has_error(
222 // is_canbus_fault(bytes, length));
223}
bool is_passenger_airbag_enabled(const std::uint8_t *bytes, int32_t length) const
check the passenger airbag enabled bit based on byte array.
Definition misc_69.cc:363
bool is_acc_cancel_pressed(const std::uint8_t *bytes, int32_t length) const
check acc cancel pressed bit based on byte array.
Definition misc_69.cc:270
bool is_rear_left_door_open(const std::uint8_t *bytes, int32_t length) const
check the passenger door open bit based on byte array.
Definition misc_69.cc:335
bool is_acc_off_pressed(const std::uint8_t *bytes, int32_t length) const
check acc off pressed bit based on byte array.
Definition misc_69.cc:258
bool is_hood_open(const std::uint8_t *bytes, int32_t length) const
check the hood open bit based on byte array.
Definition misc_69.cc:347
bool is_lka_on_or_off_pressed(const std::uint8_t *bytes, int32_t length) const
check the lka on or off pressed bit based on byte array.
Definition misc_69.cc:312
bool is_passenger_belt_buckled(const std::uint8_t *bytes, int32_t length) const
check the passenger belt buckled bit based on byte array.
Definition misc_69.cc:375
bool is_acc_resume_or_cancel_pressed(const std::uint8_t *bytes, int32_t length) const
check acc resume or cancel pressed bit based on byte array.
Definition misc_69.cc:282
int32_t turn_signal_status(const std::uint8_t *bytes, int32_t length) const
calculate the turn signal status based on byte array.
Definition misc_69.cc:225
bool is_acc_decrement_following_gap_pressed(const std::uint8_t *bytes, int32_t length) const
check the acc decrement following gap pressed bit based on byte array.
Definition misc_69.cc:306
bool is_canbus_fault(const std::uint8_t *bytes, int32_t length) const
check the canbus fault bit based on byte array.
Definition misc_69.cc:318
bool is_driver_door_open(const std::uint8_t *bytes, int32_t length) const
check the driver door open bit based on byte array.
Definition misc_69.cc:323
int32_t ambient_light_status(const std::uint8_t *bytes, int32_t length) const
calculate the ambient light status based on byte array.
Definition misc_69.cc:245
bool is_driver_belt_buckled(const std::uint8_t *bytes, int32_t length) const
check the driver belt buckled bit based on byte array.
Definition misc_69.cc:369
bool is_acc_decrement_set_speed_pressed(const std::uint8_t *bytes, int32_t length) const
check the acc decrement set speed pressed bit based on byte array.
Definition misc_69.cc:294
bool is_trunk_open(const std::uint8_t *bytes, int32_t length) const
check the trunk open bit based on byte array.
Definition misc_69.cc:352
int32_t wiper_status(const std::uint8_t *bytes, int32_t length) const
calculate the wiper status based on byte array.
Definition misc_69.cc:239
int32_t high_beam_status(const std::uint8_t *bytes, int32_t length) const
calculate the high beam status based on byte array.
Definition misc_69.cc:232
bool is_passenger_door_open(const std::uint8_t *bytes, int32_t length) const
check the passenger door open bit based on byte array.
Definition misc_69.cc:329
bool is_acc_on_pressed(const std::uint8_t *bytes, int32_t length) const
check acc on pressed bit based on byte array.
Definition misc_69.cc:252
bool is_acc_increment_following_gap_pressed(const std::uint8_t *bytes, int32_t length) const
check the acc increment following gap pressed bit based on byte array.
Definition misc_69.cc:300
bool is_acc_on_or_off_pressed(const std::uint8_t *bytes, int32_t length) const
check acc on or off pressed bit based on byte array.
Definition misc_69.cc:276
bool is_acc_increment_set_speed_pressed(const std::uint8_t *bytes, int32_t length) const
check the acc increment set speed pressed bit based on byte array.
Definition misc_69.cc:288
bool is_rear_right_door_open(const std::uint8_t *bytes, int32_t length) const
check the rear right door open bit based on byte array.
Definition misc_69.cc:341
bool is_acc_resume_pressed(const std::uint8_t *bytes, int32_t length) const
check acc resume pressed bit based on byte array.
Definition misc_69.cc:264
bool is_passenger_detected(const std::uint8_t *bytes, int32_t length) const
check the passenger detected bit based on byte array.
Definition misc_69.cc:357

◆ turn_signal_status()

int32_t apollo::canbus::lincoln::Misc69::turn_signal_status ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate the turn signal status based on byte array.

config detail: {'name': 'trnstat', 'offset': 0.0, 'precision': 1.0, 'len': 2, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 0, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of turn signal status

在文件 misc_69.cc225 行定义.

226 {
227 Byte frame(bytes + 0);
228 int32_t x = frame.get_byte(0, 2);
229 return x;
230}

◆ wiper_status()

int32_t apollo::canbus::lincoln::Misc69::wiper_status ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate the wiper status based on byte array.

config detail: {'name': 'wiper', 'offset': 0.0, 'precision': 1.0, 'len': 4, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 4, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of wiper status

在文件 misc_69.cc239 行定义.

239 {
240 Byte frame(bytes + 0);
241 int32_t x = frame.get_byte(4, 4);
242 return x;
243}

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Misc69::ID = 0x69
static

在文件 misc_69.h43 行定义.


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