const Eigen::Affine3d; rotation()
Hey, I have solved the forward kinematics with moveit.
kinemtic_state->setJointGroupPositions(joint_model_group, joint_values);
const Eigen::Affine3d &arm_link_5_state = kinematic_state->getGlobalLinkTransform("arm_link_5");
x = arm_link_5_state.translation().x();
y = arm_link_5_state.translation().y();
z = arm_link_5_state.translation().z();
xx = arm_link_5_state.rotation().??;
xy = arm_link_5_state.rotation().??;
xz = arm_link_5_state.rotation().??;
I don't know how to assign the value of xx, xy, xz of the rotation matrix.
I tried:
xx = arm_link_5_state.rotation().xx();
xx = arm_link_5_state.rotation().x().x();
xx = arm_link_5_state.rotation().nx();
xx = arm_link_5_state.rotation(0,0);
Error: const LinearMatrixType has no member named xx
I don't find the class where it is declared.
It would be great if someone can help me out.
Best regards, Jonas
The accessor for the linear part of the affine transform is .linear(), not .rotation(). See docs here.
.linear().xx()? I don't find it in the doc.
Check out this tutorial and if you still can't figure it out update your question.
In my code I print the rotation with
ROS_INFO_STREAM("Rotation: " << arm_link_5_state.rotation());
and that works well.
I want to extract the individual values of the rotation matrix.
Thanks for your help @stevejp
Now it works.
Thanks for that @stevejp