FIX | Annotation correction.
This commit is contained in:
parent
9535c0a912
commit
c5f4a2c3f5
@ -26,7 +26,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int16_t tor_des; // 期望关节输出扭矩 unit: N.m (q8)
|
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)
|
int32_t pos_des; // 期望关节输出位置 unit: rad (q15)
|
||||||
uint16_t k_pos; // 期望关节刚度系数 unit: 0.0-1.0 (q15)
|
uint16_t k_pos; // 期望关节刚度系数 unit: 0.0-1.0 (q15)
|
||||||
uint16_t k_spd; // 期望关节阻尼系数 unit: 0.0-1.0 (q15)
|
uint16_t k_spd; // 期望关节阻尼系数 unit: 0.0-1.0 (q15)
|
||||||
@ -40,9 +40,9 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int16_t torque; // 实际关节输出扭矩 unit: N.m (q8)
|
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)
|
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.保留
|
uint8_t MError :3; // 电机错误标识: 0.正常 1.过热 2.过流 3.过压 4.编码器故障 5-7.保留
|
||||||
uint16_t force :12; // 足端气压传感器数据 12bit (0-4095)
|
uint16_t force :12; // 足端气压传感器数据 12bit (0-4095)
|
||||||
uint8_t none :1; // 保留位
|
uint8_t none :1; // 保留位
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
enum class MotorType{
|
enum class MotorType{
|
||||||
GO_M8010_6
|
GO_M8010_6,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MotorCmd{
|
struct MotorCmd{
|
||||||
@ -14,13 +14,13 @@ struct MotorCmd{
|
|||||||
public:
|
public:
|
||||||
MotorType motorType = MotorType::GO_M8010_6;
|
MotorType motorType = MotorType::GO_M8010_6;
|
||||||
int hex_len = 17;
|
int hex_len = 17;
|
||||||
unsigned short id; //电机ID,0xBB代表全部电机
|
unsigned short id; // 电机ID 0~14 15:广播ID 此时电机无返回
|
||||||
unsigned short mode; //0:空闲, 5:开环转动, 10:闭环FOC控制
|
unsigned short mode; // 电机模式 0:刹车 1:FOC闭环 2:电机标定(发送后等待5sec,期间禁止给电机发送消息)
|
||||||
float T; //期望关节的输出力矩(电机本身的力矩)(Nm)
|
float T; // 期望关节的输出力矩(电机转子转矩 N.m) 范围: ±127.99
|
||||||
float W; //期望关节速度(电机本身的速度)(rad/s)
|
float W; // 期望关节速度(电机转子转速 rad/s) ±804.00
|
||||||
float Pos; //期望关节位置(rad)
|
float Pos; // 期望关节位置(电机转子位置 rad) ±411774
|
||||||
float K_P; //关节刚度系数
|
float K_P; // 关节刚度系数 0~25.599
|
||||||
float K_W; //关节速度系数
|
float K_W; // 关节速度系数 0~25.599
|
||||||
void modify_data(MotorCmd* motor_s);
|
void modify_data(MotorCmd* motor_s);
|
||||||
uint8_t* get_motor_send_data();
|
uint8_t* get_motor_send_data();
|
||||||
|
|
||||||
@ -29,19 +29,19 @@ struct MotorCmd{
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct MotorData{
|
struct MotorData{
|
||||||
// 定义 接收数据
|
// 定义 接收数据
|
||||||
public:
|
public:
|
||||||
MotorType motorType = MotorType::GO_M8010_6;
|
MotorType motorType = MotorType::GO_M8010_6;
|
||||||
int hex_len = 16; //接收的16进制命令数组长度, 78
|
int hex_len = 16; // 接收的命令长度: 16Byte
|
||||||
bool correct = false; //接收数据是否完整(true完整,false不完整)
|
bool correct = false; // 接收数据是否完整(true完整,false不完整或断联)
|
||||||
unsigned char motor_id; //电机ID
|
unsigned char motor_id; // 电机ID 0~14 15:广播ID 此时电机无返回
|
||||||
unsigned char mode; //0:空闲, 5:开环转动, 10:闭环FOC控制
|
unsigned char mode; // 电机模式 0:刹车 1:FOC闭环 2:电机标定
|
||||||
int Temp; //温度
|
int Temp; // 温度 -50~127 ℃
|
||||||
int MError; //错误码
|
int MError; // 错误标志 0.正常 1.过热 2.过流 3.过压 4.编码器故障
|
||||||
float T; // 当前实际电机输出力矩
|
float T; // 关节的输出力矩(电机转子转矩 N.m) 范围: ±127.99
|
||||||
float W; // 当前实际电机速度(高速)
|
float W; // 关节速度(电机转子转速 rad/s) ±804.00
|
||||||
float Pos; // 当前电机位置
|
float Pos; // 关节位置(电机转子位置 rad) ±411774
|
||||||
int footForce;
|
int footForce; // 足端气压传感器接口 ADC原始值
|
||||||
bool extract_data(MotorData* motor_r);
|
bool extract_data(MotorData* motor_r);
|
||||||
uint8_t* get_motor_recv_data();
|
uint8_t* get_motor_recv_data();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user