uwgraphics / relaxed_ik

RelaxedIK Solver
MIT License
186 stars 50 forks source link

Goal poses on absolute mode #11

Open furushchev opened 5 years ago

furushchev commented 5 years ago

Hi rakita,

Sorry for many questions, I'm trying to use this library with absolute mode for sending both position/rotation goal.

The current solve function (https://github.com/uwgraphics/relaxed_ik/blob/master/src/RelaxedIK/relaxedIK.py#L52) takes goal_positions and goal_quats as arguments for goal pose of IK.

Considering the robot that has the links like below: base_link -> ... -> end_effector_base_frame -> (end_effector_fixed_joint) -> end_effector_frame.

I firstly mean the goal position / rotation is just a goal of end effector (e.g. end_effector_frame) frame from the fixed frame (e.g. base_link), but it looks it is wrong. Which frame should I set as goal poses from?

FYI: I debugged by changing relative to absolute here: https://github.com/uwgraphics/relaxed_ik/blob/master/src/RelaxedIK/GROOVE_RelaxedIK/relaxedIK_vars.py#L28-L29

-                  rotation_mode = 'relative',  # could be 'absolute' or 'relative'                                                     
+                  rotation_mode = 'absolute',  # could be 'absolute' or 'relative'                                                     
-                  position_mode = 'relative',                                                                                          
+                  position_mode = 'absolute',                                                                                          

and weights for objectives just to affect position and rotation of end effector: https://github.com/uwgraphics/relaxed_ik/blob/master/src/RelaxedIK/GROOVE_RelaxedIK/relaxedIK_vars.py#L32

-                 weight_priors=(50.0,10.0,0.3,0.3,0.3,1.0,2.0),                                                                     
+                 weight_priors=(50.0,50.0,0.0,0.0,0.0,0.0,0.0),                                                                       
djrakita commented 5 years ago

Hey, so sorry, I'm just seeing this now after answering another question in an issue that just came in! If you happen to still be working on this, the goal_positions and goal_quats arguments are just for end-effector pose goals. The first two weights also just affect the position and rotation of the end-effector as well. If you have any additional questions based on your recent experience with this, feel free to follow up!