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

#include <ads_brake_command_46.h>

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

Public 成员函数

 Adsbrakecommand46 ()
 
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
 
Adsbrakecommand46set_drive_enable (bool drive_enable)
 
Adsbrakecommand46set_auto_brake_command (int auto_brake_command)
 
Adsbrakecommand46set_auto_parking_command (bool auto_parking_command)
 
Adsbrakecommand46set_epb_rampauxiliarycommand (bool epb_rampauxiliarycommand)
 
Adsbrakecommand46set_auto_drivercmd_alivecounter (int auto_drivercmd_alivecounter)
 
Adsbrakecommand46set_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 = 0x46
 

额外继承的成员函数

- 静态 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_brake_command_46.h27 行定义.

构造及析构函数说明

◆ Adsbrakecommand46()

apollo::canbus::neolix_edu::Adsbrakecommand46::Adsbrakecommand46 ( )

成员函数说明

◆ GetPeriod()

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

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

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

在文件 ads_brake_command_46.cc38 行定义.

39 {
40 chassis->mutable_ads_brake_command_46()->set_drive_enable(
41 drive_enable(bytes, length));
42 chassis->mutable_ads_brake_command_46()->set_auto_brake_command(
43 auto_brake_command(bytes, length));
44 chassis->mutable_ads_brake_command_46()->set_auto_parking_command(
45 auto_parking_command(bytes, length));
46}

◆ Reset()

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

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

在文件 ads_brake_command_46.cc61 行定义.

61 {
62 // TODO(All) : you should check this manually
63 drive_enable_ = false;
64 auto_brake_command_ = 0;
65 auto_parking_command_ = false;
66 epb_rampauxiliarycommand_ = false;
67 auto_drivercmd_alivecounter_ = 0;
68 auto_drivercmd_checksum_ = 0;
69}

◆ set_auto_brake_command()

Adsbrakecommand46 * apollo::canbus::neolix_edu::Adsbrakecommand46::set_auto_brake_command ( int  auto_brake_command)

在文件 ads_brake_command_46.cc96 行定义.

97 {
98 auto_brake_command_ = auto_brake_command;
99 return this;
100}

◆ set_auto_drivercmd_alivecounter()

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

在文件 ads_brake_command_46.cc168 行定义.

169 {
170 auto_drivercmd_alivecounter_ = auto_drivercmd_alivecounter;
171 return this;
172}

◆ set_auto_drivercmd_checksum()

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

在文件 ads_brake_command_46.cc187 行定义.

188 {
189 auto_drivercmd_checksum_ = auto_drivercmd_checksum;
190 return this;
191}

◆ set_auto_parking_command()

Adsbrakecommand46 * apollo::canbus::neolix_edu::Adsbrakecommand46::set_auto_parking_command ( bool  auto_parking_command)

在文件 ads_brake_command_46.cc123 行定义.

124 {
125 auto_parking_command_ = auto_parking_command;
126 return this;
127}

◆ set_drive_enable()

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

在文件 ads_brake_command_46.cc71 行定义.

71 {
72 drive_enable_ = drive_enable;
73 return this;
74}

◆ set_epb_rampauxiliarycommand()

Adsbrakecommand46 * apollo::canbus::neolix_edu::Adsbrakecommand46::set_epb_rampauxiliarycommand ( bool  epb_rampauxiliarycommand)

在文件 ads_brake_command_46.cc150 行定义.

151 {
152 epb_rampauxiliarycommand_ = epb_rampauxiliarycommand;
153 return this;
154}

◆ UpdateData()

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

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

在文件 ads_brake_command_46.cc48 行定义.

48 {
49 set_p_drive_enable(data, drive_enable_);
50 set_p_auto_brake_command(data, auto_brake_command_);
51 set_p_auto_parking_command(data, auto_parking_command_);
52 set_p_epb_rampauxiliarycommand(data, epb_rampauxiliarycommand_);
53 ++auto_drivercmd_alivecounter_;
54 auto_drivercmd_alivecounter_ = (auto_drivercmd_alivecounter_) % 16;
55 set_p_auto_drivercmd_alivecounter(data, auto_drivercmd_alivecounter_);
56 auto_drivercmd_checksum_ =
57 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
58 set_p_auto_drivercmd_checksum(data, auto_drivercmd_checksum_);
59}

类成员变量说明

◆ ID

const int32_t apollo::canbus::neolix_edu::Adsbrakecommand46::ID = 0x46
static

在文件 ads_brake_command_46.h30 行定义.


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