krishauser / Klampt

Kris' Locomotion and Manipulation Planning Toolkit
BSD 3-Clause "New" or "Revised" License
378 stars 96 forks source link

How to access frames of interest after using reduce? #106

Closed clemense closed 3 years ago

clemense commented 3 years ago

Hi, What's the recommended way to reference frames of interest (such as end-effector) in a reduced robot? After using reduce(robot), these frames naturally disappear (since they are usually connected with fixed joints in the original URDF). What's the recommended way to retain this information?

Thanks!

adithyamurali commented 3 years ago

I've manually kept track of the frame transformations that have disappeared due to reduce operation (by looking up the URDF), and added them back whenever they are needed in the code. This is obviously not ideal and prone to error...

krishauser commented 3 years ago

Referring to frames by name is generally the way to do it. If you get the frame names before reduce, and after, you can find a matching between the two.

clemense commented 3 years ago

Ok, so basically I go up the kinematic chain until a link appears that has the same name as in the reduced version, I store the transform between this link and my desired frame, and then always use this to adapt my ik.objective etc.