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

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

#include <gps_6d.h>

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

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
double latitude (const std::uint8_t *bytes, int32_t length) const
 get latitude from byte array config detail: {'name': 'latitude', 'offset': 0.0, 'precision': 3.3333333e-07, 'len': 31, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}
 
double longitude (const std::uint8_t *bytes, int32_t length) const
 get longitude from byte array config detail: {'name': 'longitude', 'offset': 0.0, 'precision': 3.3333333e-07, 'len': 31, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 32, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}
 
bool is_valid (const std::uint8_t *bytes, int32_t length) const
 check is_valid from byte array config detail: {'name': 'valid', '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': '""'}
 
- 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 = 0x6D
 

额外继承的成员函数

- 静态 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_6d.h40 行定义.

成员函数说明

◆ is_valid()

bool apollo::canbus::lincoln::Gps6d::is_valid ( const std::uint8_t *  bytes,
int32_t  length 
) const

check is_valid from byte array config detail: {'name': 'valid', '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 is_valid bit

在文件 gps_6d.cc88 行定义.

88 {
89 Byte frame(bytes + 7);
90 return frame.is_bit_1(7);
91}

◆ latitude()

double apollo::canbus::lincoln::Gps6d::latitude ( const std::uint8_t *  bytes,
int32_t  length 
) const

get latitude from byte array config detail: {'name': 'latitude', 'offset': 0.0, 'precision': 3.3333333e-07, 'len': 31, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 0, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}

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

在文件 gps_6d.cc36 行定义.

36 {
37 Byte frame_0(bytes + 3);
38 int32_t value = frame_0.get_byte(0, 7);
39
40 Byte frame_1(bytes + 2);
41 int32_t t = frame_1.get_byte(0, 8);
42 value <<= 8;
43 value |= t;
44
45 Byte frame_2(bytes + 1);
46 t = frame_2.get_byte(0, 8);
47 value <<= 8;
48 value |= t;
49
50 Byte frame_3(bytes);
51 t = frame_3.get_byte(0, 8);
52 value <<= 8;
53 value |= t;
54
55 if (value > 0x3FFFFFFF) {
56 value -= 0x80000000;
57 }
58
59 return value * (1.000000 / 3.000000) * 1e-6;
60}

◆ longitude()

double apollo::canbus::lincoln::Gps6d::longitude ( const std::uint8_t *  bytes,
int32_t  length 
) const

get longitude from byte array config detail: {'name': 'longitude', 'offset': 0.0, 'precision': 3.3333333e-07, 'len': 31, 'f_type': 'value', 'is_signed_var': True, 'physical_range': '[0|0]', 'bit': 32, 'type': 'double', 'order': 'intel', 'physical_unit': '"degrees"'}

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

在文件 gps_6d.cc62 行定义.

62 {
63 Byte frame_0(bytes + 7);
64 int32_t value = frame_0.get_byte(0, 7);
65
66 Byte frame_1(bytes + 6);
67 int32_t t = frame_1.get_byte(0, 8);
68 value <<= 8;
69 value |= t;
70
71 Byte frame_2(bytes + 5);
72 t = frame_2.get_byte(0, 8);
73 value <<= 8;
74 value |= t;
75
76 Byte frame_3(bytes + 4);
77 t = frame_3.get_byte(0, 8);
78 value <<= 8;
79 value |= t;
80
81 if (value > 0x3FFFFFFF) {
82 value -= 0x80000000;
83 }
84
85 return value * (1.000000 / 3.000000) * 1e-6;
86}

◆ Parse()

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

在文件 gps_6d.cc29 行定义.

30 {
31 chassis_detail->mutable_basic()->set_latitude(latitude(bytes, length));
32 chassis_detail->mutable_basic()->set_longitude(longitude(bytes, length));
33 chassis_detail->mutable_basic()->set_gps_valid(is_valid(bytes, length));
34}
double longitude(const std::uint8_t *bytes, int32_t length) const
get longitude from byte array config detail: {'name': 'longitude', 'offset': 0.0, 'precision': 3....
Definition gps_6d.cc:62
double latitude(const std::uint8_t *bytes, int32_t length) const
get latitude from byte array config detail: {'name': 'latitude', 'offset': 0.0, 'precision': 3....
Definition gps_6d.cc:36
bool is_valid(const std::uint8_t *bytes, int32_t length) const
check is_valid from byte array config detail: {'name': 'valid', 'offset': 0.0, 'precision': 1....
Definition gps_6d.cc:88

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Gps6d::ID = 0x6D
static

在文件 gps_6d.h43 行定义.


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