humanoid-path-planner / hpp_tutorial

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

Unexpected behavior about the orientation config and its effect on the robot #41

Closed DrawZeroPoint closed 2 years ago

DrawZeroPoint commented 2 years ago

Dear HPP authors,

First thanks for sharing this great work!

I was able to run Tutorial 1 - python using the stable binary install. Yet, when I try to tweak the orientation config (I suppose that would be the 3rd and the 4th elements in the config list for a planar joint, which are treated as the w and z coefficients of the quaternion representing the orientation of the root joint wrt the world frame, please correct me if I am wrong), say, setting:

q_init [0:2] = [0, 0]
q_goal [0:4] = [0, 0, 0.70710678, 0.70710678]

Note: other parts of the code were not drastically changed. The position of the base was translated to the origin to avoid unrelated collision and the bound values were altered accordingly.

the robot in the viewer did not turn +90 deg as expected, but +45 deg.

I also tried:

q_goal [0:4] = [0, 0, 0, 1]

which should represent a +180 deg rotation, but only +90 deg rotation was witnessed in the viewer. In general, the actual rotation angle turns out to be half the quaternion defined. So is this a feature of HPP or maybe something went wrong?

jmirabel commented 2 years ago

The two last values are [cos(t), sin(t)] so [0, 1] is a 90 degree turn and [-1, 0] is a 180 degree turn.

jmirabel commented 2 years ago

I suppose that would be the 3rd and the 4th elements in the config list for a planar joint, which are treated as the w and z coefficients of the quaternion representing the orientation of the root joint wrt the world frame

For planar joint, the 2 last values are the rotation using unitary complex number notation. Hence the factor two you observe in the angles.

DrawZeroPoint commented 2 years ago

@jmirabel Thank you for your quick response! I wonder if the orientation of the freeflyer joint also follows the convention? Besides, could you please provide some entry-level content (paper, wiki, doc of HPP, etc.) for a better understanding of the notation?

jmirabel commented 2 years ago

For freeflyer joint, one can't use complex numbers. One has to use their generalization to 3D, i.e. quaternions.

You should look at the website. The three page under Documentation menu should give you relevant links.

florent-lamiraux commented 2 years ago

https://hal.laas.fr/hal-02995125v2, section III.B and Table I may also be helpful.

DrawZeroPoint commented 2 years ago

Thank you, I will start from that.