Browse Source

update

master
zhaohe 2 years ago
parent
commit
a289854738
  1. 4
      components/mini_servo_motor/feite_servo_motor.cpp
  2. 5
      components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp

4
components/mini_servo_motor/feite_servo_motor.cpp

@ -320,11 +320,11 @@ bool FeiTeServoMotor::write_reg(uint8_t id, bool async, uint8_t add, uint8_t* da
uint8_t checksum = checksum_packet((uint8_t*)cmd_header, txpacketlen);
m_txbuf[txpacketlen - 1] = checksum;
if (!tx_and_rx(m_txbuf, txpacketlen, m_rxbuf, rxpacketlen, OVERTIME)) {
ZLOGE(TAG, "write_reg fail,overtime");
ZLOGE(TAG, "%d write_reg fail,overtime",id);
return false;
}
if (!(receipt_header->header == 0xffff && receipt_header->id == id)) {
ZLOGE(TAG, "write_reg fail,receipt header error");
ZLOGE(TAG, "%d write_reg fail,receipt header error",id);
return false;
}
return true;

5
components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp

@ -432,4 +432,7 @@ int32_t MiniRobotCtrlModule::motor_easy_move_by(int32_t distance) { return move_
int32_t MiniRobotCtrlModule::motor_easy_move_to(int32_t position) { return move_to(position, m_cfg.default_velocity, m_cfg.default_torque, nullptr); }
int32_t MiniRobotCtrlModule::motor_easy_move_to_zero(int32_t direction) { return motor_easy_move_to(0); }
int32_t MiniRobotCtrlModule::motor_easy_set_current_pos(int32_t pos) { return position_calibrate(pos); }
int32_t MiniRobotCtrlModule::motor_easy_set_current_pos(int32_t pos) {
ZLOGI(TAG, "%d motor_easy_set_current_pos %d", m_module_id, pos);
return position_calibrate(pos);
}
Loading…
Cancel
Save