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

#include <park_command_104.h>

类 apollo::canbus::devkit::Parkcommand104 继承关系图:
apollo::canbus::devkit::Parkcommand104 的协作图:

Public 成员函数

 Parkcommand104 ()
 
uint32_t GetPeriod () const override
 
void Parse (const std::uint8_t *bytes, int32_t length, Devkit *chassis) const override
 
void UpdateData (uint8_t *data) override
 
void Reset () override
 
Parkcommand104set_checksum_104 (int checksum_104)
 
Parkcommand104set_park_target (Park_command_104::Park_targetType park_target)
 
Parkcommand104set_park_en_ctrl (Park_command_104::Park_en_ctrlType park_en_ctrl)
 
- Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Devkit >
 ProtocolData ()=default
 construct protocol data.
 
virtual ~ProtocolData ()=default
 destruct protocol data.
 
virtual int32_t GetLength () const
 
virtual void Parse (const uint8_t *bytes, int32_t length, ::apollo::canbus::Devkit *sensor_data) const
 
virtual void UpdateData_Heartbeat (uint8_t *data)
 

静态 Public 属性

static const int32_t ID = 0x104
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Devkit >
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)
 

详细描述

在文件 park_command_104.h26 行定义.

构造及析构函数说明

◆ Parkcommand104()

apollo::canbus::devkit::Parkcommand104::Parkcommand104 ( )

在文件 park_command_104.cc30 行定义.

成员函数说明

◆ GetPeriod()

uint32_t apollo::canbus::devkit::Parkcommand104::GetPeriod ( ) const
overridevirtual

重载 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Devkit > .

在文件 park_command_104.cc32 行定义.

32 {
33 // TODO(All) : modify every protocol's period manually
34 static const uint32_t PERIOD = 20 * 1000;
35 return PERIOD;
36}

◆ Parse()

void apollo::canbus::devkit::Parkcommand104::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Devkit chassis 
) const
override

在文件 park_command_104.cc38 行定义.

39 {
40 chassis->mutable_park_command_104()->set_park_target(
41 park_target(bytes, length));
42 chassis->mutable_park_command_104()->set_park_en_ctrl(
43 park_en_ctrl(bytes, length));
44 chassis->mutable_park_command_104()->set_checksum_104(
45 checksum_104(bytes, length));
46}

◆ Reset()

void apollo::canbus::devkit::Parkcommand104::Reset ( )
overridevirtual

重载 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Devkit > .

在文件 park_command_104.cc56 行定义.

56 {
57 // TODO(All) : you should check this manually
58 checksum_104_ = 0;
61}

◆ set_checksum_104()

Parkcommand104 * apollo::canbus::devkit::Parkcommand104::set_checksum_104 ( int  checksum_104)

在文件 park_command_104.cc63 行定义.

63 {
64 checksum_104_ = checksum_104;
65 return this;
66}

◆ set_park_en_ctrl()

Parkcommand104 * apollo::canbus::devkit::Parkcommand104::set_park_en_ctrl ( Park_command_104::Park_en_ctrlType  park_en_ctrl)

在文件 park_command_104.cc97 行定义.

98 {
99 park_en_ctrl_ = park_en_ctrl;
100 return this;
101}

◆ set_park_target()

Parkcommand104 * apollo::canbus::devkit::Parkcommand104::set_park_target ( Park_command_104::Park_targetType  park_target)

在文件 park_command_104.cc79 行定义.

80 {
81 park_target_ = park_target;
82 return this;
83}

◆ UpdateData()

void apollo::canbus::devkit::Parkcommand104::UpdateData ( uint8_t *  data)
overridevirtual

重载 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Devkit > .

在文件 park_command_104.cc48 行定义.

48 {
49 set_p_park_target(data, park_target_);
50 set_p_park_en_ctrl(data, park_en_ctrl_);
51 checksum_104_ =
52 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
53 set_p_checksum_104(data, checksum_104_);
54}

类成员变量说明

◆ ID

const int32_t apollo::canbus::devkit::Parkcommand104::ID = 0x104
static

在文件 park_command_104.h29 行定义.


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