carlosferrazza / humanoid-bench

Other
288 stars 27 forks source link

About dof of robots and observation_space dimensions. #11

Open Xianqi-Zhang opened 1 week ago

Xianqi-Zhang commented 1 week ago

Hi, Thanks for your sharing.

  1. As described on the unitree H1 website, the dof of each leg is 5 (Hip×3 + Knee×1 + Ankle×1) and the dof of each arm is 4, i.e., a total of 18 dof. But the dof of H1 is 26 in the code, so what positions do the other dof correspond to? https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/robots.py#L1-L2

  2. The dof of [H1Hand, H1Touch, H1Strong] is set to 76, they are H1 with 2 hands. In the paper, "..., additional 42-DoFs with two dexterous Shadow Hands..." (page 8, under Fig.7). But 26 (H1) + 42 (two dexterous Shadow Hands) is 68. Where are the remaining dof?

https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/robots.py#L75-L84

If possible, could you tell me the corresponding relationship between each value (dof) and joint? https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/envs/basic_locomotion_envs.py#L22-L26

  1. As illustrated in the paper, observations related part, " Proprioceptive robot state (i.e. joint angles and velocities) and task-relevant environment observations (i.e. object poses and velocities)." In envs, the observation_space() often use self.robot.dof * 2 - 1 and self.dof * 2 - 1. What does -1 correspond to?

https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/envs/basic_locomotion_envs.py#L35 https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/envs/powerlift.py#L41 https://github.com/carlosferrazza/humanoid-bench/blob/3951d65bc85e16a562d091a7f4820150c20ed91f/humanoid_bench/envs/basketball.py#L45

Thanks for your any reply. Best regards.

The picture is h1 robot, and 'x' is the dof I marked (rotation joint, 1 dof), maybe not right. h1_x

Xianqi-Zhang commented 1 week ago

Hi, I check the robot xml definition, but still have some questions, especially for H1hand. Is there additional orientation for each hand ?

Robot: H1
Dof: 26
Acturator: 19 (relative to action space)
    - Body: 19
Positions + Orientation: 3 + 4 = 7  
(robot global pos and orientation, also relative to a freejoint that named free_base)

--> 19 + 7 = 26
Robot: H1hand
Acturator: 19 + 2 + 40 = 61
    - Body: 19 (relative to action space)
    - Wrist: 2 (left and right)
    - Hand: 20 * 2 = 40
Positions + Orientation: 3 + 4 = 7

Position for each hand: same as wrist ?
Orientation for each hand: 4 * 2 = 8 ?

--> 61 + 7 + 8 = 76

Thanks for your any reply.

Best regards.

carlosferrazza commented 1 day ago

Hi @Xianqi-Zhang, in the code we set the dof variable with the number of positional degrees of freedom. For the H1 robot, the velocities are one less than dof (due to using cartesian angular velocities as opposed to quaternions). This is why we often use the formulation 2 * dof - 1 to compute the robot state as the concatenation of positions and velocities.

With regard to your second post, as noted in the paper, see Table III in the appendix, the Shadow Hands add additional 50 dofs to the environment.

An important clarification to make is that with dof in the code we essentially refer to the length of qpos, while in the paper the dofs are always referring to the cartesian space (i.e., equal to the length of qvel in Mujoco). Hope this helps!