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

#include <ads_eps_command_56.h>

类 apollo::canbus::neolix_edu::Adsepscommand56 继承关系图:
apollo::canbus::neolix_edu::Adsepscommand56 的协作图:

Public 成员函数

 Adsepscommand56 ()
 
uint32_t GetPeriod () const override
 
void Parse (const std::uint8_t *bytes, int32_t length, Neolix_edu *chassis) const override
 
void UpdateData (uint8_t *data) override
 
void Reset () override
 
Adsepscommand56set_drive_enable (bool drive_enable)
 
Adsepscommand56set_auto_target_angle (double auto_target_angle)
 
Adsepscommand56set_auto_drivercmd_alivecounter (int auto_drivercmd_alivecounter)
 
Adsepscommand56set_auto_drivercmd_checksum (int auto_drivercmd_checksum)
 
- Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Neolix_edu >
 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::Neolix_edu *sensor_data) const
 
virtual void UpdateData_Heartbeat (uint8_t *data)
 

静态 Public 属性

static const int32_t ID = 0x56
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Neolix_edu >
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)
 

详细描述

在文件 ads_eps_command_56.h27 行定义.

构造及析构函数说明

◆ Adsepscommand56()

apollo::canbus::neolix_edu::Adsepscommand56::Adsepscommand56 ( )

在文件 ads_eps_command_56.cc30 行定义.

成员函数说明

◆ GetPeriod()

uint32_t apollo::canbus::neolix_edu::Adsepscommand56::GetPeriod ( ) const
overridevirtual

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

在文件 ads_eps_command_56.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::neolix_edu::Adsepscommand56::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Neolix_edu chassis 
) const
override

在文件 ads_eps_command_56.cc38 行定义.

39 {
40 chassis->mutable_ads_eps_command_56()->set_drive_enable(
41 drive_enable(bytes, length));
42 chassis->mutable_ads_eps_command_56()->set_auto_target_angle(
43 auto_target_angle(bytes, length));
44}

◆ Reset()

void apollo::canbus::neolix_edu::Adsepscommand56::Reset ( )
overridevirtual

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

在文件 ads_eps_command_56.cc57 行定义.

57 {
58 // TODO(All) : you should check this manually
59 drive_enable_ = false;
60 auto_target_angle_ = 0.0;
61 auto_drivercmd_alivecounter_ = 0;
62 auto_drivercmd_checksum_ = 0;
63}

◆ set_auto_drivercmd_alivecounter()

Adsepscommand56 * apollo::canbus::neolix_edu::Adsepscommand56::set_auto_drivercmd_alivecounter ( int  auto_drivercmd_alivecounter)

在文件 ads_eps_command_56.cc130 行定义.

131 {
132 auto_drivercmd_alivecounter_ = auto_drivercmd_alivecounter;
133 return this;
134}

◆ set_auto_drivercmd_checksum()

Adsepscommand56 * apollo::canbus::neolix_edu::Adsepscommand56::set_auto_drivercmd_checksum ( int  auto_drivercmd_checksum)

在文件 ads_eps_command_56.cc149 行定义.

150 {
151 auto_drivercmd_checksum_ = auto_drivercmd_checksum;
152 return this;
153}

◆ set_auto_target_angle()

Adsepscommand56 * apollo::canbus::neolix_edu::Adsepscommand56::set_auto_target_angle ( double  auto_target_angle)

在文件 ads_eps_command_56.cc90 行定义.

91 {
92 auto_target_angle_ = -auto_target_angle;
93 return this;
94}

◆ set_drive_enable()

Adsepscommand56 * apollo::canbus::neolix_edu::Adsepscommand56::set_drive_enable ( bool  drive_enable)

在文件 ads_eps_command_56.cc65 行定义.

65 {
66 drive_enable_ = drive_enable;
67 return this;
68}

◆ UpdateData()

void apollo::canbus::neolix_edu::Adsepscommand56::UpdateData ( uint8_t *  data)
overridevirtual

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

在文件 ads_eps_command_56.cc46 行定义.

46 {
47 set_p_drive_enable(data, drive_enable_);
48 set_p_auto_target_angle(data, auto_target_angle_);
49 ++auto_drivercmd_alivecounter_;
50 auto_drivercmd_alivecounter_ = (auto_drivercmd_alivecounter_) % 16;
51 set_p_auto_drivercmd_alivecounter(data, auto_drivercmd_alivecounter_);
52 auto_drivercmd_checksum_ =
53 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
54 set_p_auto_drivercmd_checksum(data, auto_drivercmd_checksum_);
55}

类成员变量说明

◆ ID

const int32_t apollo::canbus::neolix_edu::Adsepscommand56::ID = 0x56
static

在文件 ads_eps_command_56.h30 行定义.


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