Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement the ReKep using other robots in the Omnigibson #24

Open
goodrain553 opened this issue Nov 7, 2024 · 6 comments
Open

Comments

@goodrain553
Copy link

There are quite a lot code assert the robot model is a Fetch. And the IK solver is designed for Fetch. But I want to use other robots like FrankaPanda, What should I do? What part of the code should I modify?

@catslashbin
Copy link

I've managed to port most of the setup to FrankaPanda. However, the gripper is still not functioning. While it can plan its movements well without grasping, it currently cannot detect if an object is in its grip.

The process can be tedious, here are some key points that may help.

  1. Modify the robot type in config.yml. Also remove the robot.robot_config.controller_config.base as Franka does not have a moving base. You might also change the robot position and the workspace bounds since the robot size differs.
  2. Change the action space in environment.py. Fetch uses an action space defined as [lin_vel, ang_vel, dx, dy, dz, dax, day, daz, gripper_l, gripper_r] while Franka uses [dx, dy, dz, dax, day, daz, gripper].
  3. Adapt the end-effector coordinates. Franka’s end-effector frame origin is centered on its hand, while Fetch’s origin is positioned between its two gripper fingers. You may need to introduce an offset and apply a rotation in ReKepOGEnv.get_ee_pose().

The IK solver works fine without any changes.

@goodrain553
Copy link
Author

I've managed to port most of the setup to FrankaPanda. However, the gripper is still not functioning. While it can plan its movements well without grasping, it currently cannot detect if an object is in its grip.

The process can be tedious, here are some key points that may help.

  1. Modify the robot type in config.yml. Also remove the robot.robot_config.controller_config.base as Franka does not have a moving base. You might also change the robot position and the workspace bounds since the robot size differs.
  2. Change the action space in environment.py. Fetch uses an action space defined as [lin_vel, ang_vel, dx, dy, dz, dax, day, daz, gripper_l, gripper_r] while Franka uses [dx, dy, dz, dax, day, daz, gripper].
  3. Adapt the end-effector coordinates. Franka’s end-effector frame origin is centered on its hand, while Fetch’s origin is positioned between its two gripper fingers. You may need to introduce an offset and apply a rotation in ReKepOGEnv.get_ee_pose().

The IK solver works fine without any changes.

Thanks for your help, I will try that out

@hanlanqian
Copy link

I've managed to port most of the setup to FrankaPanda. However, the gripper is still not functioning. While it can plan its movements well without grasping, it currently cannot detect if an object is in its grip.
The process can be tedious, here are some key points that may help.

  1. Modify the robot type in config.yml. Also remove the robot.robot_config.controller_config.base as Franka does not have a moving base. You might also change the robot position and the workspace bounds since the robot size differs.
  2. Change the action space in environment.py. Fetch uses an action space defined as [lin_vel, ang_vel, dx, dy, dz, dax, day, daz, gripper_l, gripper_r] while Franka uses [dx, dy, dz, dax, day, daz, gripper].
  3. Adapt the end-effector coordinates. Franka’s end-effector frame origin is centered on its hand, while Fetch’s origin is positioned between its two gripper fingers. You may need to introduce an offset and apply a rotation in ReKepOGEnv.get_ee_pose().

The IK solver works fine without any changes.

Thanks for your help, I will try that out
Hello, I'm also endeavoring to replace the Fetch with Panda robot in the demo, but it seems to be failing in the path-solver section (as shown in the following picture). Have you ever encountered similar issues? Thank you in advance!image

@catslashbin
Copy link

@hanlanqian The orientation of Franka's end-effector frame differs from the Fetch's.
You might change the following line to grasp_cost = -np.dot(opt_pose_homo[:3, 2], preferred_dir) + 1 # [0, 1]

grasp_cost = -np.dot(opt_pose_homo[:3, 0], preferred_dir) + 1 # [0, 1]

@hanlanqian
Copy link

@hanlanqian The orientation of Franka's end-effector frame differs from the Fetch's. You might change the following line to grasp_cost = -np.dot(opt_pose_homo[:3, 2], preferred_dir) + 1 # [0, 1]

grasp_cost = -np.dot(opt_pose_homo[:3, 0], preferred_dir) + 1 # [0, 1]

Thank you for your prompt response! I discovered that it only aligns the end-effector's z-axis with the negative z-axis of the world frame. After incorporating an additional y-axis grasp cost, the subgoal solver performs effectively, enabling the generated pose to function well in tasks that require vertical pen grasping.
image

@resautu6
Copy link

@catslashbin

I've managed to port most of the setup to FrankaPanda. However, the gripper is still not functioning. While it can plan its movements well without grasping, it currently cannot detect if an object is in its grip.

The process can be tedious, here are some key points that may help.

1. Modify the robot type in `config.yml`. Also remove the `robot.robot_config.controller_config.base` as Franka does not have a moving base. You might also change the robot position and the workspace bounds since the robot size differs.

2. Change the action space in `environment.py`. Fetch uses an action space defined as `[lin_vel, ang_vel, dx, dy, dz, dax, day, daz, gripper_l, gripper_r]` while Franka uses `[dx, dy, dz, dax, day, daz, gripper]`.

3. Adapt the end-effector coordinates. Franka’s end-effector frame origin is centered on its hand, while Fetch’s origin is positioned between its two gripper fingers. You may need to introduce an offset and apply a rotation in `ReKepOGEnv.get_ee_pose()`.

The IK solver works fine without any changes.

Thanks for you solution, but I couldn't successfully run the Franka version according to your method. Could you share your modified code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants