humanoid-path-planner / hpp_tutorial

Tutorial for humanoid path planner platform
BSD 2-Clause "Simplified" License
7 stars 12 forks source link

Questions about the manipulation tutorial #44

Closed DrawZeroPoint closed 2 years ago

DrawZeroPoint commented 2 years ago

Dear developers,

After going through the manipulation tutorial and trying to reimplement it with a customized robot and environment, I came across a couple of questions as described below:

  1. Which link is defined as the "reference link" of the environment model? By "reference link" I assume its local frame is aligned with the virtual world frame, whose pose is (0, 0, 0, 1, 0, 0, 0). Form https://github.com/humanoid-path-planner/hpp_tutorial/blob/0e7416efc1e3911d83f0dc94839646f7d39d8850/urdf/kitchen_area.urdf#L218-L221 I see the kitchen_link is listed as the first link appeared in the URDF, and is commented as "the top-level joint /tf frame". Does this mean the first visited link in URDF is the one inherently defined as the reference link?

  2. Regarding the code: https://github.com/humanoid-path-planner/hpp_tutorial/blob/0e7416efc1e3911d83f0dc94839646f7d39d8850/script/tutorial_3.py#L109-L115

    I noticed that the two "solve" invoking are completely independent of each other except for using the same initial configuration. If one comment out ps.addGoalConfig (q_goal) and print ps.solve() in the middle, the solve is still functional after "setTargetState". So this code is basically demonstrating two possible ways to use the API?

  3. Based on the code in Q2, is the "grasps" syntax in "pr2/l_gripper grasps box/handle2" listed somewhere together with other predefined actions? Besides, does the "grasps" function silently hold some underlying parameters? I assume the lifting direction is along a certain axis (maybe the +Z axis when approaching the object?) of the gripper's frame

    https://github.com/humanoid-path-planner/hpp_tutorial/blob/0e7416efc1e3911d83f0dc94839646f7d39d8850/srdf/pr2_manipulation.srdf#L7-L16

    and what about the lifting distance?

  4. Lastly, could the user define new behaviors like the "grasps" one?

florent-lamiraux commented 2 years ago
  1. The reference link is called "universe", but this name is never used in HPP. If you want to create a constraint between the world frame (or reference link) and another joint pose, you can use "" (empty string) to refer to the world frame. You can find an example here: https://github.com/humanoid-path-planner/hpp-practicals/blob/a4e657c769aee3fcb54a745ac50901952ca1714d/script/grasp_ball.py#L38.
  2. I am not sure that it is possible to define the goal as a set of constraints right now. I do not think that the default manipulation planning algorithm is able to handle that, but in the future, it will be possible. We are currently working on it.
  3. You might be interested by the following paper that describes the underlying modelling of HPP: https://hal.archives-ouvertes.fr/hal-02995125. The direction of motion between pregrasp and grasp is the X axis of the gripper. The distance between grasp and pregrasp is the sum of the clearances of the gripper and of the handle, as defined in the SRDF files. The lifting direction is the normal to the contact surface on which the object is placed. The lifting distance is 0.05 by default. It can be changed in the factory as follows
    factory.setPreplacementDistance("box", 0.1)

    before calling

    factory.generate()
  4. Yes, as long as the constraints remains of the form f(q) = 0 for states and g(q) remains constant along transitions. However, in this case, it will be more difficult to use the ConstraintGraphFactory.

Finally, you might want to install hpp-plot and hpp-gui in order to activate some plugins in gepetto-gui and see the constraint graph or the joint tree.

DrawZeroPoint commented 2 years ago

Very clear and informative, thank you! @florent-lamiraux