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

#include <throttle_command_100.h>

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

Public 成员函数

 Throttlecommand100 ()
 
uint32_t GetPeriod () const override
 
void UpdateData (uint8_t *data) override
 
void Reset () override
 
void Parse (const std::uint8_t *bytes, int32_t length, Devkit *chassis) const override
 
Throttlecommand100set_throttle_en_ctrl (Throttle_command_100::Throttle_en_ctrlType throttle_en_ctrl)
 
Throttlecommand100set_throttle_acc (double throttle_acc)
 
Throttlecommand100set_throttle_pedal_target (double throttle_pedal_target)
 
Throttlecommand100set_speed_target (double speed_target)
 
Throttlecommand100set_checksum_100 (int checksum_100)
 
- 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 = 0x100
 

额外继承的成员函数

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

详细描述

在文件 throttle_command_100.h27 行定义.

构造及析构函数说明

◆ Throttlecommand100()

apollo::canbus::devkit::Throttlecommand100::Throttlecommand100 ( )

在文件 throttle_command_100.cc33 行定义.

成员函数说明

◆ GetPeriod()

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

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

在文件 throttle_command_100.cc35 行定义.

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

◆ Parse()

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

在文件 throttle_command_100.cc41 行定义.

42 {
43 chassis->mutable_throttle_command_100()->set_throttle_en_ctrl(
44 throttle_en_ctrl(bytes, length));
45 chassis->mutable_throttle_command_100()->set_throttle_acc(
46 throttle_acc(bytes, length));
47 chassis->mutable_throttle_command_100()->set_throttle_pedal_target(
48 throttle_pedal_target(bytes, length));
49 chassis->mutable_throttle_command_100()->set_speed_target(
50 speed_target(bytes, length));
51 chassis->mutable_throttle_command_100()->set_checksum_100(
52 checksum_100(bytes, length));
53}

◆ Reset()

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

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

在文件 throttle_command_100.cc65 行定义.

65 {
66 // TODO(All) : you should check this manually
68 throttle_acc_ = 0.0;
69 throttle_pedal_target_ = 0.0;
70 speed_target_ = 0.0;
71 checksum_100_ = 0;
72}

◆ set_checksum_100()

Throttlecommand100 * apollo::canbus::devkit::Throttlecommand100::set_checksum_100 ( int  checksum_100)

在文件 throttle_command_100.cc167 行定义.

167 {
168 checksum_100_ = checksum_100;
169 return this;
170}

◆ set_speed_target()

Throttlecommand100 * apollo::canbus::devkit::Throttlecommand100::set_speed_target ( double  speed_target)

在文件 throttle_command_100.cc143 行定义.

143 {
144 speed_target_ = speed_target;
145 return this;
146}

◆ set_throttle_acc()

Throttlecommand100 * apollo::canbus::devkit::Throttlecommand100::set_throttle_acc ( double  throttle_acc)

在文件 throttle_command_100.cc93 行定义.

93 {
94 throttle_acc_ = throttle_acc;
95 return this;
96}

◆ set_throttle_en_ctrl()

Throttlecommand100 * apollo::canbus::devkit::Throttlecommand100::set_throttle_en_ctrl ( Throttle_command_100::Throttle_en_ctrlType  throttle_en_ctrl)

在文件 throttle_command_100.cc74 行定义.

75 {
76 throttle_en_ctrl_ = throttle_en_ctrl;
77 return this;
78}

◆ set_throttle_pedal_target()

Throttlecommand100 * apollo::canbus::devkit::Throttlecommand100::set_throttle_pedal_target ( double  throttle_pedal_target)

在文件 throttle_command_100.cc117 行定义.

118 {
119 throttle_pedal_target_ = throttle_pedal_target;
120 return this;
121}

◆ UpdateData()

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

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

在文件 throttle_command_100.cc55 行定义.

55 {
56 set_p_speed_target(data, speed_target_);
57 set_p_throttle_acc(data, throttle_acc_);
58 set_p_throttle_pedal_target(data, throttle_pedal_target_);
59 set_p_throttle_en_ctrl(data, throttle_en_ctrl_);
60 checksum_100_ =
61 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
62 set_p_checksum_100(data, checksum_100_);
63}

类成员变量说明

◆ ID

const int32_t apollo::canbus::devkit::Throttlecommand100::ID = 0x100
static

在文件 throttle_command_100.h30 行定义.


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