From a2898547380ead654ed41259e6e75d102839517b Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 3 Feb 2024 15:51:15 +0800 Subject: [PATCH] update --- components/mini_servo_motor/feite_servo_motor.cpp | 4 ++-- components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/mini_servo_motor/feite_servo_motor.cpp b/components/mini_servo_motor/feite_servo_motor.cpp index 9a8bb57..219af11 100644 --- a/components/mini_servo_motor/feite_servo_motor.cpp +++ b/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; diff --git a/components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp b/components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp index 8a34ae8..e1d5944 100644 --- a/components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp +++ b/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); +}