-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add Fii mobile manipulator for teleoperation and locomanipulation SDG #4191
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
9c05904
0ea8d23
a422f64
dc0903d
f3c2295
c43b46d
b9162de
148090b
0bf8f4e
4338080
d3ffa3e
42d3f2d
f746e86
14f6ad6
9a90f3b
87076fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import numpy as np | ||
| import torch | ||
| from dataclasses import dataclass | ||
|
|
||
| from isaaclab.devices import OpenXRDevice | ||
| from isaaclab.devices.retargeter_base import RetargeterBase, RetargeterCfg | ||
|
|
||
|
|
||
| class FiiRetargeter(RetargeterBase): | ||
|
|
||
| def __init__(self, cfg: "FiiRetargeterCfg"): | ||
| """Initialize the retargeter.""" | ||
| self.cfg = cfg | ||
| self._sim_device = cfg.sim_device | ||
|
|
||
| def retarget(self, data: dict) -> torch.Tensor: | ||
|
|
||
| base_vel = torch.tensor([0.0, 0.0, 0.0], dtype=torch.float32, device=self._sim_device) | ||
| base_height = torch.tensor([0.7], dtype=torch.float32, device=self._sim_device) | ||
|
|
||
| left_eef_pose = torch.tensor( | ||
| [-0.3, 0.3, 0.72648, 1.0, 0.0, 0.0, 0.0], dtype=torch.float32, device=self._sim_device | ||
| ) | ||
| right_eef_pose = torch.tensor( | ||
| [-0.3, 0.3, 0.72648, 1.0, 0.0, 0.0, 0.0], dtype=torch.float32, device=self._sim_device | ||
| ) | ||
|
|
||
| left_hand_poses = data[OpenXRDevice.TrackingTarget.HAND_LEFT] | ||
| right_hand_poses = data[OpenXRDevice.TrackingTarget.HAND_RIGHT] | ||
| left_wrist = left_hand_poses.get("wrist") | ||
| right_wrist = right_hand_poses.get("wrist") | ||
|
|
||
| if left_wrist is not None: | ||
| left_eef_pose = torch.tensor(torch.from_numpy(left_wrist), dtype=torch.float32, device=self._sim_device) | ||
| left_eef_pose[2] = left_eef_pose[2] | ||
| if right_wrist is not None: | ||
| right_eef_pose = torch.tensor(torch.from_numpy(right_wrist), dtype=torch.float32, device=self._sim_device) | ||
| right_eef_pose[2] = right_eef_pose[2] | ||
|
|
||
| gripper_value_left = self._hand_data_to_gripper_values(data[OpenXRDevice.TrackingTarget.HAND_LEFT]) | ||
| gripper_value_right = self._hand_data_to_gripper_values(data[OpenXRDevice.TrackingTarget.HAND_RIGHT]) | ||
|
|
||
| return torch.cat( | ||
| [left_eef_pose, right_eef_pose, gripper_value_left, gripper_value_right, base_vel, base_height] | ||
| ) | ||
|
|
||
| def _hand_data_to_gripper_values(self, hand_data): | ||
| thumb_tip = hand_data["thumb_tip"] | ||
| index_tip = hand_data["index_tip"] | ||
|
|
||
| distance = np.linalg.norm(thumb_tip[:3] - index_tip[:3]) | ||
|
|
||
| finger_dist_closed = 0.00 | ||
| finger_dist_open = 0.06 | ||
|
|
||
| gripper_value_closed = 0.06 | ||
| gripper_value_open = 0.00 | ||
|
|
||
| t = np.clip((distance - finger_dist_closed) / (finger_dist_open - finger_dist_closed), 0, 1) | ||
| # t = 1 -> open | ||
| # t = 0 -> closed | ||
| gripper_joint_value = (1.0 - t) * gripper_value_closed + t * gripper_value_open | ||
|
|
||
| return torch.tensor([gripper_joint_value, gripper_joint_value], dtype=torch.float32, device=self._sim_device) | ||
|
|
||
|
|
||
| @dataclass | ||
| class FiiRetargeterCfg(RetargeterCfg): | ||
| retargeter_type: type[RetargeterBase] = FiiRetargeter | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this file commit by mistake? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fiibot_W_1_V2_251016_Modified_urdf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| import gymnasium as gym | ||
| import os | ||
|
|
||
| from . import agents, fixed_base_upper_body_ik_g1_env_cfg, locomanipulation_g1_env_cfg | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please using string style for registration entry point rather than direct import https://github.com/isaac-sim/IsaacLab/pull/3803/changes |
||
| from . import agents, fixed_base_upper_body_ik_g1_env_cfg, locomanipulation_fii_env_cfg, locomanipulation_g1_env_cfg | ||
|
|
||
| gym.register( | ||
| id="Isaac-PickPlace-Locomanipulation-G1-Abs-v0", | ||
|
|
@@ -29,3 +29,10 @@ | |
| }, | ||
| disable_env_checker=True, | ||
| ) | ||
|
|
||
| gym.register( | ||
| id="Isaac-PickPlace-Locomanipulation-Fii", | ||
| entry_point="isaaclab.envs:ManagerBasedRLEnv", | ||
| kwargs={"env_cfg_entry_point": locomanipulation_fii_env_cfg.FiibotEnvCfg}, | ||
| disable_env_checker=True, | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
super().__init__(cfg)to properly handle the sim_device