-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ebe9c2
commit ea31592
Showing
1 changed file
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import robosuite as suite | ||
from robosuite.controllers import load_controller_config | ||
import numpy as np | ||
|
||
# Load the desired controller's default config as a dict | ||
config = load_controller_config(default_controller="OSC_POSE") | ||
env_config = {} | ||
env_config["env_name"] = "Lift" | ||
env_config["robots"] = "Panda" | ||
env_config["camera_names"] = ["frontview"] | ||
env_config["camera_heights"] = 480 | ||
env_config["camera_widths"] = 480 | ||
env_config["control_freq"] = 10 | ||
env_config["controller_configs"] = suite.load_controller_config(default_controller="OSC_POSE") | ||
env_config["has_renderer"] = False | ||
env_config["has_offscreen_renderer"] = False | ||
env_config["ignore_done"] = True | ||
env_config["use_camera_obs"] = False | ||
|
||
# Make the environment | ||
env = suite.make(**env_config) | ||
|
||
# Reset the environment | ||
env.reset() | ||
|
||
# Get action limits | ||
low, high = env.action_spec | ||
|
||
# do visualization | ||
for i in range(10000): | ||
action = np.random.uniform(low, high) | ||
obs, reward, done, _ = env.step(action) | ||
|
||
# Print action and corresponding torque from the environment. Format them so it's clear | ||
print(f"Action: {action}") | ||
print(f"Torque: {env.sim.data.ctrl}") |