1

我在 Webots 中远程操作三轮车机器人(froklift)。我在转动机器人时遇到问题。车辆的来回运动正常。但在小转弯或急转弯后,机器人会在正常运动方向上打滑。

对我来说,这可能是因为车辆的运动学限制。

  1. 滚动约束:可以,因为机器人工作正常
  2. 滑动约束:转动机器人时违反

如果这是问题,请指导我,我该如何解决?

或者是否有任何其他问题或需要调整的参数。

该机器人有一个用于线性和角运动的主动脚轮。除此之外都是被动轮。

编辑:

  • 刚刚浏览控制器的代码,我注意到转向电机一直在更新,随着时间的推移累积位置更新,我认为它是打滑的原因

  • 旋转电机用于速度模式,而转向电机用于位置模式。但是它的初始速度为 10.0(最大速度)我认为它正在漂移

代码

while fts.step(timestep) != -1:
    key = keys.getKey()
    if(key == keys.UP):
        state = MAX_SPEED
        wheel_main_steer_motor.setPosition(0.0)
        wheel_main_rotation_motor.setPosition(float('inf'))
        wheel_main_rotation_motor.setVelocity(state)
        print("Main Motor position:", wheel_main_rotation_postion_sensor.getValue())
        print("Main Motor velocity",wheel_main_rotation_motor.getVelocity())
        print("Steer Motor position:", wheel_main_steer_position_sensor.getValue())        
        print("Steer Motor velocity",wheel_main_steer_motor.getVelocity())
    elif(key == keys.DOWN):
        state = -MAX_SPEED
        wheel_main_steer_motor.setPosition(0.0)
        wheel_main_rotation_motor.setPosition(float('inf'))
        wheel_main_rotation_motor.setVelocity(state)
        print("Main Motor position:", wheel_main_rotation_postion_sensor.getValue())
        print("Main Motor velocity",wheel_main_rotation_motor.getVelocity())
        print("Steer Motor position:", wheel_main_steer_position_sensor.getValue())        
        print("Steer Motor velocity",wheel_main_steer_motor.getVelocity())
    elif(key == keys.RIGHT):
        wheel_main_rotation_motor.setPosition(float('inf'))
        wheel_main_rotation_motor.setVelocity(state)
        wheel_main_steer_motor.setPosition(-0.5)
        print("Main Motor position:", wheel_main_rotation_postion_sensor.getValue())
        print("Main Motor velocity",wheel_main_rotation_motor.getVelocity())
        print("Steer Motor position:", wheel_main_steer_position_sensor.getValue())        
        print("Steer Motor velocity",wheel_main_steer_motor.getVelocity())
    elif(key == keys.LEFT):
        wheel_main_rotation_motor.setPosition(float('inf'))
        wheel_main_rotation_motor.setVelocity(state)
        wheel_main_steer_motor.setPosition(0.5)
        print("Main Motor position:", wheel_main_rotation_postion_sensor.getValue())
        print("Main Motor velocity",wheel_main_rotation_motor.getVelocity())
        print("Steer Motor position:", wheel_main_steer_position_sensor.getValue())        
        print("Steer Motor velocity",wheel_main_steer_motor.getVelocity())
    else:
        wheel_main_rotation_motor.setPosition(float('inf'))
        wheel_main_rotation_motor.setVelocity(0.0)
        wheel_main_steer_motor.setPosition(0.0)
        print("Main Motor position:",     wheel_main_rotation_postion_sensor.getValue())
        print("Main Motor velocity",wheel_main_rotation_motor.getVelocity())
        print("Steer Motor position:", wheel_main_steer_position_sensor.getValue())        
        print("Steer Motor velocity",wheel_main_steer_motor.getVelocity())
4

0 回答 0