模型
AlMotion在内部保存了一个每个循环时都会更新的NAO模型(model),用户可以通过以下三种方法来获得与之有关的绝大部分信息:
# Example showing how to get a simplified robot position in world. useSensors = False result = proxy.getRobotPosition(useSensors) print "Robot Position", result # Example showing how to get the end of the right arm as a transform # represented in torso space. The result is a 4 by 4 matrix composed # of a 3*3 rotation matrix and a column vector of positions. name = 'RArm' space = 0 useSensorValues = True result = proxy.getTransform(name, space, useSensorValues) # Example showing how to get the position of the top camera # The position is a representation containing # The x,y and z coordinates in meters # The wx, wy, wz euler angles in radians name = 'CameraTop' space = 1 useSensorValues = True result = proxy.getPosition(name, space, useSensorValues)
Denavit-Hartenberg方法(D-H方法)
D-H方法简化了串行操纵器的说明。这个方法可以迅速而精确地计算机器人的前进运动模型。机器人内部使用了修改过的符号(notation),通常被命名为mDH。

为了方便找到每个链接,我们定义了一个相应的坐标框架,框架i连接到链接i。 Denavit和Hartenberg提出了一个矩阵方法,用来把坐标系有系统地分配给带关节的链中的每一个链接。
链接及关节的参数可以总结如下:
- link twist α: 围绕Xi-1轴、从Zi-1轴到Zi轴的角度;
- link length a: 沿Xi-1轴、Zi-1轴和Zi轴之间的偏移距离;
- joint angle θ: 围绕Zi轴、Xi-1轴和Xi轴之间的角度;
- link offset d: 沿Zi 轴、从框架Xi-1的原点到Xi轴的距离。
| 关节名称 | α (弧度) | a (米) | θ (弧度) | d (米) |
|---|---|---|---|---|
| HeadYaw | 0.0 | 0.0 | 0.0 | 0.0 |
| HeadPitch | -PI/2 | 0.0 | -PI/2 | 0.0 |
| LShoulderPitch | -PI/2 | 0.0 | 0.0 | 0.0 |
| LShoulderRoll | PI/2 | 0.0 | PI/2 | 0.0 |
| LElbowYaw | PI/2 | 0.0 | 0.0 | UpperArmLength |
| LElbowRoll | -PI/2 | 0.0 | 0.0 | 0.0 |
| LWristYaw | PI/2 | 0.0 | 0.0 | LowerArmLength |
| LHipYawPitch | -3/4 * PI | 0.0 | -PI/2 | 0.0 |
| LHipRoll | -PI/2 | 0.0 | PI/4 | 0.0 |
| LHipPitch | PI/2 | 0.0 | 0.0 | 0.0 |
| LKneePitch | 0.0 | -ThighLength | 0.0 | 0.0 |
| LAnklePitch | 0.0 | -TibiaLength | 0.0 | 0.0 |
| LAnkleRoll | -PI/2 | 0.0 | 0.0 | 0.0 |
| RHipYawPitch | -PI/4 | 0.0 | -PI/2 | 0.0 |
| RHipRoll | -PI/2 | 0.0 | -PI/4 | 0.0 |
| RHipPitch | PI/2 | 0.0 | 0.0 | 0.0 |
| RKneePitch | 0.0 | -ThighLength | 0.0 | 0.0 |
| RAnklePitch | 0.0 | -TibiaLength | 0.0 | 0.0 |
| RAnkleRoll | -PI/2 | 0.0 | 0.0 | 0.0 |
| RShoulderPitch | -PI/2 | 0.0 | 0.0 | 0.0 |
| RShoulderRoll | PI/2 | 0.0 | PI/2 | 0.0 |
| RElbowYaw | PI/2 | 0.0 | 0.0 | UpperArmLength |
| RElbowRoll | -PI/2 | 0.0 | 0.0 | 0.0 |
| RWristYaw | PI/2 | 0.0 | 0.0 | LowerArmLength |
基点转换(Base Transform)
以下转换用来从作为参考的躯干轴移动至链中的第一个关节。
| 链 | 基点转换 |
|---|---|
| Head | Translation( 0, 0, NeckOffsetZ ) |
| LArm | Translation( 0, ShoulderOffsetY, ShoulderOffsetZ ) |
| LLeg | Translation( 0, HipOffsetY, -HipOffsetZ ) |
| RLeg | Translation( 0, -HipOffsetY, -HipOffsetZ ) |
| RArm | Translation( 0, -ShoulderOffsetY, ShoulderOffsetZ ) |
端点转换(End Transforms)
端点转换用来从链上最后一个关节移动至相对于躯干转动轴的某一点。
| 链 | 端点转换 |
|---|---|
| Head | RotX( Pi/2 ).RotY( Pi/2 ) |
| LArm | RotX( -Pi/2 ).RotZ( -Pi/2 ).Translation( HandOffsetX, 0, -HandOffsetZ ) |
| LLeg | RotZ( Pi ).RotY( -Pi/2 ).Translation( 0, 0, -FootHeight ) |
| RLeg | RotZ( Pi ).RotY( -Pi/2 ).Translation( 0, 0, -FootHeight ) |
| RArm | RotX( -Pi/2 ).RotZ( -Pi/2 ).Translation( HandOffsetX, 0, -HandOffsetZ ) |
请参见硬件程序说明书来了解这些常量的定义。

