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