|
|
@ -25,7 +25,29 @@ static void cmd_dump_ack(int32_t& ack) { // |
|
|
|
ZLOGI(TAG, "value:%d", ack); |
|
|
|
} |
|
|
|
static void cmd_dump_ack(Eq20ServoMotor::servo_internal_status_t ack) { //
|
|
|
|
ZLOGI(TAG, "value:%d", ack.status); |
|
|
|
ZLOGI(TAG, "value:%d", ack.data.status); |
|
|
|
ZLOGI(TAG, "servo_is_ready :%d", ack.data.sbit.servo_is_ready); |
|
|
|
ZLOGI(TAG, "servo_warning :%d", ack.data.sbit.servo_warning); |
|
|
|
ZLOGI(TAG, "motor_is_rotating :%d", ack.data.sbit.motor_is_rotating); |
|
|
|
ZLOGI(TAG, "is_reach_target :%d", ack.data.sbit.is_reach_target); |
|
|
|
ZLOGI(TAG, "is_speed_consistent :%d", ack.data.sbit.is_speed_consistent); |
|
|
|
ZLOGI(TAG, "motor_is_zero_speed :%d", ack.data.sbit.motor_is_zero_speed); |
|
|
|
ZLOGI(TAG, "brake_is_on :%d", ack.data.sbit.brake_is_on); |
|
|
|
ZLOGI(TAG, "is_pos_close :%d", ack.data.sbit.is_pos_close); |
|
|
|
ZLOGI(TAG, "torque_is_limited :%d", ack.data.sbit.torque_is_limited); |
|
|
|
ZLOGI(TAG, "speed_is_limited :%d", ack.data.sbit.speed_is_limited); |
|
|
|
ZLOGI(TAG, "torque_is_detected :%d", ack.data.sbit.torque_is_detected); |
|
|
|
ZLOGI(TAG, "servo_warning2 :%d", ack.data.sbit.servo_warning2); |
|
|
|
ZLOGI(TAG, "servo_error_code1 :%d", ack.data.sbit.servo_error_code1); |
|
|
|
ZLOGI(TAG, "servo_error_code2 :%d", ack.data.sbit.servo_error_code2); |
|
|
|
ZLOGI(TAG, "servo_error_code3 :%d", ack.data.sbit.servo_error_code3); |
|
|
|
ZLOGI(TAG, "is_zero_complete :%d", ack.data.sbit.is_zero_complete); |
|
|
|
ZLOGI(TAG, "encoder_c_pulse_is_valid:%d", ack.data.sbit.encoder_c_pulse_is_valid); |
|
|
|
ZLOGI(TAG, "motor_is_excited :%d", ack.data.sbit.motor_is_excited); |
|
|
|
ZLOGI(TAG, "is_over_travel :%d", ack.data.sbit.is_over_travel); |
|
|
|
ZLOGI(TAG, "encoder_battery_warning:%d", ack.data.sbit.encoder_battery_warning); |
|
|
|
ZLOGI(TAG, "encoder_battery_report :%d", ack.data.sbit.encoder_battery_report); |
|
|
|
|
|
|
|
} |
|
|
|
static bool streq(const char* a, const char* b) { return strcmp(a, b) == 0; } |
|
|
|
|
|
|
@ -40,8 +62,8 @@ void ScriptCmderEq20Servomotor::regcmd() { |
|
|
|
REG_CMD___NO_ACK("eq20_", move_to, "(id,pos,rpm,acctime)", 4, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", move_by, "(id,pos,rpm,acctime)", 4, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", rotate, "(id,rpm,acctime)", 3, con->getInt(2), con->getInt(3)); |
|
|
|
REG_CMD___NO_ACK("eq20_", move_to_zero_forward, "(id,lookzeropoint_rpm,findzero_edge_rpm,lookzeropoint_acc_time)", 5, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", move_to_zero_backward, "(id,lookzeropoint_rpm,findzero_edge_rpm,lookzeropoint_acc_time)", 5, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", move_to_zero_forward, "(id,lookzeropoint_rpm,findzero_edge_rpm,lookzeropoint_acc_time)", 4, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", move_to_zero_backward, "(id,lookzeropoint_rpm,findzero_edge_rpm,lookzeropoint_acc_time)", 4, con->getInt(2), con->getInt(3), con->getInt(4)); |
|
|
|
REG_CMD___NO_ACK("eq20_", stop, "(id)", 1); |
|
|
|
REG_CMD_WITH_ACK("eq20_", get_pos, "(id)", 1, int32_t, ack); |
|
|
|
REG_CMD_WITH_ACK("eq20_", get_servo_internal_state, "(id)", 1, Eq20ServoMotor::servo_internal_status_t, ack); |