Skip to content

Commit 4a75e52

Browse files
authored
Merge pull request #11 from RobotControlStack/juelg/libero
feat: libero support
2 parents bcfe3f1 + a62b8b0 commit 4a75e52

File tree

6 files changed

+284
-272
lines changed

6 files changed

+284
-272
lines changed

.github/workflows/pipeline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
path: dist/
3838

3939
upload_pypi:
40-
needs: [build_dist]
40+
needs: [pipeline]
4141
runs-on: ubuntu-latest
4242
# Upload to PyPI on release
4343
if: always() && github.event_name == 'release' && github.event.action == 'published'

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ PYSRC = src
22

33
# Python
44
checkformat:
5-
isort --check-only ${PYSRC}
6-
black --check ${PYSRC}
5+
isort --check-only ${PYSRC}/vlagents
6+
black --check ${PYSRC}/vlagents
77

88
format:
99
isort ${PYSRC}

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,35 @@ The work also includes a section on related engineering challenges regarding jax
1313

1414
## Installation
1515

16+
### Pip Installation (Recommended)
17+
```shell
18+
pip install vlagents
19+
```
20+
1621
### Local Installation
1722
```shell
18-
git clone https://github.com/juelg/vlagents.git
23+
git clone https://https://github.com/RobotControlStack/vlagents.git
1924
cd vlagents
2025
pip install -ve .
2126
```
2227

23-
### Repo Installation
24-
```shell
25-
pip install git+https://github.com/juelg/vlagents.git
26-
```
2728

2829
### Environment and Policy Installation
2930
On top of vlagents you can then install a simulation environment where the agent acts.
30-
We currently support [maniskill](https://github.com/haosulab/ManiSkill) with more to come.
31+
We currently the following environments:
32+
- [maniskill](https://github.com/haosulab/ManiSkill)
33+
- [robot control stack](https://github.com/RobotControlStack/robot-control-stack)
34+
- [libero](https://github.com/Lifelong-Robot-Learning/LIBERO)
35+
36+
3137
In order to avoid dependency conflicts, use a second conda/pip environment to install your policy.
32-
We currently support [octo](https://github.com/octo-models/octo) and [openvla](https://github.com/openvla/openvla).
38+
We currently support the following policies:
39+
- [octo](https://github.com/octo-models/octo)
40+
- [openvla](https://github.com/openvla/openvla)
41+
- [openpi](https://github.com/Physical-Intelligence/openpi)
42+
- [vjepa2-ac](https://github.com/facebookresearch/vjepa2)
43+
- [diffusion policy](https://github.com/real-stanford/diffusion_policy)
44+
3345

3446
### Octo
3547
To use Octo as an agent/policy you need to create a new conda environment:
@@ -134,6 +146,9 @@ pip install -ve .
134146

135147
```
136148

149+
### Diffusion Policy
150+
Currently located on the branch `diffusion_policy`.
151+
137152
## Usage
138153
To start an vlagents server use the `start-server` command where `kwargs` is a dictionary of the constructor arguments of the policy you want to start e.g.
139154
```shell
@@ -190,9 +205,8 @@ If you find the agent useful for your work, please consider citing the original
190205
```
191206
@inproceedings{juelg2025refinedpolicydistillationvla,
192207
title={{Refined Policy Distillation}: {F}rom {VLA} Generalists to {RL} Experts},
193-
author={Tobias Jülg and Wolfram Burgard and Florian Walter},
208+
author={Tobias J{\"u}lg and Wolfram Burgard and Florian Walter},
194209
year={2025},
195210
booktitle={Proc.~of the IEEE/RSJ Int.~Conf.~on Intelligent Robots and Systems (IROS)},
196-
note={Accepted for publication.}
197211
}
198212
```

src/tests/test_libero.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
if __name__ == "__main__":
2+
import datetime
3+
import os
4+
5+
import numpy as np
6+
from PIL import Image
7+
8+
from lerobot.envs.libero import LiberoEnv
9+
from vlagents.__main__ import _run_eval
10+
from vlagents.evaluator_envs import AgentConfig, EvalConfig
11+
12+
# main_app()
13+
# test
14+
os.environ["RUN_PATH"] = "test_output"
15+
_run_eval(
16+
output_path="test_output",
17+
eval_cfgs=[
18+
EvalConfig(
19+
env_id="libero_10",
20+
env_kwargs={"controller": "OSC_POSE", "camera_heights": 256, "camera_widths": 256},
21+
max_steps_per_episode=100,
22+
)
23+
],
24+
agent_cfg=AgentConfig(host="localhost", port=8080, agent_name="test", agent_kwargs={}),
25+
n_processes=1,
26+
n_gpus=1,
27+
episodes=1,
28+
)
29+
30+
# from libero.libero import benchmark, get_libero_path
31+
# from libero.libero.envs import OffScreenRenderEnv
32+
# benchmark_dict = benchmark.get_benchmark_dict()
33+
34+
# task_suite = benchmark_dict["libero_10"]()
35+
# env = LiberoEnv(task_suite, task_id=0, task_suite_name="libero_10")
36+
# env.reset()
37+
# im = []
38+
# im2 = []
39+
# for i in range(100):
40+
# obs, reward, done, truncated, info = env.step(np.zeros(7))
41+
# im2.append(Image.fromarray(obs["pixels"]["image"]))
42+
# im.append(Image.fromarray(obs["pixels"]["image2"]))
43+
# env.close()
44+
45+
# im[0].save(
46+
# f"{str(datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S'))}.gif",
47+
# save_all=True,
48+
# append_images=im[1:],
49+
# duration=0.2 * 1000,
50+
# loop=0,
51+
# )

0 commit comments

Comments
 (0)