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

#include <steering_command_102.h>

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

Public 成员函数

 Steeringcommand102 ()
 
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
 
Steeringcommand102set_heartbeat_102 (int heartbeat_102)
 
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::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 = 0x102
 

额外继承的成员函数

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

详细描述

在文件 steering_command_102.h27 行定义.

构造及析构函数说明

◆ Steeringcommand102()

apollo::canbus::demo::Steeringcommand102::Steeringcommand102 ( )

在文件 steering_command_102.cc30 行定义.

成员函数说明

◆ GetPeriod()

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

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

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

在文件 steering_command_102.cc38 行定义.

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

◆ Reset()

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

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

在文件 steering_command_102.cc68 行定义.

68 {
69 // TODO(All) : you should check this manually
70 heartbeat_102_ = 0;
72 steer_angle_target_ = 0;
73 steer_angle_spd_target_ = 0;
74 checksum_102_ = 0;
75}

◆ set_checksum_102()

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

在文件 steering_command_102.cc160 行定义.

160 {
161 checksum_102_ = checksum_102;
162 return this;
163}

◆ set_heartbeat_102()

Steeringcommand102 * apollo::canbus::demo::Steeringcommand102::set_heartbeat_102 ( int  heartbeat_102)

在文件 steering_command_102.cc77 行定义.

77 {
78 heartbeat_102_ = heartbeat_102;
79 return this;
80}

◆ set_steer_angle_spd_target()

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

在文件 steering_command_102.cc140 行定义.

141 {
142 steer_angle_spd_target_ = steer_angle_spd_target;
143 return this;
144}

◆ set_steer_angle_target()

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

在文件 steering_command_102.cc113 行定义.

114 {
115 steer_angle_target_ = steer_angle_target;
116 return this;
117}

◆ set_steer_en_ctrl()

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

在文件 steering_command_102.cc93 行定义.

94 {
95 steer_en_ctrl_ = steer_en_ctrl;
96 return this;
97}

◆ UpdateData()

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

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

在文件 steering_command_102.cc62 行定义.

62 {
63 set_p_steer_en_ctrl(data, steer_en_ctrl_);
64 set_p_steer_angle_target(data, steer_angle_target_);
65 set_p_steer_angle_spd_target(data, steer_angle_spd_target_);
66}

◆ UpdateData_Heartbeat()

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

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

在文件 steering_command_102.cc52 行定义.

52 {
53 // TODO(All) : you should add the heartbeat manually
54 ++heartbeat_102_;
55 heartbeat_102_ = (heartbeat_102_) % 16;
56 set_p_heartbeat_102(data, heartbeat_102_);
57 checksum_102_ =
58 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
59 set_p_checksum_102(data, checksum_102_);
60}

类成员变量说明

◆ ID

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

在文件 steering_command_102.h30 行定义.


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