-
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.
docker experience seems to work (#50)
- Loading branch information
Showing
4 changed files
with
111 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Set the display env variable | ||
export DISPLAY=:99 | ||
export VGL_DISPLAY="egl" | ||
|
||
# Start Xvfb | ||
Xvfb $DISPLAY -screen 0 1024x768x24 -nolisten tcp -nolisten unix +extension GLX > /dev/null 2>&1 & | ||
|
||
# Wait a little for Xvfb to start | ||
sleep 2 | ||
|
||
echo "Xvfb started on display $DISPLAY" | ||
|
||
# If VGL_DEVICE is set, then use it. Else use egl0. | ||
if [ -z "$VGL_DEVICE" ]; then | ||
VGL_DEVICE="egl0" | ||
fi | ||
|
||
echo "Using VirtualGL device: $VGL_DEVICE" | ||
|
||
# Run your OpenGL application with VirtualGL (add +v command if needed.) | ||
vglrun \ | ||
-d $VGL_DEVICE \ | ||
-ld /opt/baeisner/.pyenv/versions/3.9.12/lib/python3.9/site-packages/torch/lib \ | ||
"$@" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import time | ||
|
||
import numpy as np | ||
from rlbench.action_modes.action_mode import MoveArmThenGripper | ||
from rlbench.action_modes.arm_action_modes import JointVelocity | ||
from rlbench.action_modes.gripper_action_modes import Discrete | ||
from rlbench.environment import Environment | ||
from rlbench.tasks import FS10_V1 | ||
|
||
action_mode = MoveArmThenGripper( | ||
arm_action_mode=JointVelocity(), gripper_action_mode=Discrete() | ||
) | ||
env = Environment(action_mode, headless=True) | ||
env.launch() | ||
|
||
train_tasks = FS10_V1["train"] | ||
test_tasks = FS10_V1["test"] | ||
task_to_train = np.random.choice(train_tasks, 1)[0] | ||
task = env.get_task(task_to_train) | ||
task.sample_variation() # random variation | ||
descriptions, obs = task.reset() | ||
|
||
# Step for 10s wall clock time | ||
start = time.time() | ||
while time.time() - start < 10: | ||
obs, reward, terminate = task.step(np.random.normal(size=env.action_shape)) |