alecjacobson / computer-graphics-kinematics

Computer Graphics Assignment about Kinematics
93 stars 31 forks source link

What is the output of forward_kinematics()? #27

Open CalinArdelean opened 4 years ago

CalinArdelean commented 4 years ago

forward_kinematics returns T, which is a vector with 2 components. std::vector<Eigen::Affine3d,Eigen::aligned_allocator > & T); What is the meaning of these 2 components? Intuitively, I think the first component is the rotation and the 2nd one is the translation for each bone, but I'm not sure.

abhimadan commented 4 years ago

The second component of the template specifies the allocator that std::vector uses whenever it creates a new element. It's not usually required but Eigen requires its vectors to be aligned a certain way, so that allocator is required to use it with std::vector or any other STL container. The behaviour of the allocator doesn't affect the rest of the API though, so think of it as just a std::vector<Eigen::Affine3d>.

rarora7777 commented 4 years ago

Since you said you think the first is rotation and second is translation, I would add some more detail here:

An object of type Eigen::Affine3d is a 3D affine transformation, that is, just a 4x4 matrix.