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

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

#include <gyro_6c.h>

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

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
double roll_rate (const std::uint8_t *bytes, int32_t length) const
 calculate the roll rate based on byte array.
 
double yaw_rate (const std::uint8_t *bytes, int32_t length) const
 calculate longitudinal_acceleration 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 = 0x6C
 

额外继承的成员函数

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

在文件 gyro_6c.h40 行定义.

成员函数说明

◆ Parse()

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

在文件 gyro_6c.cc29 行定义.

30 {
31 chassis_detail->mutable_vehicle_spd()->set_roll_rate(
32 roll_rate(bytes, length));
33 chassis_detail->mutable_vehicle_spd()->set_yaw_rate(yaw_rate(bytes, length));
34 // why
35 chassis_detail->mutable_vehicle_spd()->set_is_yaw_rate_valid(true);
36}
double roll_rate(const std::uint8_t *bytes, int32_t length) const
calculate the roll rate based on byte array.
Definition gyro_6c.cc:38
double yaw_rate(const std::uint8_t *bytes, int32_t length) const
calculate longitudinal_acceleration based on byte array.
Definition gyro_6c.cc:50

◆ roll_rate()

double apollo::canbus::lincoln::Gyro6c::roll_rate ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate the roll rate based on byte array.

config detail: {'name': 'roll', 'offset': 0.0, 'precision': 0.0002, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"rad/s"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of roll rate

在文件 gyro_6c.cc38 行定义.

38 {
39 Byte high_frame(bytes + 1);
40 int32_t high = high_frame.get_byte(0, 8);
41 Byte low_frame(bytes + 0);
42 int32_t low = low_frame.get_byte(0, 8);
43 int32_t value = (high << 8) | low;
44 if (value > 0x7FFF) {
45 value -= 0x10000;
46 }
47 return value * 0.000200;
48}

◆ yaw_rate()

double apollo::canbus::lincoln::Gyro6c::yaw_rate ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate longitudinal_acceleration based on byte array.

config detail: {'name': 'yaw', 'offset': 0.0, 'precision': 0.0002, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': '"rad/s"'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of yaw rate

在文件 gyro_6c.cc50 行定义.

50 {
51 Byte high_frame(bytes + 3);
52 int32_t high = high_frame.get_byte(0, 8);
53 Byte low_frame(bytes + 2);
54 int32_t low = low_frame.get_byte(0, 8);
55 int32_t value = (high << 8) | low;
56 if (value > 0x7FFF) {
57 value -= 0x10000;
58 }
59 return value * 0.000200;
60}

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Gyro6c::ID = 0x6C
static

在文件 gyro_6c.h43 行定义.


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