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

#include <ads_light_horn_command_310.h>

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

Public 成员函数

 Adslighthorncommand310 ()
 
uint32_t GetPeriod () const override
 
void UpdateData (uint8_t *data) override
 
void Reset () override
 
Adslighthorncommand310set_turn_right_light_command (bool turn_right_light_command)
 
Adslighthorncommand310set_turn_left_light_command (bool turn_left_light_command)
 
Adslighthorncommand310set_horn_command (bool horn_command)
 
Adslighthorncommand310set_beam_command (int beam_command)
 
Adslighthorncommand310set_auto_drivercmd_alivecounter (int auto_drivercmd_alivecounter)
 
Adslighthorncommand310set_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 = 0x310
 

额外继承的成员函数

- 静态 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_light_horn_command_310.h26 行定义.

构造及析构函数说明

◆ Adslighthorncommand310()

apollo::canbus::neolix_edu::Adslighthorncommand310::Adslighthorncommand310 ( )

成员函数说明

◆ GetPeriod()

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

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

在文件 ads_light_horn_command_310.cc32 行定义.

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

◆ Reset()

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

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

在文件 ads_light_horn_command_310.cc51 行定义.

51 {
52 // TODO(All) : you should check this manually
53 turn_right_light_command_ = false;
54 turn_left_light_command_ = false;
55 horn_command_ = false;
56 beam_command_ = 0;
57 auto_drivercmd_alivecounter_ = 0;
58 auto_drivercmd_checksum_ = 0;
59}

◆ set_auto_drivercmd_alivecounter()

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

在文件 ads_light_horn_command_310.cc133 行定义.

134 {
135 auto_drivercmd_alivecounter_ = auto_drivercmd_alivecounter;
136 return this;
137}

◆ set_auto_drivercmd_checksum()

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

在文件 ads_light_horn_command_310.cc152 行定义.

153 {
154 auto_drivercmd_checksum_ = auto_drivercmd_checksum;
155 return this;
156}

◆ set_beam_command()

Adslighthorncommand310 * apollo::canbus::neolix_edu::Adslighthorncommand310::set_beam_command ( int  beam_command)

在文件 ads_light_horn_command_310.cc114 行定义.

115 {
116 beam_command_ = beam_command;
117 return this;
118}

◆ set_horn_command()

Adslighthorncommand310 * apollo::canbus::neolix_edu::Adslighthorncommand310::set_horn_command ( bool  horn_command)

在文件 ads_light_horn_command_310.cc97 行定义.

98 {
99 horn_command_ = horn_command;
100 return this;
101}

◆ set_turn_left_light_command()

Adslighthorncommand310 * apollo::canbus::neolix_edu::Adslighthorncommand310::set_turn_left_light_command ( bool  turn_left_light_command)

在文件 ads_light_horn_command_310.cc79 行定义.

80 {
81 turn_left_light_command_ = turn_left_light_command;
82 return this;
83}

◆ set_turn_right_light_command()

Adslighthorncommand310 * apollo::canbus::neolix_edu::Adslighthorncommand310::set_turn_right_light_command ( bool  turn_right_light_command)

在文件 ads_light_horn_command_310.cc61 行定义.

62 {
63 turn_right_light_command_ = turn_right_light_command;
64 return this;
65}

◆ UpdateData()

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

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

在文件 ads_light_horn_command_310.cc38 行定义.

38 {
39 set_p_turn_right_light_command(data, turn_right_light_command_);
40 set_p_turn_left_light_command(data, turn_left_light_command_);
41 set_p_horn_command(data, horn_command_);
42 set_p_beam_command(data, beam_command_);
43 ++auto_drivercmd_alivecounter_;
44 auto_drivercmd_alivecounter_ = (auto_drivercmd_alivecounter_) % 16;
45 set_p_auto_drivercmd_alivecounter(data, auto_drivercmd_alivecounter_);
46 auto_drivercmd_checksum_ =
47 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
48 set_p_auto_drivercmd_checksum(data, auto_drivercmd_checksum_);
49}

类成员变量说明

◆ ID

const int32_t apollo::canbus::neolix_edu::Adslighthorncommand310::ID = 0x310
static

在文件 ads_light_horn_command_310.h29 行定义.


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