![]() |
lebai sdk 1.4.2
lebai c++ sdk with swig to support sereval languages.
|
创建您的CMake项目,在CMakeLists.txt中添加如下内容:
乐白机械臂界面的Rx,Ry,Rz表示机械臂姿态,是由EulerZYX确定的。
界面显示的Rz,Ry,Rx为角度,将其转换为弧度后,它和旋转矩阵的关系如下:
\[ RotationMatrix = \begin{bmatrix} \cos(Rz) & -sin(Rz) & 0 \\ sin(Rz) & cos(Rz) & 0\\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} cos(Ry) & 0 & sin(Ry)\\ 0 & 1 & 0 \\ -sin(Ry) & 0 & cos(Ry) \end{bmatrix}\begin{bmatrix} 1 & 0 & 0 \\ 0 & cos(Rx) & -sin(Rx) \\ 0 & sin(Rx) & cos(Rx) \end{bmatrix} \]
gripper中一共有6个关节,按照左右对称分布。
夹爪的张开角度amplitude由一个[0,100]的整数表示,0表示完全闭合,100表示完全打开。
夹爪的机械结构为类似于挖掘机的结构,因此关节角度需要满足以下关系:
\[ angle = \frac{60.0}{180.0} \times \pi \times \frac{amplitude}{100.0} = \frac{\pi \times amplitude}{300} \]
\[ \begin{aligned} gripper\_r\_joint1 &= angle \\ gripper\_r\_joint2 &= -angle \\ gripper\_r\_joint\_finger &= -angle \\ gripper\_l\_joint1 &= angle \\ gripper\_l\_joint2 &= -angle \\ gripper\_l\_joint\_finger &= -angle \end{aligned} \]