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

#include <park_command_104.h>

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

Public 成员函数

 Parkcommand104 ()
 
uint32_t GetPeriod () const override
 
void Parse (const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
 
void UpdateData_Heartbeat (uint8_t *data) override
 
void UpdateData (uint8_t *data) override
 
void Reset () override
 
Parkcommand104set_heartbeat_104 (int heartbeat_104)
 
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::Demo >
 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::Demo *sensor_data) const
 

静态 Public 属性

static const int32_t ID = 0x104
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData<::apollo::canbus::Demo >
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.h27 行定义.

构造及析构函数说明

◆ Parkcommand104()

apollo::canbus::demo::Parkcommand104::Parkcommand104 ( )

在文件 park_command_104.cc30 行定义.

成员函数说明

◆ GetPeriod()

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

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

在文件 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::demo::Parkcommand104::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Demo chassis 
) const
override

在文件 park_command_104.cc38 行定义.

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

◆ Reset()

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

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

在文件 park_command_104.cc65 行定义.

65 {
66 // TODO(All) : you should check this manually
67 heartbeat_104_ = 0;
68 checksum_104_ = 0;
71}

◆ set_checksum_104()

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

在文件 park_command_104.cc89 行定义.

89 {
90 checksum_104_ = checksum_104;
91 return this;
92}

◆ set_heartbeat_104()

Parkcommand104 * apollo::canbus::demo::Parkcommand104::set_heartbeat_104 ( int  heartbeat_104)

在文件 park_command_104.cc73 行定义.

73 {
74 heartbeat_104_ = heartbeat_104;
75 return this;
76}

◆ set_park_en_ctrl()

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

在文件 park_command_104.cc124 行定义.

125 {
126 park_en_ctrl_ = park_en_ctrl;
127 return this;
128}

◆ set_park_target()

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

在文件 park_command_104.cc105 行定义.

106 {
107 park_target_ = park_target;
108 return this;
109}

◆ UpdateData()

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

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

在文件 park_command_104.cc60 行定义.

60 {
61 set_p_park_target(data, park_target_);
62 set_p_park_en_ctrl(data, park_en_ctrl_);
63}

◆ UpdateData_Heartbeat()

void apollo::canbus::demo::Parkcommand104::UpdateData_Heartbeat ( uint8_t *  data)
overridevirtual

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

在文件 park_command_104.cc50 行定义.

50 {
51 // TODO(All) : you should add the heartbeat manually
52 ++heartbeat_104_;
53 heartbeat_104_ = (heartbeat_104_) % 16;
54 set_p_heartbeat_104(data, heartbeat_104_);
55 checksum_104_ =
56 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
57 set_p_checksum_104(data, checksum_104_);
58}

类成员变量说明

◆ ID

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

在文件 park_command_104.h30 行定义.


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