个人背景:四足机器人小白,在学习正逆运动学相关的概念
我在运行正运动学https://github.com/Technician13/QuadrupedForwardKinematic代码后,将计算的结果直接赋值代入逆运动学代码https://github.com/Technician13/QuadrupedInverseKinematic,发现两者并不相等,十分疑惑,恳请赐教!
我假设的单腿参数为h=5,hu=20,hl=20
,开始状态的三个电机值都为0,即gamma=alpha=beta=0
运行正运动学,得到的结果如下:
The result is:
LEFT:
The X-axis: 5.35898e-07
The Y-axis: 5
The Z-axis: -40
RIGHT:
The X-axis: 5.35898e-07
The Y-axis: -5
The Z-axis: -40
Press any key to continue . . .
根据这个结果,我认为这个时候的腿的初始状态是竖直下垂的。如readme中的图所示一样
但是,我把上述的数据(选择了右腿RIGHT)代入逆运动学的代码。赋值如下
pos_x=5.35898e-07;
pos_y=-5;
pos_z=-40;
h=5;
hu=20;
hl=20;
运行后得出以下结果
The result is:
LEFT:
The first joint angle rotation angle L_gamma: 0.24871
The second joint angle rotation angle alpha: -0.785398
The third joint angle rotation angle beta: 0.000604872
RIGHT:
The first joint angle rotation angle R_gamma: -7.45058e-09
The second joint angle rotation angle alpha: -0.785398
The third joint angle rotation angle beta: 0.000604872
Press any key to continue . . .
将弧度值换成角度值,有R_gamma= -4.26887e-07,alpha= -45,beta= 0.0346566
其中的alpha
的值明显不是正运动学设定的0。
对于两者正逆运动学对比的结果不一致,我不是很理解,还是说逆运动学解算的初始位置并不是竖直下垂的,而是有一定的角度值偏移?恳请赐教,万分感谢!