Browse Source

update

master
zhaohe 2 years ago
parent
commit
6dbc5fa5c7
  1. 6
      components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp

6
components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp

@ -107,11 +107,15 @@ int32_t XYRobotCtrlModule::move_by_no_limit(int32_t dx, int32_t dy, int speed, a
int32_t XYRobotCtrlModule::move_by(int32_t dx, int32_t dy, int speed, action_cb_status_t status_cb) {
zlock_guard lock(m_lock);
ZLOGI(TAG, "move_by dx:%d dy:%d", dx, dy);
ZLOGI(TAG, "move_by dx:%d dy:%d %d", dx, dy, speed);
m_thread.stop();
_motor_stop();
if (speed == 0) {
speed = m_cfg.maxspeed;
}
if (m_cfg.maxspeed != 0 && speed > m_cfg.maxspeed) {
speed = m_cfg.maxspeed;
}

Loading…
Cancel
Save