-
Notifications
You must be signed in to change notification settings - Fork 11
Jin/taxim cleanup #319
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
Open
tenfoldpaper
wants to merge
89
commits into
master
Choose a base branch
from
jin/taxim_cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Jin/taxim cleanup #319
Changes from all commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
ce37e63
fix: compatibility with mujoco 3.10.0
tenfoldpaper 152afdd
feat: add rcs_taxim
tenfoldpaper d10cd51
feat: working taxim demo with robotiq gripper
tenfoldpaper 0b6380e
fix: remove misplaced tactile sensor demo
tenfoldpaper 84890b5
WIP: implementation of StableBaselines3 PPO
tenfoldpaper 1f3a69d
wip: add readme instruction for starting sb3
tenfoldpaper 855c223
fix: don't flatten obs by default
tenfoldpaper 240405c
feat: add proper spaces for training and inference with parallelizati…
tenfoldpaper a769104
feat: add mesh-based box
tenfoldpaper cbccdf1
feat: add norm2tex material piping
tenfoldpaper e6a0b3e
WIP: run_ablate for physics check
tenfoldpaper 25d3772
feat: somewhat working ablation script
tenfoldpaper 15ae623
add docker container and ppo reward
debOliveira 132aabf
undo changes and add step to startgrasp wrapper
debOliveira bd560ef
remove deprecated sb3 package
tenfoldpaper 1fab445
fix(docker): link script
juelg 5771939
feat: zed cli rgb snapshot
juelg 38e0000
fix(teleop): depth in cameras
juelg 6a27ad9
chore(quest): simplify right/left swapping logic
juelg f76c77a
impr(robotiq): physical reset only in constructor
juelg 49f5565
feat: robotiq in teleop script
juelg 0671b3e
impr(gripper): improved change detection
juelg 706a868
feat(zed): add option to record both eyes
juelg 0144e47
feat(inference): add initial inference loop script
juelg 0931f92
style: format inference franka script
juelg c736087
fix(franka): inference script after testing
juelg 3f34995
feat: sim inference
juelg f3a6b73
fix: patch always open gripper observation
juelg cc9cce7
feat: reconnect and keyboard control
juelg 22fa5be
feat: optionally record
juelg 72d3ec8
feat: added mp4 video converter from recording
juelg 9d178a8
feat(mp4): added joint display
juelg 015fbbe
fix: printing and sim sleep
juelg 02ef079
feat: action chunking optionally in inference script
juelg e06bf34
feat: support for relative actions
juelg e5aafd8
feat: inference add success button
juelg 549f288
fix(storage wrapper): flush keeps last to avoid success problems
juelg 8ff3578
fix(mp4): shows joint actions if available
juelg 10cad99
fix(fr3): torque discontinuity while reset
juelg 52654fe
fix(hw camera): stop camera before stop polling thread
juelg 086e4d0
feat: using input instead of pynput
juelg 804a823
feat: add limited absolute action wrapper
juelg 9ebe4e6
feat: add limited absolute actions to inference script
juelg b59f134
stash: latest version
juelg 79ce2d2
stash: add notes
juelg bd27bf9
fix: left/right wrist camera bug
juelg 15d2693
fix: docker dependency
juelg ba1fd2d
fix(inference): image resize method to match conversion
juelg 4790f56
docs: added documentation for assets path
juelg c02ace9
fix(pypi): pin compatible pinocchio runtime deps
juelg 79626e5
fix(egl): fail fast when rendering is requested without egl
juelg 6cf3e0f
chore: rename python package to rcs_core
juelg 8a2bf7e
chore: remove global pynput dependency
juelg 8150ded
bump: version 0.7.1 → 0.7.2
juelg c57c151
build: rename rcs to rcs-core
juelg c183ca8
ci: python wheel building
juelg 2ccd738
docs: updated install instructions
juelg a1ee01f
docs: added libfranka version documentation
juelg 9680c1b
build: auditwheel repair and readded libpoco
juelg 9d886b1
build(panda): fr3 copy over
juelg a477ac2
build: fix rcs find path
juelg 70464df
build: fix license and author name
juelg e78bed5
ci: fix wheel and cibuildwheel for pipy uploading
juelg 61d6784
chore: cleanup unused codes and comments
juelg 3d6eb27
docs: added inference
juelg 39497be
style: fix format
juelg 5b61a2e
fix: resolve ruff lint errors
juelg 5c44b8c
fix: resolve mypy type errors
juelg d171c27
docs: added python headers to readme
juelg 307d7bd
fix: resolve pytest failures and StorageWrapper hang
juelg 5d0cbd7
style: fix gym warning and path obj in cli
juelg 1a4270c
Merge branch 'master' into jin/taxim_cleanup
tenfoldpaper fb1143e
format: pyformat
tenfoldpaper a1e33a0
misc: bump taxim version
tenfoldpaper 6c7ccaf
misc: update mujoco-taxim dependency
tenfoldpaper bc7511b
fix: correct EE orientation and trajectory for Robotiq
tenfoldpaper 062360d
Merge pull request #317 from RobotControlStack/upgrade-mjspec
juelg efee3d3
fix: remove deprecated test
tenfoldpaper 953051e
fix: correct version number
tenfoldpaper dbd89fe
format: pyformat
tenfoldpaper f0834bb
format: pyformat
tenfoldpaper d30044d
fix: move the digit demo to rcs/examples
tenfoldpaper 88ca551
fix: remove unnecessary files
tenfoldpaper 576c60b
fix: remove hardcoded path and rename function more clearly
tenfoldpaper 077b7fe
fix: add rcs_taxim extension to list
tenfoldpaper e9a2c0a
fix: import the file instead of class
tenfoldpaper 2fcad40
format: pyformat and pylint
tenfoldpaper 475709a
Merge branch 'master' into jin/taxim_cleanup
tenfoldpaper 9a78b34
fix: change default name in EmptyWorldFR3 to robot
tenfoldpaper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # RCS Taxim Extension | ||
|
|
||
| This extension provides integration with the [Taxim](https://github.com/Robo-Touch/Taxim) tactile sensor simulator. | ||
|
|
||
| It ports the tactile pick-up example onto the current RCS scene/config stack by swapping in a TAXIM-equipped Franka hand while reusing the current FR3 pick setup. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```shell | ||
| pip install -ve extensions/rcs_taxim | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [build-system] | ||
| requires = ["setuptools"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "rcs_taxim" | ||
| version = "0.7.2" | ||
| description = "RCS integration of mujoco-taxim" | ||
| dependencies = [ | ||
| "rcs>=0.7.2", | ||
| "omegaconf", | ||
| "mujoco-taxim@git+https://github.com/utn-air/mujoco-taxim.git@norm2tex", | ||
| ] | ||
| readme = "README.md" | ||
| maintainers = [ | ||
| { name = "Tobias Jülg", email = "tobias.juelg@utn.de" }, | ||
| { name = "Seongjin Bien", email = "seongjin.bien@utn.de" }, | ||
| ] | ||
| authors = [{ name = "Seongjin Bien", email = "seongjin.bien@utn.de" }] | ||
| requires-python = ">=3.10" | ||
|
|
||
| [tool.black] | ||
| line-length = 120 | ||
| target-version = ["py310"] | ||
|
|
||
| [tool.isort] | ||
| profile = "black" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __version__ = "0.7.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import copy | ||
| from typing import Any | ||
|
|
||
| import gymnasium as gym | ||
| import numpy as np | ||
| from rcs._core.common import GripperType, Pose | ||
| from rcs._core.sim import SimCameraConfig, SimGripperConfig | ||
| from rcs.envs.base import ControlMode, RelativeTo | ||
| from rcs.envs.configs import EmptyWorldFR3 | ||
| from rcs_taxim.taxim_wrapper import TaximSimWrapper, _robotiq2f85_digit_model_path | ||
|
|
||
| import rcs | ||
|
|
||
| _TAXIM_GRIPPER_TYPE = GripperType("Robotiq2F85Digit") | ||
|
|
||
|
|
||
| def _prefixed(name: str) -> str: | ||
| return f"gripper{name}" | ||
|
|
||
|
|
||
| def _make_camera_cfgs( | ||
| base_cfgs: dict[str, SimCameraConfig], | ||
| cam_list: tuple[str, ...], | ||
| resolution: tuple[int, int] | None, | ||
| frame_rate: int, | ||
| ) -> dict[str, SimCameraConfig]: | ||
| camera_cfgs: dict[str, SimCameraConfig] = {} | ||
| for cam in cam_list: | ||
| if cam not in base_cfgs: | ||
| available = ", ".join(sorted(base_cfgs)) | ||
| msg = f"Unknown camera {cam!r}. Available cameras: {available}" | ||
| raise ValueError(msg) | ||
| cfg = copy.deepcopy(base_cfgs[cam]) | ||
| if resolution is not None: | ||
| cfg.resolution_width = resolution[0] | ||
| cfg.resolution_height = resolution[1] | ||
| if frame_rate > 0: | ||
| cfg.frame_rate = frame_rate | ||
| camera_cfgs[cam] = cfg | ||
| return camera_cfgs | ||
|
|
||
|
|
||
| def _taxim_gripper_cfg() -> SimGripperConfig: | ||
| return SimGripperConfig( | ||
| epsilon_inner=0.005, | ||
| epsilon_outer=0.005, | ||
| seconds_between_callbacks=0.1, | ||
| ignored_collision_geoms=[], | ||
| collision_geoms=[], | ||
| collision_geoms_fingers=[], | ||
| joints=["right_driver_joint", "left_driver_joint"], | ||
| max_joint_width=0.005, | ||
| min_joint_width=1.0, | ||
| actuator="fingers_actuator", | ||
| max_actuator_width=0, | ||
| min_actuator_width=255, | ||
| gripper_type=_TAXIM_GRIPPER_TYPE, | ||
| ) | ||
|
|
||
|
|
||
| class FR3TaximSimplePickUpSimEnvCreator: | ||
| def __call__( | ||
| self, | ||
| render_mode: str = "human", | ||
| control_mode: ControlMode = ControlMode.CARTESIAN_TRPY, | ||
| resolution: tuple[int, int] | None = None, | ||
| frame_rate: int = 0, | ||
| delta_actions: bool = True, | ||
| cam_list: tuple[str, ...] | None = None, | ||
| taxim_kwargs: dict[str, Any] | None = None, | ||
| **kwargs: Any, | ||
| ) -> gym.Env: | ||
| binary_gripper = kwargs.pop("binary_gripper", True) | ||
| home_on_reset = kwargs.pop("home_on_reset", True) | ||
| max_relative_movement = kwargs.pop("max_relative_movement", None) | ||
| if kwargs: | ||
| unexpected = ", ".join(sorted(kwargs)) | ||
| msg = f"Unexpected keyword arguments: {unexpected}" | ||
| raise TypeError(msg) | ||
|
|
||
| rcs.GRIPPER_PATHS[_TAXIM_GRIPPER_TYPE] = str(_robotiq2f85_digit_model_path()) | ||
|
|
||
| scene = EmptyWorldFR3() | ||
| cfg = scene.config() | ||
| cfg.control_mode = control_mode | ||
| cfg.headless = render_mode != "human" | ||
| cfg.sim_cfg.realtime = render_mode == "human" | ||
| cfg.sim_cfg.async_control = render_mode == "human" | ||
| cfg.sim_cfg.frequency = 30 | ||
| cfg.wrapper_cfg.binary_gripper = binary_gripper | ||
| cfg.wrapper_cfg.home_on_reset = home_on_reset | ||
| cfg.max_relative_movement = ( | ||
| max_relative_movement if max_relative_movement is not None else (0.2, np.deg2rad(45)) | ||
| ) | ||
| cfg.relative_to = RelativeTo.LAST_STEP if delta_actions else RelativeTo.NONE | ||
| if not delta_actions: | ||
| cfg.max_relative_movement = None | ||
| cfg.gripper_cfgs = {"robot": _taxim_gripper_cfg()} | ||
| cfg.gripper_offsets = None | ||
| cfg.root_frame_objects = { | ||
| "": ( | ||
| rcs.OBJECT_PATHS["green_cube"], | ||
| Pose(translation=np.array([0.5, 0.0, 0.05]), quaternion=np.array([0.0, 0.0, 0.0, 1.0])), | ||
| ) | ||
| } | ||
|
|
||
| cam_list = tuple(cam_list or ()) | ||
| if cam_list: | ||
| cfg.camera_cfgs = _make_camera_cfgs(cfg.camera_cfgs or {}, cam_list, resolution, frame_rate) | ||
| cfg.camera_adds = ( | ||
| {name: cfg.camera_adds[name] for name in cam_list} if cfg.camera_adds is not None else None | ||
| ) | ||
| else: | ||
| cfg.camera_cfgs = None | ||
| cfg.camera_adds = None | ||
|
|
||
| env = scene.create_env(cfg) | ||
| merged_taxim_kwargs: dict[str, Any] = { | ||
| "taxim_sites": [_prefixed("left_digit_pad"), _prefixed("right_digit_pad")], | ||
| "taxim_pad_geoms": [_prefixed("left_digit_pad"), _prefixed("right_digit_pad")], | ||
| "target_geom_mesh_dict": {"_box_geom": "_box_geom"}, | ||
| "taxim_sensor_type": "digit", | ||
| "taxim_fps": 60, | ||
| "enable_depth": True, | ||
| "visualize": True, | ||
| } | ||
| if taxim_kwargs is not None: | ||
| merged_taxim_kwargs.update(taxim_kwargs) | ||
| env = TaximSimWrapper(env, **merged_taxim_kwargs) | ||
| if render_mode == "human": | ||
| env.get_wrapper_attr("sim").open_gui() | ||
| return env |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.