Skip to content

Commit eda48ef

Browse files
awoll-bdaijbruedigam-bdaidbellicoso-bdai
authored andcommitted
Add support for mjlab
### What change is being made Add support for mjlab similar to the IsaacLab implementation. ### Why this change is being made Make exploy more useful. ### Tested Extensive test coverage. Co-authored-by: jbruedigam-bdai <jbruedigam@rai-inst.com> --------- Co-authored-by: jbruedigam-bdai <jbruedigam@rai-inst.com> Co-authored-by: Jan Bruedigam <jbruedigam@theaiinstitute.com> Co-authored-by: Dario Bellicoso <dbellicoso@theaiinstitute.com> GitOrigin-RevId: 80b0b81d04ce76362c3c830148c390509eea9920
1 parent e37b28d commit eda48ef

26 files changed

Lines changed: 4903 additions & 391 deletions

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
"python": "${workspaceFolder}/.pixi/envs/isaaclab/bin/python",
1414
"justMyCode": false
1515
},
16+
{
17+
"name": "[Examples] Export mjlab task.",
18+
"type": "debugpy",
19+
"request": "launch",
20+
"program": "${workspaceFolder}/examples/exporter_scripts/mjlab/export_mjlab.py",
21+
"console": "integratedTerminal",
22+
"python": "${workspaceFolder}/.pixi/envs/mjlab/bin/python",
23+
"justMyCode": false
24+
},
1625
{
1726
"name": "[Core] Tests.",
1827
"type": "debugpy",

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ and maximizes confidence that your policy will behave identically in simulation
3636
- **C++ Controller with ONNX Runtime Integration**:
3737
Deploy trained policies using ONNX Runtime for real-time policy execution.
3838
- **Multi-Framework Support**:
39-
Built-in support for [IsaacLab][isaaclab], with an architecture designed for extensible framework integration.
39+
Built-in support for [IsaacLab][isaaclab] and [MjLab][mjlab], with an architecture designed for extensible framework integration.
4040

4141
[isaaclab]: https://github.com/isaac-sim/IsaacLab
42+
[mjlab]: https://github.com/mujocolab/mjlab
4243

4344
## Project Structure
4445

@@ -84,6 +85,12 @@ To install with additional dependencies for `IsaacLab` integration:
8485
pip install "exploy[isaaclab]@git+https://github.com/rai-opensource/exploy.git"
8586
```
8687

88+
To install with additional dependencies for `MjLab` integration:
89+
90+
```bash
91+
pip install "exploy[mjlab]@git+https://github.com/rai-opensource/exploy.git"
92+
```
93+
8794
### C++ Controller Library
8895

8996
To consume the C++ controller library, use plain CMake commands to build and install it on your system (or to a custom prefix):
@@ -130,16 +137,30 @@ This ensures the Exploy C++ controller library is built and exposed correctly as
130137
> [!NOTE]
131138
> This example assumes you have an NVIDIA GPU available.
132139
133-
You can export an ONNX policy for an existing [IsaacLab][isaaclab] tasks:
140+
You can export an ONNX policy for an existing [IsaacLab][isaaclab] task:
134141

135142
```bash
136143
pixi run export-isaaclab
137144
```
138145

146+
Or for an existing [MjLab][mjlab] task:
147+
148+
```bash
149+
pixi run export-mjlab
150+
```
151+
139152
Then, you can run the [C++ example][cpp_example] that loads and executes the exported policy:
140153

154+
For IsaacLab:
155+
141156
```bash
142-
pixi run run-cpp-example
157+
pixi run run-cpp-example-isaaclab
158+
```
159+
160+
For MjLab:
161+
162+
```bash
163+
pixi run run-cpp-example-mjlab
143164
```
144165

145166
## Development
@@ -179,11 +200,11 @@ The editor will automatically detect the Pixi environment.
179200
- By default, the Python environment is configured for the `exploy.exporter.core` subpackage.
180201

181202
If you are working on a machine with an NVIDIA GPU, you can switch to the environment
182-
for the `exploy.exporter.frameworks.isaaclab` component:
203+
for the `exploy.exporter.frameworks.isaaclab` or `exploy.exporter.frameworks.mjlab` component:
183204

184205
- Click the Python icon in the left sidebar.
185206
- In the `Environment Managers` panel, locate `Pixi`.
186-
- Select the `exploy/isaaclab` entry and set it as the project environment.
207+
- Select the `exploy/isaaclab` or `exploy/mjlab` entry and set it as the project environment.
187208

188209
#### 4. Available Tasks
189210

@@ -240,6 +261,9 @@ pip install -e .
240261

241262
# Install the isaaclab component
242263
pip install -e ".[isaaclab]"
264+
265+
# Install the mjlab component
266+
pip install -e ".[mjlab]"
243267
```
244268

245269
Using this method, you are responsible for ensuring the consistency of the dependencies in your environment,

docs/api/frameworks/mjlab.rst

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
MjLab Framework
2+
===============
3+
4+
This section contains documentation for the MjLab framework adapter, which provides tools for
5+
exporting policies from MjLab to ONNX format using exploy.
6+
7+
8+
Environment
9+
-----------
10+
11+
The exportable environment adapter for MjLab.
12+
13+
.. automodule:: exploy.exporter.frameworks.mjlab.env
14+
:members:
15+
:undoc-members:
16+
:show-inheritance:
17+
18+
19+
Actor
20+
-----
21+
22+
Actor wrappers for RSL-RL v5 policy networks.
23+
24+
.. automodule:: exploy.exporter.frameworks.mjlab.actor
25+
:members:
26+
:undoc-members:
27+
:show-inheritance:
28+
29+
30+
Inputs
31+
------
32+
33+
Utilities for registering sensor and command inputs from MjLab managers.
34+
35+
.. automodule:: exploy.exporter.frameworks.mjlab.inputs
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:
39+
40+
41+
Outputs
42+
-------
43+
44+
Utilities for registering action outputs from MjLab managers.
45+
46+
.. automodule:: exploy.exporter.frameworks.mjlab.outputs
47+
:members:
48+
:undoc-members:
49+
:show-inheritance:
50+
51+
52+
Memory
53+
------
54+
55+
Utilities for registering memory components from MjLab managers.
56+
57+
.. automodule:: exploy.exporter.frameworks.mjlab.memory
58+
:members:
59+
:undoc-members:
60+
:show-inheritance:
61+
62+
63+
Data Sources
64+
------------
65+
66+
Adaptor classes that mirror MjLab data interfaces while managing their own
67+
tensor data for ONNX export.
68+
69+
.. automodule:: exploy.exporter.frameworks.mjlab.entity_data
70+
:members:
71+
:undoc-members:
72+
:show-inheritance:
73+
74+
.. automodule:: exploy.exporter.frameworks.mjlab.raycaster_data
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:
78+
79+
.. automodule:: exploy.exporter.frameworks.mjlab.sensor_proxy
80+
:members:
81+
:undoc-members:
82+
:show-inheritance:
83+
84+
85+
Utilities
86+
---------
87+
88+
Helper functions for MjLab integration.
89+
90+
.. automodule:: exploy.exporter.frameworks.mjlab.utils
91+
:members:
92+
:undoc-members:
93+
:show-inheritance:

docs/api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Framework-specific implementations.
2222
:maxdepth: 2
2323

2424
frameworks/isaaclab
25+
frameworks/mjlab
2526

2627
C++ API
2728
-------

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
"isaaclab_rl",
9696
"isaaclab_tasks",
9797
"isaacsim",
98+
"mjlab",
99+
"tensordict",
98100
"rsl_rl",
99101
]
100102

0 commit comments

Comments
 (0)