iKinChain object and iCub synchronisation #581
-
Hey everyone! I'm trying to have an iKinChain armChain object synched with what is going on on the robot (for the moment in simulation). Basically, I read the encoders' values of the torso and the right arm, and I assign them to armChain in order to compute the respective pose in the Cartesian Space. For some reason, however, while I read the correct joint values from the chain, the resulting Cartesian coordinates do not match what I read from I leave here a basic Gist code for you to try. It is basically an update module that periodically updates the chain joint values with what is read from the encoders and prints them, along with the resulting Cartesian pose. You can let it run while playing with the simulator and the yarpmotorgui. Help me Robotology community, you are my only hope 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Did't go through all your code, but at first glance I would try out the following change to line 127: -Vector full_chain = q0_torso;
+Vector full_chain = q0_torso;
+std::swap(full_chain[0], full_chain[2]); Include Essentially, the motor device streams out the torso joints in an order that does not correspond to the kinematic chain of iCub 2.x, which in turn does expect the pitch-roll-yaw sequence. |
Beta Was this translation helpful? Give feedback.
Did't go through all your code, but at first glance I would try out the following change to line 127:
Include
#include <algorithm>
to havestd::swap
available.Essentially, the motor device streams out the torso joints in an order that does not correspond to the kinematic chain of iCub 2.x, which in turn does expect the pitch-roll-yaw sequence.