Closed arjung128 closed 1 year ago
The JointModelPlanar uses a vector with four components to depict the configuration of the joint. The two first components correspond to the $x$ and $y$ position variables, while the two last correspond to the $\cos(\theta)$ and $\sin(\theta)$ related to the orientation of the joint. We use this convention as the planar joint is supposed to do an infinite turn on itself (we do not count the number of turns), which is better represented as $(\cos(\theta),\sin(\theta))$, similarly to quaternion for 3d orientations.
Shortly speaking, if you consider an orientation $\theta$, you should use:
init_qpos = pin.neutral(model_base)
init_qpos[2] = math.cos(theta)
init_qpos[3] = math.sin(theta)
This is exactly what I was looking for. Thanks so much for all your help! :)
Hello,
It seemed to me that the 4th joint when you include
pin.JointModelPlanar()
represented the rotation of the base. However, the larger the magnitude of this value, the more deformed the robot seems to get:This looks normal. But when I change the 4th joint, the robot is deformed (visually):
The print statements also reveal that the arm becomes longer as a result of the deformation. The effects are even more obvious when the magnitude is increased further, e.g.
init_qpos[3] = 5
.Is this the intended behavior? If so, is there a way to obtain a model of the robot where the rotation of the base is represented as one parameter (unlike
pin.JointModelFreeFlyer()
where the rotation of the base is represented by four parameters) which does not deform the robot?Any help will be much appreciated, thanks in advance!