1 changed files with 0 additions and 84 deletions
@ -1,84 +0,0 @@ |
|||
#pragma once
|
|||
#include <stdint.h>
|
|||
|
|||
#include <functional>
|
|||
|
|||
#include "basic_type.hpp"
|
|||
//
|
|||
|
|||
namespace iflytop { |
|||
using namespace std; |
|||
class I_MiniServoModule { |
|||
public: |
|||
typedef enum { kNormalStop, kBreakStop } StopType_t; |
|||
#pragma pack(1)
|
|||
|
|||
/*******************************************************************************
|
|||
* READ * |
|||
*******************************************************************************/ |
|||
typedef struct { |
|||
int32_t version; |
|||
} version_t; |
|||
|
|||
typedef struct { |
|||
uint8_t status; // 0:normal 1:运行中 2:offline 3:故障
|
|||
uint8_t ioState; //
|
|||
int16_t torque; //
|
|||
int16_t speed; //
|
|||
int16_t pos; //
|
|||
} status_t; |
|||
|
|||
typedef struct { |
|||
uint8_t status; |
|||
uint8_t ioState; |
|||
int16_t torque; |
|||
int16_t speed; |
|||
int16_t pos; |
|||
int16_t voltage; |
|||
int16_t current; |
|||
int16_t temperature; |
|||
int16_t error_flag; |
|||
} detailed_status_t; |
|||
|
|||
/*******************************************************************************
|
|||
* CFG * |
|||
*******************************************************************************/ |
|||
|
|||
typedef struct { |
|||
u16 posCalibrate; |
|||
u16 minlimit; |
|||
u16 maxlimit; |
|||
u16 maxtemp; |
|||
u16 minvoltage; |
|||
u16 maxvoltage; |
|||
u16 protectCurrent; |
|||
u16 protectTorque; |
|||
} basic_param_t; |
|||
|
|||
#pragma pack()
|
|||
|
|||
public: |
|||
// virtual int32_t enable(u8 enable) = 0;
|
|||
// virtual int32_t stop(u8 stop_type) = 0;
|
|||
// virtual int32_t position_calibrate(s32 calibrate_pos) = 0;
|
|||
|
|||
// virtual int32_t rotate(s32 speed, s32 torque, s32 run_time, action_cb_status_t status_cb) = 0;
|
|||
// virtual int32_t move_to(s32 pos, s32 speed, s32 torque, action_cb_status_t status_cb) = 0;
|
|||
// virtual int32_t move_by(s32 pos, s32 speed, s32 torque, action_cb_status_t status_cb) = 0;
|
|||
// virtual int32_t run_with_torque(s32 torque, s32 run_time, action_cb_status_t status_cb) = 0;
|
|||
// virtual int32_t move_by_nolimit(s32 pos, s32 speed, s32 torque, action_cb_status_t status_cb) = 0;
|
|||
|
|||
// virtual int32_t move_forward(s32 torque) = 0;
|
|||
// virtual int32_t move_backward(s32 torque) = 0;
|
|||
|
|||
// virtual int32_t read_version(version_t& version) = 0;
|
|||
// virtual int32_t read_status(status_t& status) = 0;
|
|||
// virtual int32_t read_detailed_status(detailed_status_t& debug_info) = 0;
|
|||
|
|||
// virtual int32_t set_basic_param(basic_param_t& param) = 0;
|
|||
|
|||
// virtual int32_t get_basic_param(basic_param_t& param) = 0;
|
|||
|
|||
virtual ~I_MiniServoModule() {} |
|||
}; |
|||
} // namespace iflytop
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue