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

#include <steering_command_102.h>

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

Public 成员函数

 Steeringcommand102 ()
 
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
 
Steeringcommand102set_steer_en_ctrl (Steering_command_102::Steer_en_ctrlType steer_en_ctrl)
 
Steeringcommand102set_steer_angle_target (int steer_angle_target)
 
Steeringcommand102set_steer_angle_spd_target (int steer_angle_spd_target)
 
Steeringcommand102set_checksum_102 (int checksum_102)
 
- 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 = 0x102
 

额外继承的成员函数

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

详细描述

在文件 steering_command_102.h27 行定义.

构造及析构函数说明

◆ Steeringcommand102()

apollo::canbus::devkit::Steeringcommand102::Steeringcommand102 ( )

在文件 steering_command_102.cc30 行定义.

成员函数说明

◆ GetPeriod()

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

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

在文件 steering_command_102.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::Steeringcommand102::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Devkit chassis 
) const
override

在文件 steering_command_102.cc38 行定义.

39 {
40 chassis->mutable_steering_command_102()->set_steer_en_ctrl(
41 steer_en_ctrl(bytes, length));
42 chassis->mutable_steering_command_102() ->set_steer_angle_target(
43 steer_angle_target(bytes, length));
44 chassis->mutable_steering_command_102()->set_steer_angle_spd_target(
45 steer_angle_spd_target(bytes, length));
46 chassis->mutable_steering_command_102()->set_checksum_102(
47 checksum_102(bytes, length));
48}

◆ Reset()

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

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

在文件 steering_command_102.cc59 行定义.

59 {
60 // TODO(All) : you should check this manually
62 steer_angle_target_ = 0;
63 steer_angle_spd_target_ = 0;
64 checksum_102_ = 0;
65}

◆ set_checksum_102()

Steeringcommand102 * apollo::canbus::devkit::Steeringcommand102::set_checksum_102 ( int  checksum_102)

在文件 steering_command_102.cc132 行定义.

132 {
133 checksum_102_ = checksum_102;
134 return this;
135}

◆ set_steer_angle_spd_target()

Steeringcommand102 * apollo::canbus::devkit::Steeringcommand102::set_steer_angle_spd_target ( int  steer_angle_spd_target)

在文件 steering_command_102.cc112 行定义.

113 {
114 steer_angle_spd_target_ = steer_angle_spd_target;
115 return this;
116}

◆ set_steer_angle_target()

Steeringcommand102 * apollo::canbus::devkit::Steeringcommand102::set_steer_angle_target ( int  steer_angle_target)

在文件 steering_command_102.cc85 行定义.

86 {
87 steer_angle_target_ = steer_angle_target;
88 return this;
89}

◆ set_steer_en_ctrl()

Steeringcommand102 * apollo::canbus::devkit::Steeringcommand102::set_steer_en_ctrl ( Steering_command_102::Steer_en_ctrlType  steer_en_ctrl)

在文件 steering_command_102.cc67 行定义.

68 {
69 steer_en_ctrl_ = steer_en_ctrl;
70 return this;
71}

◆ UpdateData()

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

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

在文件 steering_command_102.cc50 行定义.

50 {
51 set_p_steer_en_ctrl(data, steer_en_ctrl_);
52 set_p_steer_angle_target(data, steer_angle_target_);
53 set_p_steer_angle_spd_target(data, steer_angle_spd_target_);
54 checksum_102_ =
55 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
56 set_p_checksum_102(data, checksum_102_);
57}

类成员变量说明

◆ ID

const int32_t apollo::canbus::devkit::Steeringcommand102::ID = 0x102
static

在文件 steering_command_102.h30 行定义.


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