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

one of the protocol data of lincoln vehicle 更多...

#include <throttleinfo_75.h>

类 apollo::canbus::lincoln::Throttleinfo75 继承关系图:
apollo::canbus::lincoln::Throttleinfo75 的协作图:

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
double engine_rpm (const std::uint8_t *bytes, int32_t length) const
 calculate engine rpm based on byte array.
 
double acc_pedal_percent (const std::uint8_t *bytes, int32_t length) const
 calculate acc pedal percent based on byte array.
 
double acc_pedal_rate (const std::uint8_t *bytes, int32_t length) const
 calculate acc pedal rate based on byte array.
 
- Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Lincoln >
 ProtocolData ()=default
 construct protocol data.
 
virtual ~ProtocolData ()=default
 destruct protocol data.
 
virtual uint32_t GetPeriod () const
 
virtual int32_t GetLength () const
 
virtual void Parse (const uint8_t *bytes, int32_t length, ::apollo::canbus::Lincoln *sensor_data) const
 
virtual void UpdateData (uint8_t *data)
 
virtual void UpdateData_Heartbeat (uint8_t *data)
 
virtual void Reset ()
 

静态 Public 属性

static const int32_t ID = 0x75
 

额外继承的成员函数

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

详细描述

one of the protocol data of lincoln vehicle

在文件 throttleinfo_75.h40 行定义.

成员函数说明

◆ acc_pedal_percent()

double apollo::canbus::lincoln::Throttleinfo75::acc_pedal_percent ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate acc pedal percent based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of lateral acceleration

在文件 throttleinfo_75.cc48 行定义.

49 {
50 Byte frame_high(bytes + 3);
51 int32_t high = frame_high.get_byte(0, 2);
52 Byte frame_low(bytes + 2);
53 int32_t low = frame_low.get_byte(0, 8);
54 int32_t value = (high << 8) | low;
55 return value * 0.1;
56}

◆ acc_pedal_rate()

double apollo::canbus::lincoln::Throttleinfo75::acc_pedal_rate ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate acc pedal rate based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of lateral acceleration

在文件 throttleinfo_75.cc58 行定义.

59 {
60 Byte frame(bytes + 4);
61 int32_t x = frame.get_byte(0, 8);
62 if (x > 0x3F) {
63 x -= 0x100;
64 }
65 return x * 0.04;
66}

◆ engine_rpm()

double apollo::canbus::lincoln::Throttleinfo75::engine_rpm ( const std::uint8_t *  bytes,
int32_t  length 
) const

calculate engine rpm based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of lateral acceleration

在文件 throttleinfo_75.cc38 行定义.

39 {
40 Byte frame_high(bytes + 1);
41 int32_t high = frame_high.get_byte(0, 8);
42 Byte frame_low(bytes + 0);
43 int32_t low = frame_low.get_byte(0, 8);
44 int32_t value = (high << 8) | low;
45 return value * 0.25;
46}

◆ Parse()

void apollo::canbus::lincoln::Throttleinfo75::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Lincoln chassis_detail 
) const
virtual

在文件 throttleinfo_75.cc29 行定义.

30 {
31 chassis_detail->mutable_ems()->set_engine_rpm(engine_rpm(bytes, length));
32 chassis_detail->mutable_gas()->set_accelerator_pedal(
33 acc_pedal_percent(bytes, length));
34 chassis_detail->mutable_gas()->set_accelerator_pedal_rate(
35 acc_pedal_rate(bytes, length));
36}
double acc_pedal_percent(const std::uint8_t *bytes, int32_t length) const
calculate acc pedal percent based on byte array.
double acc_pedal_rate(const std::uint8_t *bytes, int32_t length) const
calculate acc pedal rate based on byte array.
double engine_rpm(const std::uint8_t *bytes, int32_t length) const
calculate engine rpm based on byte array.

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Throttleinfo75::ID = 0x75
static

在文件 throttleinfo_75.h43 行定义.


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