54 lines
714 B
C
54 lines
714 B
C
#pragma once
|
|
|
|
#include "main.h"
|
|
#include "device/encoder_oid.h"
|
|
#define JOINT_NUM 6
|
|
|
|
//关节结构体
|
|
typedef struct {
|
|
|
|
struct{
|
|
ECD_OID_t* encoder;
|
|
}sensor;
|
|
|
|
struct {
|
|
float angle_limit[2];
|
|
float last_angle;
|
|
int circles;
|
|
float last_control_time;
|
|
}status;//关节状态
|
|
|
|
struct {
|
|
float velocity;
|
|
float position;
|
|
}feedback;//反馈
|
|
|
|
}joint_t;
|
|
|
|
|
|
typedef struct{
|
|
struct {
|
|
struct {
|
|
ECD_OID_Param_t param;
|
|
}sensor;
|
|
|
|
float angle_limit[2];
|
|
}joint[JOINT_NUM];
|
|
}arm_param_t;
|
|
|
|
|
|
|
|
//机械臂结构体
|
|
typedef struct
|
|
{
|
|
joint_t joint[JOINT_NUM];
|
|
struct {
|
|
uint8_t cmd_prepare;
|
|
uint8_t busy;
|
|
uint8_t step;
|
|
uint8_t path_finish;
|
|
}status;
|
|
|
|
|
|
}arm_t;
|