|
@ -62,6 +62,12 @@ class Eq20ServoMotor : public ZIModule, public ZIMotor { |
|
|
} data; |
|
|
} data; |
|
|
} servo_internal_status_t; |
|
|
} servo_internal_status_t; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
|
int32_t default_acc_time_ms = 1000; |
|
|
|
|
|
int32_t default_velocity = 800; |
|
|
|
|
|
int32_t find_zero_velocity = 100; |
|
|
|
|
|
} servo_config_t; |
|
|
|
|
|
|
|
|
typedef enum { |
|
|
typedef enum { |
|
|
kActionType_none, |
|
|
kActionType_none, |
|
|
kActionType_rotate, |
|
|
kActionType_rotate, |
|
@ -77,11 +83,13 @@ class Eq20ServoMotor : public ZIModule, public ZIMotor { |
|
|
|
|
|
|
|
|
final_action_t m_final_action = kActionType_none; |
|
|
final_action_t m_final_action = kActionType_none; |
|
|
|
|
|
|
|
|
|
|
|
servo_config_t m_servo_config; |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
Eq20ServoMotor(/* args */){}; |
|
|
Eq20ServoMotor(/* args */){}; |
|
|
~Eq20ServoMotor(){}; |
|
|
~Eq20ServoMotor(){}; |
|
|
|
|
|
|
|
|
void init(int moduleid, ModbusBlockHost *modbusBlockHost, int motorid); |
|
|
|
|
|
|
|
|
void init(int moduleid, ModbusBlockHost *modbusBlockHost, int motorid, servo_config_t servo_config); |
|
|
|
|
|
|
|
|
int32_t enable(int32_t enable); |
|
|
int32_t enable(int32_t enable); |
|
|
|
|
|
|
|
@ -105,6 +113,8 @@ class Eq20ServoMotor : public ZIModule, public ZIMotor { |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
|
virtual int32_t getid(int32_t *id) override; |
|
|
virtual int32_t getid(int32_t *id) override; |
|
|
|
|
|
virtual int32_t module_enable(int32_t enable) override; |
|
|
|
|
|
|
|
|
virtual int32_t module_ping() { return 0; }; |
|
|
virtual int32_t module_ping() { return 0; }; |
|
|
|
|
|
|
|
|
virtual int32_t module_stop() override; |
|
|
virtual int32_t module_stop() override; |
|
@ -139,6 +149,13 @@ class Eq20ServoMotor : public ZIModule, public ZIMotor { |
|
|
|
|
|
|
|
|
virtual int32_t motor_read_pos(int32_t *pos); |
|
|
virtual int32_t motor_read_pos(int32_t *pos); |
|
|
|
|
|
|
|
|
|
|
|
virtual int32_t motor_easy_rotate(int32_t direction); |
|
|
|
|
|
virtual int32_t motor_easy_move_by(int32_t distance); |
|
|
|
|
|
virtual int32_t motor_easy_move_to(int32_t position); |
|
|
|
|
|
virtual int32_t motor_easy_move_to_zero(int32_t direction); |
|
|
|
|
|
virtual int32_t motor_easy_set_current_pos(int32_t pos); |
|
|
|
|
|
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction); |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
int32_t write_reg(uint32_t regadd, int32_t value); |
|
|
int32_t write_reg(uint32_t regadd, int32_t value); |
|
|
int32_t read_reg(uint32_t regadd, int32_t &value); |
|
|
int32_t read_reg(uint32_t regadd, int32_t &value); |
|
|