速度控制

通过速度控制,可以对行走进行反应控制,使机器人完成诸如目标跟踪等动作。由于最新的命令会覆盖所有以前的命令,因此您可以随时调用速度控制。

行走这个动作使用一个预览控制器来保证其平稳性。预览用时0.8秒,这也是行走时对新命令的反应时间。在最大步频时,相当于走两步的时间。

参数

  • x [-1.0 to 1.0]:规定沿x轴(向前和向后)的步长,作为maxStepX的一部分。
  • y [-1.0 to 1.0]:规定沿Y轴(横向)的步长,作为maxStepY的一部分。
  • theta [-1.0 to 1.0]:规定两只脚之间的角度,作为maxStepTheta的一部分。左转(逆时针)时,值为正;右转(顺时针)时,值为负。
  • frequency [0.0 to 1.0]:规定步频,作为minimumStepFrequency和maximumStepFrequency之间线性插值的一部分。一个循环由一个双腿支撑阶段及之后的一个单腿支撑阶段组成。

前进

# Full speed forwards x = 1.0 y = 0.0 theta = 0.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk forward

后退

# Full speed backwards x = -1.0 y = 0.0 theta = 0.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk backward

向左走

# Full speed left x = 0.0 y = 1.0 theta = 0.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk left side

向右走

# Full speed right x = 0.0 y = -1.0 theta = 0.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk right side

顺时针转动

# Full speed clockwise x = 0.0 y = 0.0 theta = -1.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk turn clockwise

逆时针转动

# Full speed anti-clockwise x = 0.0 y = 0.0 theta = 1.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency)

Walk turn anti-clockwise

停止行走

# The frequency will be ignored if the velocity is zero proxy.setWalkTargetVelocity(0.0, 0.0, 0.0, frequency)

范例:

# Example showing the use of setWalkTargetVelocity # The parameters are fractions of the maximum Step parmaters # Here we are asking for full speed forwards # with maximum step frequency x = 1.0 y = 0.0 theta = 0.0 frequency = 1.0 proxy.setWalkTargetVelocity(x, y, theta, frequency) # If we don't send another command, he will walk forever # Lets make him slow down(step length) and turn after 10 seconds time.sleep(10) x = 0.5 theta = 0.6 proxy.setWalkTargetVelocity(x, y, theta, frequency) # Lets make him slow down(frequency) after 5 seconds time.sleep(5) frequency = 0.5 proxy.setWalkTargetVelocity(x, y, theta, frequency) # After another 10 seconds, we'll make him stop time.sleep(10) proxy.setWalkTargetVelocity(0.0, 0.0, 0.0, frequency) # Note that at any time, you can use a walkTo command # to walk a precise distance. The last command received, # of velocity or position always wins





Copyright © 2010 Aldebaran-Robotics - 版权所有