-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from intuitive-robots/pre/1.3.1
Pre/1.3.1
- Loading branch information
Showing
25 changed files
with
1,073 additions
and
683 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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,42 @@ | ||
import argparse | ||
import random | ||
import metaworld | ||
from simpub.sim.mj_publisher import MujocoPublisher | ||
|
||
|
||
def main(): | ||
# Arguments | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--host", type=str, default="127.0.0.1") | ||
parser.add_argument("--env_name", type=str, default="basketball-v2") | ||
args = parser.parse_args() | ||
|
||
# Initialize MetaWorld Benchmark | ||
ml1 = metaworld.ML1(args.env_name) | ||
|
||
# # Create Environment | ||
if args.env_name not in ml1.train_classes: | ||
raise ValueError( | ||
f"Environment '{args.env_name}' is not available." | ||
f"Available environments: {list(ml1.train_classes.keys())}") | ||
|
||
env = ml1.train_classes[args.env_name]() | ||
task = random.choice(ml1.train_tasks) | ||
env.set_task(task) | ||
|
||
# Initialize MujocoPublisher | ||
MujocoPublisher( | ||
env.model, | ||
env.data, | ||
host=args.host, | ||
visible_geoms_groups=list(range(3)) | ||
) | ||
|
||
# Main Loop | ||
env.reset() | ||
while True: | ||
continue | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<mujocoinclude> | ||
<body name="bat1" pos="1 0 1" childclass="contact_geom"> | ||
<geom name="bat1" type="cylinder" size="0.075 0.005" rgba="1 0 0 1" pos="-0.05 0 0" quat="0 0 1 0"/> | ||
<geom name="bat1" type="cylinder" size="0.075 0.005" rgba="1 0 0 1" pos="0.05 0 0.03" quat="0.3826834 0 0.9238795 0"/> | ||
<!-- <geom name="bat1_back" type="cylinder" size="0.075 0.0025" rgba="0 1 0 1" quat="0 0 1 0" pos="0 -0.0026 0"/> --> | ||
<geom name="handle1" type="cylinder" size="0.015 0.025" rgba="0.6 0.3 0 1" pos="0 0 0" quat="0.71 0 0.71 0"/> | ||
<!-- <geom name="handle1" type="cylinder" size="0.015 0.025" rgba="0.6 0.3 0 1" pos="0 0 0" quat="0.71 0 0.71 0"/> --> | ||
</body> | ||
<body name="bat2" pos="-1 0 1" childclass="contact_geom"> | ||
<geom name="bat2" type="cylinder" size="0.075 0.005" rgba="1 0 0 1" quat="0.71 0 0.71 0"/> | ||
<geom name="bat2_back" type="cylinder" size="0.075 0.0025" rgba="0 1 0 1" quat="0.71 0 0.71 0" pos="-0.0026 0 0"/> | ||
<geom name="handle2" type="cylinder" size="0.015 0.025" rgba="0.6 0.3 0 1" pos="0 0 0.05" quat="1 0 0 0"/> | ||
<geom name="bat2" type="cylinder" size="0.075 0.005" rgba="1 0 0 1" pos="0.05 0 0.03" quat="0.3826834 0 0.9238795 0"/> | ||
<!-- <geom name="bat2_back" type="cylinder" size="0.075 0.0025" rgba="0 1 0 1" quat="0.71 0 0.71 0" pos="-0.0026 0 0"/> | ||
<geom name="handle2" type="cylinder" size="0.015 0.025" rgba="0.6 0.3 0 1" pos="0 0 0.05" quat="1 0 0 0"/> --> | ||
</body> | ||
</mujocoinclude> |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,51 @@ | ||
import argparse | ||
|
||
import numpy as np | ||
import robosuite | ||
from robosuite.controllers import load_composite_controller_config | ||
from robosuite.wrappers import VisualizationWrapper | ||
from termcolor import colored | ||
import robocasa.models.scenes.scene_registry | ||
from termcolor import colored | ||
|
||
from simpub.sim.robocasa_publisher import RobocasaPublisher | ||
|
||
if __name__ == "__main__": | ||
# Arguments | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--host", type=str, default="127.0.0.1") | ||
parser.add_argument("--layout", type=int, default=0) | ||
parser.add_argument("--style", type=int, default=0) | ||
parser.add_argument("--robot", type=str, default="PandaOmron") | ||
args = parser.parse_args() | ||
|
||
# Create argument configuration | ||
config = { | ||
"env_name": "PnPCounterToCab", | ||
"robots": "PandaOmron", | ||
"controller_configs": load_composite_controller_config(robot=args.robot), | ||
"translucent_robot": False, | ||
} | ||
print(colored("Initializing environment...", "yellow")) | ||
env = robosuite.make( | ||
**config, | ||
has_renderer=True, | ||
has_offscreen_renderer=False, | ||
render_camera=None, | ||
ignore_done=True, | ||
use_camera_obs=False, | ||
control_freq=20, | ||
renderer="mjviewer", | ||
) | ||
|
||
# Grab reference to controller config and convert it to json-encoded string | ||
|
||
env.layout_and_style_ids = [[args.layout, args.style]] | ||
env.reset() | ||
env.render() | ||
|
||
publisher = RobocasaPublisher(env, args.host) | ||
|
||
while True: | ||
obs, _, _, _ = env.step(np.zeros(env.action_dim)) | ||
env.render() |
Oops, something went wrong.