Skip to content
Open

Dev #155

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1c8c448
Create pointcloud_utils.py
Wenxuan-Zhou Apr 20, 2023
64a96ab
Merge branch 'vikashplus:main' into main
Wenxuan-Zhou Nov 4, 2023
eb8faa5
point cloud utility functions with an example
Wenxuan-Zhou Nov 13, 2023
424d2be
flip back depth image
Wenxuan-Zhou Nov 26, 2023
08f9fa1
Merge branch 'dev' into main
vikashplus Apr 18, 2024
a43298c
Merge pull request #85 from Wenxuan-Zhou/main
vikashplus Apr 18, 2024
ae02682
DOCS: Improved information on different verbosity patterns
vikashplus Apr 21, 2024
f039625
DOCS: Udpating the docs to clearly outline the models edits
vikashplus Apr 21, 2024
63b44ad
BUGFIX: Envs re-defininng their resets were missing the gym/gymnasium…
vikashplus Apr 21, 2024
a9d227e
BUGFIX: Fixing return type issues of envs with custom reset
vikashplus Apr 30, 2024
88110c9
np.product -> np.prod for np 2.0 compatibility
Jun 24, 2024
4271114
UPDATE:Upgrading the render_cams tutorial to official mujoco binding
vikashplus Oct 24, 2024
99ca9ac
Merge pull request #147 from vmoens/patch-2
vikashplus Oct 24, 2024
28d0777
bump pyh5 and pin numpy
Vittorio-Caggiano Oct 24, 2024
2d4a865
pin numpy
Vittorio-Caggiano Oct 24, 2024
3efa119
Merge pull request #151 from vikashplus/fix_dependencies
vikashplus Oct 24, 2024
9a72ad2
DataConsistency and 2D plotting support
vikashplus Nov 17, 2024
29f7346
BUGFIX: Mark the trace as closed post load
vikashplus Nov 26, 2024
5625b2d
MINOR: Fix broken links
vikashplus May 7, 2026
1d2989b
MINOR: Make precision consistent between envs base and obs_dict. This…
vikashplus May 11, 2026
66c4a0b
MINOR: Formatting
vikashplus May 11, 2026
7eaab0b
MINOR:Unwarpping to read env_info as per gymnasium suggestions
vikashplus May 11, 2026
3d7b862
Removing unused files
vikashplus May 12, 2026
640e0f9
Merge pull request #157 from vikashplus/ur
vikashplus May 12, 2026
4ad3247
dependency update and code alignment
andreh1111 May 12, 2026
c7359a3
Merge pull request #158 from vikashplus/update_dependencies
vikashplus May 12, 2026
b17a67f
fix typo
andreh1111 May 12, 2026
43b2315
Update python-app.yml
andreh1111 May 12, 2026
121e7f9
Merge pull request #159 from vikashplus/fix_typo
andreh1111 May 12, 2026
ff6ecd6
Merge pull request #160 from vikashplus/fix_workflow
andreh1111 May 12, 2026
1dd2a84
update actuator_moment usage for mujoco 3.3.3
andreh1111 May 12, 2026
dfa3387
Merge pull request #161 from vikashplus/fix_actuator_moment
andreh1111 May 12, 2026
0abc986
Update mj_sim_scene.py
andreh1111 May 12, 2026
0641e57
Merge pull request #162 from vikashplus/fix_test
andreh1111 May 13, 2026
b796c74
FEATURE: Added tendon related sensors and actuators support to the ro…
vikashplus Jun 24, 2026
49a1e98
REFACTOR: Registration info is only displayed once
vikashplus Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,25 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install mesa and patchelf
run: |
sudo apt-get update -y -qq
sudo apt-get install -y \
libgl1-mesa-dev \
libgl1-mesa-glx \
libgl1 \
libglx-mesa0 \
libglew-dev \
libosmesa6-dev \
software-properties-common
sudo apt-get install -y patchelf
sudo apt-get update -y -qq
sudo apt-get install -y xvfb x11-xserver-utils
software-properties-common \
patchelf \
xvfb \
x11-xserver-utils
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &

- name: Install ffmpeg
Expand All @@ -46,6 +50,7 @@ jobs:

- name: Checkout submodules
run: git submodule update --init --recursive

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -56,10 +61,6 @@ jobs:
- name: Run MuJoCo Rendering test
run: python3 -m mujoco.render_test

# - name: Test RoboHive (Fetching SimHive via git-submodules)
# run: |
# python robohive/tests/test_all.py

- name: Test RoboHive (Programmatically fetching SimHive)
run: |
rm -rf robohive/simhive
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
url = https://github.com/vikashplus/robotiq_sim.git
[submodule "robohive/simhive/myo_sim"]
path = robohive/simhive/myo_sim
url = https://github.com/MyoHub/myo_sim.git
url = https://github.com/MyoHub/myo_sim.git
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ MultiTask Suite
This suite contains a collection of environments centered around dexterous manipulation. Standard [TCDM benchmarks](https://pregrasps.github.io/) are a part of this suite

## - ROBEL Suite (Coming soon)
This suite contains a collection of environments centered around real-world locomotion and manipulation. Standard [ROBEL benchmarks](http://roboticsbenchmarks.org/) are a part of this suite
This suite contains a collection of environments centered around real-world locomotion and manipulation. Standard [ROBEL benchmarks](https://sites.google.com/view/roboticsbenchmarks) are a part of this suite

# Citation
If you find `RoboHive` useful in your research,
Expand Down
7 changes: 5 additions & 2 deletions robohive/envs/arms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
# from gym.envs.registration import register
from robohive.utils import gym; register=gym.register

from robohive.envs.env_variants import register_env_variant
import os

from robohive.envs.env_variants import register_env_variant
from robohive.utils.prompt_utils import Prompt, prompt

curr_dir = os.path.dirname(os.path.abspath(__file__))

print("RoboHive:> Registering Arms Envs")
prompt("RoboHive:> Registering Arms Envs", Prompt.ONCE)

# FRANKA REACH =======================================================================
from robohive.envs.arms.reach_base_v0 import ReachBaseV0
Expand Down
5 changes: 4 additions & 1 deletion robohive/envs/claws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

from robohive.utils import gym; register=gym.register
import os

curr_dir = os.path.dirname(os.path.abspath(__file__))
from robohive.envs.env_variants import register_env_variant
from robohive.utils.prompt_utils import Prompt, prompt

prompt("RoboHive:> Registering Claw Envs", Prompt.ONCE)

print("RoboHive:> Registering Claw Envs")

# TRIFINGER REORIENT =======================================================================
from robohive.envs.claws.reorient_v0 import ReorientBaseV0
Expand Down
31 changes: 19 additions & 12 deletions robohive/envs/env_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
License :: Under Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
================================================= """

from robohive.utils import gym
import numpy as np
import os
import time as timer
from sys import platform

from robohive.envs.obs_vec_dict import ObsVecDict
from robohive.utils import tensor_utils
from robohive.robot.robot import Robot
from robohive.utils.implement_for import implement_for
from robohive.utils.prompt_utils import prompt, Prompt
import numpy as np
import skvideo.io
from sys import platform
from robohive.physics.sim_scene import SimScene

import robohive.utils.import_utils as import_utils
from robohive.envs.env_variants import gym_registry_specs
from robohive.envs.obs_vec_dict import ObsVecDict
from robohive.physics.sim_scene import SimScene
from robohive.robot.robot import Robot
from robohive.utils import gym, tensor_utils
from robohive.utils.implement_for import implement_for
from robohive.utils.prompt_utils import Prompt, prompt

# TODO
# remove rwd_mode
Expand Down Expand Up @@ -183,7 +183,14 @@ def forward(self, x):
if "rrl" in id_encoder or "resnet" in id_encoder:
import_utils.torchvision_isavailable()
import torchvision.transforms as T
from torchvision.models import resnet50, ResNet50_Weights, resnet34, ResNet34_Weights, resnet18, ResNet18_Weights
from torchvision.models import (
ResNet18_Weights,
ResNet34_Weights,
ResNet50_Weights,
resnet18,
resnet34,
resnet50,
)

if "r3m" in id_encoder:
import_utils.torchvision_isavailable()
Expand Down Expand Up @@ -495,8 +502,8 @@ def get_input_seed(self):

def _reset(self, reset_qpos=None, reset_qvel=None, seed=None, **kwargs):
"""
Reset the environment
Default implemention provided. Override if env needs custom reset
Reset the environment (Default implemention provided).
Override if env needs custom reset. Carefully handle return type for gym/gymnasium compatibility
"""
qpos = self.init_qpos.copy() if reset_qpos is None else reset_qpos
qvel = self.init_qvel.copy() if reset_qvel is None else reset_qvel
Expand Down
7 changes: 6 additions & 1 deletion robohive/envs/fm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from robohive.utils import gym; register=gym.register

import numpy as np
import os

import numpy as np

curr_dir = os.path.dirname(os.path.abspath(__file__))
from robohive.utils.prompt_utils import Prompt, prompt

prompt("RoboHive:> Registering FM Envs", Prompt.ONCE)

# Reach to fixed target
# register(
Expand Down
8 changes: 6 additions & 2 deletions robohive/envs/hands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
================================================= """

from robohive.utils import gym; register=gym.register
import os

from robohive.envs.env_variants import register_env_variant
import os
from robohive.utils.prompt_utils import Prompt, prompt

curr_dir = os.path.dirname(os.path.abspath(__file__))

print("RoboHive:> Registering Hand Envs")
prompt("RoboHive:> Registering Hand Envs", Prompt.ONCE)

# ==================================================================================
# V1 envs:
Expand Down Expand Up @@ -64,6 +66,7 @@
)
from robohive.envs.hands.relocate_v1 import RelocateEnvV1


# Reach to random target using visual inputs
def register_visual_envs(env_name, encoder_type):
register_env_variant(
Expand Down Expand Up @@ -102,6 +105,7 @@ def register_visual_envs(env_name, encoder_type):
}
)
from robohive.envs.hands.baoding_v1 import BaodingFixedEnvV1

register(
id='baoding4th-v1',
entry_point='robohive.envs.hands:BaodingFixedEnvV1',
Expand Down
6 changes: 2 additions & 4 deletions robohive/envs/hands/baoding_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ def reset(self, reset_pose=None, reset_vel=None, reset_goal=None, time_period=6,
self.goal = self.create_goal_trajectory(time_period=time_period) if reset_goal is None else reset_goal.copy()

# reset scene
obs = super().reset(reset_qpos=reset_pose, reset_qvel=reset_vel, **kwargs)
return obs
return super().reset(reset_qpos=reset_pose, reset_qvel=reset_vel, **kwargs)

def create_goal_trajectory(self, time_step=.1, time_period=6):
len_of_goals = 1000 # assumes that its greator than env horizon
Expand Down Expand Up @@ -326,5 +325,4 @@ def create_goal_trajectory(self, time_step=.1, time_period=6):
class BaodingRandomEnvV1(BaodingFixedEnvV1):

def reset(self, **kwargs):
obs = super().reset(time_period = self.np_random.uniform(high=5, low=7), **kwargs)
return obs
return super().reset(time_period = self.np_random.uniform(high=5, low=7), **kwargs)
8 changes: 2 additions & 6 deletions robohive/envs/hands/door_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,13 @@ def get_reward_dict(self, obs_dict):
return rwd_dict


def reset(self, reset_qpos=None, reset_qvel=None, **kwargs):
def reset(self, **kwargs):
self.sim.reset()
qp = self.init_qpos.copy() if reset_qpos is None else reset_qpos
qv = self.init_qvel.copy() if reset_qvel is None else reset_qvel
self.robot.reset(reset_pos=qp, reset_vel=qv, **kwargs)

self.sim.model.body_pos[self.door_bid,0] = self.np_random.uniform(low=-0.3, high=-0.2)
self.sim.model.body_pos[self.door_bid, 1] = self.np_random.uniform(low=0.25, high=0.35)
self.sim.model.body_pos[self.door_bid,2] = self.np_random.uniform(low=0.252, high=0.35)
self.sim.forward()
return self.get_obs()
return super().reset(**kwargs)


def get_env_state(self):
Expand Down
9 changes: 3 additions & 6 deletions robohive/envs/hands/hammer_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,12 @@ def get_obs_dict(self, sim):
return obs_dict


def reset(self, reset_qpos=None, reset_qvel=None, **kwargs):
def reset(self, **kwargs):
self.sim.reset()
qp = self.init_qpos.copy() if reset_qpos is None else reset_qpos
qv = self.init_qvel.copy() if reset_qvel is None else reset_qvel
self.robot.reset(reset_pos=qp, reset_vel=qv, **kwargs)

self.sim.model.body_pos[self.target_bid,2] = self.np_random.uniform(low=0.1, high=0.25)
self.sim.forward()
return self.get_obs()
return super().reset(**kwargs)


def get_env_state(self):
"""
Expand Down
9 changes: 2 additions & 7 deletions robohive/envs/hands/pen_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,14 @@ def get_reward_dict(self, obs_dict):
return rwd_dict


def reset(self, reset_qpos=None, reset_qvel=None, **kwargs):
def reset(self, **kwargs):
self.sim.reset()
qp = self.init_qpos.copy() if reset_qpos is None else reset_qpos
qv = self.init_qvel.copy() if reset_qvel is None else reset_qvel
self.robot.reset(reset_pos=qp, reset_vel=qv, **kwargs)

desired_orien = np.zeros(3)
desired_orien[0] = self.np_random.uniform(low=-1, high=1)
desired_orien[1] = self.np_random.uniform(low=-1, high=1)
self.sim.model.body_quat[self.target_obj_bid] = euler2quat(desired_orien)
self.sim.forward()

return self.get_obs()
return super().reset(**kwargs)


def get_env_state(self):
Expand Down
10 changes: 3 additions & 7 deletions robohive/envs/hands/relocate_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,16 @@ def get_obs_dict(self, sim):
return obs_dict


def reset(self, reset_qpos=None, reset_qvel=None, **kwargs):
def reset(self, **kwargs):
self.sim.reset()
qp = self.init_qpos.copy() if reset_qpos is None else reset_qpos
qv = self.init_qvel.copy() if reset_qvel is None else reset_qvel
self.robot.reset(reset_pos=qp, reset_vel=qv, **kwargs)


self.sim.model.body_pos[self.obj_bid,0] = self.np_random.uniform(low=-0.15, high=0.15)
self.sim.model.body_pos[self.obj_bid,1] = self.np_random.uniform(low=-0.15, high=0.3)
self.sim.model.site_pos[self.target_obj_sid, 0] = self.np_random.uniform(low=-0.2, high=0.2)
self.sim.model.site_pos[self.target_obj_sid,1] = self.np_random.uniform(low=-0.2, high=0.2)
self.sim.model.site_pos[self.target_obj_sid,2] = self.np_random.uniform(low=0.15, high=0.35)
self.sim.forward()
return self.get_obs()
return super().reset(**kwargs)


def get_env_state(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion robohive/envs/multi_task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This suite is designed to study generalization in multi-task settings. RoboHive's multi-task suite builds from `FrankaKitchen` environements originally studied in the [Relay Policy Learning](https://relay-policy-learning.github.io/) project.

# Franka Kitchen
`FrankaKitchen` domain offers a challenging set of manipulation problems in an unstructured environment with many possible tasks to perform. The original set consisted of a franka robot in a kitchen domain. Overtime, Franka Kitchen has became a popular choice of environments for studying multi-task generalization. Its widespread use has led to a few different publically available variations. To help navigate these changes, we name these variations and document its evolution of across various versions below -
`FrankaKitchen` domain offers a challenging set of manipulation problems in an unstructured environment with many possible tasks to perform. The original set consisted of a franka robot in a kitchen domain. Overtime, Franka Kitchen has became a popular choice of environments for studying multi-task generalization. Its widespread use has led to a few different publically available variations. To help navigate these changes, we name these variations and document its evolution across various versions below -

## Change log/ History

Expand Down
6 changes: 3 additions & 3 deletions robohive/envs/multi_task/multi_task_base_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ def get_reward_dict(self, obs_dict):
# Optional Keys
("obj_goal", -np.sum(goal_dist, axis=-1)),
("bonus",
1.0*np.product(goal_dist < 5 * self.obj["dof_proximity"], axis=-1)
1.0*np.prod(goal_dist < 5 * self.obj["dof_proximity"], axis=-1)
# np.product(goal_dist < 0.75 * self.obj["dof_ranges"], axis=-1)
+ 1.0*np.product(goal_dist < 1.67 * self.obj["dof_proximity"], axis=-1),
+ 1.0*np.prod(goal_dist < 1.67 * self.obj["dof_proximity"], axis=-1),
# + np.product(goal_dist < 0.25 * self.obj["dof_ranges"], axis=-1),
),
("pose", -np.sum(np.abs(obs_dict["pose_err"]), axis=-1)),
Expand Down Expand Up @@ -272,4 +272,4 @@ def set_obj_goal(self, obj_goal=None, interact_site=None):
elif type(interact_site) is str: # overwrite using name
self.interact_sid = self.sim.model.site_name2id(interact_site)
elif type(interact_site) is int: # overwrite using id
self.interact_sid = interact_site
self.interact_sid = interact_site
5 changes: 3 additions & 2 deletions robohive/envs/multi_task/substeps1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

import os
from robohive.utils import gym; register=gym.register

from robohive.utils.prompt_utils import Prompt, prompt

CURR_DIR = os.path.dirname(os.path.abspath(__file__))

# Appliences ============================================================================
print("RoboHive:> Registering Appliances Envs")
prompt("RoboHive:> Registering Appliances Envs", Prompt.ONCE)

from robohive.envs.multi_task.common.franka_appliance_v1 import FrankaAppliance

# MICROWAVE
register(
id="franka_micro_open-v3",
Expand Down
3 changes: 2 additions & 1 deletion robohive/envs/multi_task/substeps2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
Source :: https://github.com/vikashplus/robohive
License :: Under Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
================================================= """
from robohive.utils.prompt_utils import Prompt, prompt

print("RoboHive:> Registering Multi-Task (2 subtasks) Envs")
prompt("RoboHive:> Registering Multi-Task (2 subtasks) Envs", Prompt.ONCE)
from robohive.envs.multi_task.substeps1.franka_kitchen import register_all_env_variants

# ===================================================================
Expand Down
4 changes: 2 additions & 2 deletions robohive/envs/multi_task/utils/parse_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def render_demos(env, data, filename='demo_rendering.mp4', render=None):

# playback demos and get data(physics respected)
def gather_training_data(env, data, filename='demo_playback.mp4', render=None):
env = env.env
env = env.unwrapped
FPS = 30
render_skip = max(1, round(1. / \
(FPS * env.sim.model.opt.timestep * env.frame_skip)))
Expand Down Expand Up @@ -127,7 +127,7 @@ def gather_training_data(env, data, filename='demo_playback.mp4', render=None):
# normalization and env stepping
act = (ctrl - act_mid) / act_rng
act = np.clip(act, -0.999, 0.999)
next_obs, reward, done, env_info = env.step(act)
next_obs, reward, done, *_, env_info = env.step(act)
path_reward += reward

# populate path
Expand Down
Loading
Loading