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

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

#include <gps_6f.h>

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

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
double altitude (const std::uint8_t *bytes, int32_t length) const
 get altitude from byte array config detail: {'name': 'altitude', 'offset': 0.0, 'precision': 0.25, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"m"'}
 
double heading (const std::uint8_t *bytes, int32_t length) const
 get heading from byte array config detail: {'name': 'heading', 'offset': 0.0, 'precision': 0.01, 'len': 16, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}
 
int32_t speed (const std::uint8_t *bytes, int32_t length) const
 get speed from byte array config detail: {'name': 'speed', 'offset': 0.0, 'precision': 1.0, 'len': 8, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 32, 'type': 'int', 'order': 'intel', 'physical_unit': '"mph"'}
 
double hdop (const std::uint8_t *bytes, int32_t length) const
 get hdop from byte array config detail: {'name': 'hdop', 'offset': 0.0, 'precision': 0.2, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 40, 'type': 'double', 'order': 'intel', 'physical_unit': '""'}
 
double vdop (const std::uint8_t *bytes, int32_t length) const
 get vdop from byte array config detail: {'name': 'vdop', 'offset': 0.0, 'precision': 0.2, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 48, 'type': 'double', 'order': 'intel', 'physical_unit': '""'}
 
int32_t fix_quality (const std::uint8_t *bytes, int32_t length) const
 get fix quality from byte array config detail: {'name': 'quality', 'offset': 0.0, 'precision': 1.0, 'len': 3, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 56, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}
 
int32_t num_satellites (const std::uint8_t *bytes, int32_t length) const
 get number of satellites from byte array config detail: {'name': 'numsat', 'offset': 0.0, 'precision': 1.0, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 59, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}
 
- 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 = 0x6F
 

额外继承的成员函数

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

在文件 gps_6f.h40 行定义.

成员函数说明

◆ altitude()

double apollo::canbus::lincoln::Gps6f::altitude ( const std::uint8_t *  bytes,
int32_t  length 
) const

get altitude from byte array config detail: {'name': 'altitude', 'offset': 0.0, 'precision': 0.25, 'len': 16, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"m"'}

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

在文件 gps_6f.cc56 行定义.

56 {
57 Byte high_frame(bytes + 1);
58 int32_t high = high_frame.get_byte(0, 8);
59 Byte low_frame(bytes + 0);
60 int32_t low = low_frame.get_byte(0, 8);
61 int32_t value = (high << 8) | low;
62 if (value > 0x7FFF) {
63 value -= 0x10000;
64 }
65 return value * 0.250000;
66}

◆ fix_quality()

int32_t apollo::canbus::lincoln::Gps6f::fix_quality ( const std::uint8_t *  bytes,
int32_t  length 
) const

get fix quality from byte array config detail: {'name': 'quality', 'offset': 0.0, 'precision': 1.0, 'len': 3, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 56, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of fix quality

在文件 gps_6f.cc95 行定义.

95 {
96 Byte frame(bytes + 7);
97 int32_t x = frame.get_byte(0, 3);
98 return x;
99}

◆ hdop()

double apollo::canbus::lincoln::Gps6f::hdop ( const std::uint8_t *  bytes,
int32_t  length 
) const

get hdop from byte array config detail: {'name': 'hdop', 'offset': 0.0, 'precision': 0.2, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 40, 'type': 'double', 'order': 'intel', 'physical_unit': '""'}

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

在文件 gps_6f.cc83 行定义.

83 {
84 Byte frame(bytes + 5);
85 int32_t x = frame.get_byte(0, 5);
86 return x * 0.200000;
87}

◆ heading()

double apollo::canbus::lincoln::Gps6f::heading ( const std::uint8_t *  bytes,
int32_t  length 
) const

get heading from byte array config detail: {'name': 'heading', 'offset': 0.0, 'precision': 0.01, 'len': 16, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}

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

在文件 gps_6f.cc68 行定义.

68 {
69 Byte high_frame(bytes + 3);
70 int32_t high = high_frame.get_byte(0, 8);
71 Byte low_frame(bytes + 2);
72 int32_t low = low_frame.get_byte(0, 8);
73 int32_t value = (high << 8) | low;
74 return value * 0.010000;
75}

◆ num_satellites()

int32_t apollo::canbus::lincoln::Gps6f::num_satellites ( const std::uint8_t *  bytes,
int32_t  length 
) const

get number of satellites from byte array config detail: {'name': 'numsat', 'offset': 0.0, 'precision': 1.0, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 59, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the number of satellites

在文件 gps_6f.cc101 行定义.

101 {
102 Byte frame(bytes + 7);
103 int32_t x = frame.get_byte(3, 5);
104 return x;
105}

◆ Parse()

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

在文件 gps_6f.cc29 行定义.

30 {
31 chassis_detail->mutable_basic()->set_altitude(altitude(bytes, length));
32 chassis_detail->mutable_basic()->set_heading(heading(bytes, length));
33 // speed mph -> mps
34 chassis_detail->mutable_basic()->set_gps_speed(speed(bytes, length) *
35 0.44704);
36 chassis_detail->mutable_basic()->set_hdop(hdop(bytes, length));
37 chassis_detail->mutable_basic()->set_vdop(vdop(bytes, length));
38 switch (fix_quality(bytes, length)) {
39 case 0:
40 chassis_detail->mutable_basic()->set_quality(FIX_NO);
41 break;
42 case 1:
43 chassis_detail->mutable_basic()->set_quality(FIX_2D);
44 break;
45 case 2:
46 chassis_detail->mutable_basic()->set_quality(FIX_3D);
47 break;
48 default:
49 chassis_detail->mutable_basic()->set_quality(FIX_INVALID);
50 break;
51 }
52 chassis_detail->mutable_basic()->set_num_satellites(
53 num_satellites(bytes, length));
54}
double vdop(const std::uint8_t *bytes, int32_t length) const
get vdop from byte array config detail: {'name': 'vdop', 'offset': 0.0, 'precision': 0....
Definition gps_6f.cc:89
int32_t num_satellites(const std::uint8_t *bytes, int32_t length) const
get number of satellites from byte array config detail: {'name': 'numsat', 'offset': 0....
Definition gps_6f.cc:101
int32_t speed(const std::uint8_t *bytes, int32_t length) const
get speed from byte array config detail: {'name': 'speed', 'offset': 0.0, 'precision': 1....
Definition gps_6f.cc:77
double hdop(const std::uint8_t *bytes, int32_t length) const
get hdop from byte array config detail: {'name': 'hdop', 'offset': 0.0, 'precision': 0....
Definition gps_6f.cc:83
int32_t fix_quality(const std::uint8_t *bytes, int32_t length) const
get fix quality from byte array config detail: {'name': 'quality', 'offset': 0.0, 'precision': 1....
Definition gps_6f.cc:95
double altitude(const std::uint8_t *bytes, int32_t length) const
get altitude from byte array config detail: {'name': 'altitude', 'offset': 0.0, 'precision': 0....
Definition gps_6f.cc:56
double heading(const std::uint8_t *bytes, int32_t length) const
get heading from byte array config detail: {'name': 'heading', 'offset': 0.0, 'precision': 0....
Definition gps_6f.cc:68

◆ speed()

int32_t apollo::canbus::lincoln::Gps6f::speed ( const std::uint8_t *  bytes,
int32_t  length 
) const

get speed from byte array config detail: {'name': 'speed', 'offset': 0.0, 'precision': 1.0, 'len': 8, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 32, 'type': 'int', 'order': 'intel', 'physical_unit': '"mph"'}

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

在文件 gps_6f.cc77 行定义.

77 {
78 Byte frame(bytes + 4);
79 int32_t x = frame.get_byte(0, 8);
80 return x;
81}

◆ vdop()

double apollo::canbus::lincoln::Gps6f::vdop ( const std::uint8_t *  bytes,
int32_t  length 
) const

get vdop from byte array config detail: {'name': 'vdop', 'offset': 0.0, 'precision': 0.2, 'len': 5, 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 48, 'type': 'double', 'order': 'intel', 'physical_unit': '""'}

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

在文件 gps_6f.cc89 行定义.

89 {
90 Byte frame(bytes + 6);
91 int32_t x = frame.get_byte(0, 5);
92 return x * 0.200000;
93}

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Gps6f::ID = 0x6F
static

在文件 gps_6f.h43 行定义.


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