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

#include <gear_command_103.h>

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

Public 成员函数

 Gearcommand103 ()
 
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
 
Gearcommand103set_gear_target (Gear_command_103::Gear_targetType gear_target)
 
Gearcommand103set_gear_en_ctrl (Gear_command_103::Gear_en_ctrlType gear_en_ctrl)
 
Gearcommand103set_checksum_103 (int checksum_103)
 
- 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 = 0x103
 

额外继承的成员函数

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

详细描述

在文件 gear_command_103.h27 行定义.

构造及析构函数说明

◆ Gearcommand103()

apollo::canbus::devkit::Gearcommand103::Gearcommand103 ( )

在文件 gear_command_103.cc30 行定义.

成员函数说明

◆ GetPeriod()

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

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

在文件 gear_command_103.cc42 行定义.

42 {
43 // TODO(All) : modify every protocol's period manually
44 static const uint32_t PERIOD = 20 * 1000;
45 return PERIOD;
46}

◆ Parse()

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

在文件 gear_command_103.cc32 行定义.

33 {
34 chassis->mutable_gear_command_103()->set_gear_target(
35 gear_target(bytes, length));
36 chassis->mutable_gear_command_103()->set_gear_en_ctrl(
37 gear_en_ctrl(bytes, length));
38 chassis->mutable_gear_command_103()->set_checksum_103(
39 checksum_103(bytes, length));
40}

◆ Reset()

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

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

在文件 gear_command_103.cc56 行定义.

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

◆ set_checksum_103()

Gearcommand103 * apollo::canbus::devkit::Gearcommand103::set_checksum_103 ( int  checksum_103)

在文件 gear_command_103.cc100 行定义.

100 {
101 checksum_103_ = checksum_103;
102 return this;
103}

◆ set_gear_en_ctrl()

Gearcommand103 * apollo::canbus::devkit::Gearcommand103::set_gear_en_ctrl ( Gear_command_103::Gear_en_ctrlType  gear_en_ctrl)

在文件 gear_command_103.cc82 行定义.

83 {
84 gear_en_ctrl_ = gear_en_ctrl;
85 return this;
86}

◆ set_gear_target()

Gearcommand103 * apollo::canbus::devkit::Gearcommand103::set_gear_target ( Gear_command_103::Gear_targetType  gear_target)

在文件 gear_command_103.cc63 行定义.

64 {
65 gear_target_ = gear_target;
66 return this;
67}

◆ UpdateData()

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

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

在文件 gear_command_103.cc48 行定义.

48 {
49 set_p_gear_target(data, gear_target_);
50 set_p_gear_en_ctrl(data, gear_en_ctrl_);
51 checksum_103_ =
52 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
53 set_p_checksum_103(data, checksum_103_);
54}

类成员变量说明

◆ ID

const int32_t apollo::canbus::devkit::Gearcommand103::ID = 0x103
static

在文件 gear_command_103.h30 行定义.


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