FIX | Annotation correction.

This commit is contained in:
Yichao Zhang 2022-11-24 16:12:48 +08:00
parent 9535c0a912
commit c5f4a2c3f5
2 changed files with 22 additions and 22 deletions

View File

@ -26,7 +26,7 @@ typedef struct
typedef struct
{
int16_t tor_des; // 期望关节输出扭矩 unit: N.m (q8)
int16_t spd_des; // 期望关节输出速度 unit: rad/s (q7)
int16_t spd_des; // 期望关节输出速度 unit: rad/s (q8)
int32_t pos_des; // 期望关节输出位置 unit: rad (q15)
uint16_t k_pos; // 期望关节刚度系数 unit: 0.0-1.0 (q15)
uint16_t k_spd; // 期望关节阻尼系数 unit: 0.0-1.0 (q15)
@ -40,9 +40,9 @@ typedef struct
typedef struct
{
int16_t torque; // 实际关节输出扭矩 unit: N.m (q8)
int16_t speed; // 实际关节输出速度 unit: rad/s (q7)
int16_t speed; // 实际关节输出速度 unit: rad/s (q8)
int32_t pos; // 实际关节输出位置 unit: W (q15)
int8_t temp; // 电机温度: -128~127°C 90°C时触发温度保护
int8_t temp; // 电机温度: -50~127°C 90°C时触发温度保护
uint8_t MError :3; // 电机错误标识: 0.正常 1.过热 2.过流 3.过压 4.编码器故障 5-7.保留
uint16_t force :12; // 足端气压传感器数据 12bit (0-4095)
uint8_t none :1; // 保留位

View File

@ -6,7 +6,7 @@
#include <iostream>
enum class MotorType{
GO_M8010_6
GO_M8010_6,
};
struct MotorCmd{
@ -14,13 +14,13 @@ struct MotorCmd{
public:
MotorType motorType = MotorType::GO_M8010_6;
int hex_len = 17;
unsigned short id; //电机ID0xBB代表全部电机
unsigned short mode; //0:空闲, 5:开环转动, 10:闭环FOC控制
float T; //期望关节的输出力矩电机本身的力矩Nm
float W; //期望关节速度(电机本身的速度)(rad/s)
float Pos; //期望关节位置rad
float K_P; //关节刚度系数
float K_W; //关节速度系数
unsigned short id; // 电机ID 0~14 15:广播ID 此时电机无返回
unsigned short mode; // 电机模式 0:刹车 1:FOC闭环 2:电机标定(发送后等待5sec,期间禁止给电机发送消息)
float T; // 期望关节的输出力矩(电机转子转矩 N.m) 范围: ±127.99
float W; // 期望关节速度(电机转子转速 rad/s) ±804.00
float Pos; // 期望关节位置(电机转子位置 rad) ±411774
float K_P; // 关节刚度系数 0~25.599
float K_W; // 关节速度系数 0~25.599
void modify_data(MotorCmd* motor_s);
uint8_t* get_motor_send_data();
@ -29,19 +29,19 @@ struct MotorCmd{
};
struct MotorData{
// 定义 接收数据
// 定义 接收数据
public:
MotorType motorType = MotorType::GO_M8010_6;
int hex_len = 16; //接收的16进制命令数组长度, 78
bool correct = false; //接收数据是否完整true完整false不完整
unsigned char motor_id; //电机ID
unsigned char mode; //0:空闲, 5:开环转动, 10:闭环FOC控制
int Temp; //温度
int MError; //错误码
float T; // 当前实际电机输出力矩
float W; // 当前实际电机速度(高速)
float Pos; // 当前电机位置
int footForce;
int hex_len = 16; // 接收的命令长度: 16Byte
bool correct = false; // 接收数据是否完整(true完整false不完整或断联)
unsigned char motor_id; // 电机ID 0~14 15:广播ID 此时电机无返回
unsigned char mode; // 电机模式 0:刹车 1:FOC闭环 2:电机标定
int Temp; // 温度 -50~127 ℃
int MError; // 错误标志 0.正常 1.过热 2.过流 3.过压 4.编器故障
float T; // 关节的输出力矩(电机转子转矩 N.m) 范围: ±127.99
float W; // 关节速度(电机转子转速 rad/s) ±804.00
float Pos; // 关节位置(电机转子位置 rad) ±411774
int footForce; // 足端气压传感器接口 ADC原始值
bool extract_data(MotorData* motor_r);
uint8_t* get_motor_recv_data();