vikashplus / robohive

A unified framework for robot learning
https://sites.google.com/view/robohive
Apache License 2.0
489 stars 82 forks source link

Task Space Mapping for Franka Kitchen environments #141

Open sriramsk1999 opened 5 months ago

sriramsk1999 commented 5 months ago

Hello,

I am trying to set up a task-space training pipeline for the Franka Kitchen environments.

My understanding is that the input to RoboHive environments is in joint-space. In the teleop script the input to the rpFrankaRobotiqData-v0 environment is simply the normalized qpos.

This does not work for the Franka Kitchen tasks. I have a trained torchRL agent which predicts the actions, qpos and qvel. I found that the env.robot._act_mode is "vel" for the Franka Kitchen environments, so I expected that the action is the normalized qvel i.e. action = env.robot.normalize_actions(qvel).

This does not work and the robot does not move as expected. What am I doing wrong?

.

PS - This seems like a bug in the normalize_actions function. Shouldn't it be:

                        act_rng = (actuator['vel_range'][1]-actuator['vel_range'][0])/2.0

instead of

                        act_rng = (actuator['vel_range'][1]-actuator['pos_range'][0])/2.0
sriramsk1999 commented 5 months ago

Using the qvel directly without normalizing gives close to expected results. Even then, it doesn't exactly follow the same trajectory as the predicted actions, but it comes quite close.

Related: #142

vikashplus commented 4 months ago

I haven't tested in cases you are using it now. This might be a good chance for me to test those. I'm traveling this week. I'll be able to take a look next week.