One Motor
0.5.1
RoboMaster全平台一站式电机驱动库
载入中...
搜索中...
未找到
M3508Frames.hpp
浏览该文件的文档.
1
7
8
#ifndef M3508FRAMES_HPP
9
#define M3508FRAMES_HPP
10
#include <string>
11
12
#include "
OneMotor/Can/CanDriver.hpp
"
13
14
namespace
OneMotor::Motor::DJI
15
{
23
struct
M3508RawStatusFrame
24
{
28
explicit
operator
Can::CanFrame
()
const
;
29
34
explicit
M3508RawStatusFrame
(
Can::CanFrame
frame);
35
40
[[nodiscard]] std::string
format
()
const
;
41
42
uint16_t
canId
;
43
uint16_t
ecd
;
44
int16_t
rpm
;
45
int16_t
current
;
46
uint8_t
temperature
;
47
};
48
56
struct
M3508Status
57
{
58
uint16_t
last_ecd
;
59
uint16_t
ecd
;
60
float
angle_single_round
;
61
float
angular
;
62
int16_t
real_current
;
63
uint8_t
temperature
;
64
float
total_angle
;
65
int32_t
total_round
;
66
int16_t
output_current
;
71
[[nodiscard]] std::string
format
()
const
;
72
};
73
}
74
75
#endif
//M3508FRAMES_HPP
CanDriver.hpp
提供一个统一的CAN总线驱动接口。
OneMotor::Can::CanFrame
一个与平台无关的CAN帧结构体。
定义
CanFrame.hpp:35
OneMotor::Motor::DJI::M3508RawStatusFrame::format
std::string format() const
将帧内容格式化为可读字符串。
定义
N_M3508Frames.cpp:32
OneMotor::Motor::DJI::M3508RawStatusFrame::temperature
uint8_t temperature
电机温度 (°C)
定义
M3508Frames.hpp:46
OneMotor::Motor::DJI::M3508RawStatusFrame::rpm
int16_t rpm
转速 (RPM)
定义
M3508Frames.hpp:44
OneMotor::Motor::DJI::M3508RawStatusFrame::M3508RawStatusFrame
M3508RawStatusFrame(Can::CanFrame frame)
从通用的 Can::CanFrame 构造此结构体。
定义
N_M3508Frames.cpp:23
OneMotor::Motor::DJI::M3508RawStatusFrame::canId
uint16_t canId
CAN ID
定义
M3508Frames.hpp:42
OneMotor::Motor::DJI::M3508RawStatusFrame::ecd
uint16_t ecd
编码器原始值 (0~8191)
定义
M3508Frames.hpp:43
OneMotor::Motor::DJI::M3508RawStatusFrame::current
int16_t current
电机实际电流 (mA)
定义
M3508Frames.hpp:45
OneMotor::Motor::DJI::M3508Status
经过处理和计算后的M3508电机状态。
定义
M3508Frames.hpp:57
OneMotor::Motor::DJI::M3508Status::format
std::string format() const
将电机状态格式化为可读字符串。
定义
N_M3508Frames.cpp:38
OneMotor::Motor::DJI::M3508Status::temperature
uint8_t temperature
温度 (°C)
定义
M3508Frames.hpp:63
OneMotor::Motor::DJI::M3508Status::last_ecd
uint16_t last_ecd
上一次的编码器值
定义
M3508Frames.hpp:58
OneMotor::Motor::DJI::M3508Status::angle_single_round
float angle_single_round
单圈角度 (0-360°)
定义
M3508Frames.hpp:60
OneMotor::Motor::DJI::M3508Status::total_round
int32_t total_round
累计总圈数,带方向
定义
M3508Frames.hpp:65
OneMotor::Motor::DJI::M3508Status::ecd
uint16_t ecd
当前编码器值
定义
M3508Frames.hpp:59
OneMotor::Motor::DJI::M3508Status::real_current
int16_t real_current
实际电流 (mA)
定义
M3508Frames.hpp:62
OneMotor::Motor::DJI::M3508Status::output_current
int16_t output_current
PID计算后输出给电机的电流值
定义
M3508Frames.hpp:66
OneMotor::Motor::DJI::M3508Status::angular
float angular
角速度 (度/秒)
定义
M3508Frames.hpp:61
OneMotor::Motor::DJI::M3508Status::total_angle
float total_angle
累计总角度 (°),带方向
定义
M3508Frames.hpp:64
include
OneMotor
Motor
DJI
M3508Frames.hpp
制作者
1.13.2