Apollo 10.0
自动驾驶开放平台
ProtocolAsensing类 参考

#include <protocol_asensing.h>

类 ProtocolAsensing 继承关系图:
ProtocolAsensing 的协作图:

Public 成员函数

 ProtocolAsensing ()
 
virtual ~ProtocolAsensing ()
 
virtual void subData (const uint8_t *sub_address, int &index)
 
void addData (const std::string &data)
 
void clearCache ()
 
bool registProtocol (const std::string &protocolFlag, int length, ProtocolAsensing *sub)
 
void toQuaternion (double *rpy, double *quaterArray)
 
int getLength (const std::string &flag)
 
uint32_t getDataSize ()
 
void changeLength (const std::string &flag, int len)
 
std::string getProtocol ()
 

详细描述

在文件 protocol_asensing.h82 行定义.

构造及析构函数说明

◆ ProtocolAsensing()

ProtocolAsensing::ProtocolAsensing ( )

在文件 protocol_asensing.cc68 行定义.

68{}

◆ ~ProtocolAsensing()

ProtocolAsensing::~ProtocolAsensing ( )
virtual

在文件 protocol_asensing.cc70 行定义.

70{}

成员函数说明

◆ addData()

void ProtocolAsensing::addData ( const std::string &  data)

在文件 protocol_asensing.cc72 行定义.

72{ analysisData(data); }

◆ changeLength()

void ProtocolAsensing::changeLength ( const std::string &  flag,
int  len 
)
inline

在文件 protocol_asensing.h103 行定义.

103 {
104 protocolLengthMap[flag] = len;
105 }

◆ clearCache()

void ProtocolAsensing::clearCache ( )

在文件 protocol_asensing.cc74 行定义.

74 {
75 receive_data_.erase(receive_data_.begin(), receive_data_.end());
76}

◆ getDataSize()

uint32_t ProtocolAsensing::getDataSize ( )
inline

在文件 protocol_asensing.h102 行定义.

102{ return receive_data_.size(); }

◆ getLength()

int ProtocolAsensing::getLength ( const std::string &  flag)
inline

在文件 protocol_asensing.h99 行定义.

99 {
100 return protocolLengthMap[flag];
101 }

◆ getProtocol()

std::string ProtocolAsensing::getProtocol ( )
inline

在文件 protocol_asensing.h107 行定义.

107{ return cur_protocol_; }

◆ registProtocol()

bool ProtocolAsensing::registProtocol ( const std::string &  protocolFlag,
int  length,
ProtocolAsensing sub 
)

在文件 protocol_asensing.cc146 行定义.

147 {
148 protocolLengthMap.insert(std::pair<std::string, int>(protocolFlag, length));
149 protocolMap.insert(
150 std::pair<std::string, ProtocolAsensing*>(protocolFlag, sub));
151 // TinyLog::info("regist protocol:%s length: %d\n" , protocolFlag.c_str() ,
152 // length);
153 return true;
154}

◆ subData()

virtual void ProtocolAsensing::subData ( const uint8_t *  sub_address,
int &  index 
)
inlinevirtual

Decode_0A , 以及 Decode_0B 重载.

在文件 protocol_asensing.h88 行定义.

88 {
89 printf("get protocol type:%02X %02X %02X \n", sub_address[index],
90 sub_address[index + 1], sub_address[index + 2]);
91 }

◆ toQuaternion()

void ProtocolAsensing::toQuaternion ( double *  rpy,
double *  quaterArray 
)

在文件 protocol_asensing.cc155 行定义.

155 {
156 double halfYaw = rpy[2] * 0.5;
157 double halfPitch = rpy[1] * 0.5;
158 double halfRoll = rpy[0] * 0.5;
159 double cosYaw = std::cos(halfYaw);
160 double sinYaw = std::sin(halfYaw);
161 double cosPitch = std::cos(halfPitch);
162 double sinPitch = std::sin(halfPitch);
163 double cosRoll = std::cos(halfRoll);
164 double sinRoll = std::sin(halfRoll);
165
166 quaterArray[0] = sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw;
167 quaterArray[1] = cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw;
168 quaterArray[2] = cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw;
169 quaterArray[3] = cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw;
170}

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