You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a detailed dive of the graphical user interface, see the
73
72
[MJPC GUI](docs/GUI.md) documentation.
74
73
75
74
## Installation
75
+
MJPC is tested with [Ubuntu 20.04](https://releases.ubuntu.com/focal/) and [macOS-12](https://www.apple.com/by/macos/monterey/). In principle, other versions and Windows operating system should work with MJPC, but these are not tested.
This provides the exact setup we use for building MJPC for testing.
101
-
102
-
We recommend building with `clang` and not `gcc`.
149
+
This provides the exact setup we use for building MJPC for testing with Ubuntu 20.04 and macOS-12.
103
150
104
151
# Python API
152
+
We provide a simple Python API for MJPC. This API is still experimental and expects some more experience from its users. For example, the correct usage requires that the model (defined in Python) and the MJPC task (i.e., the residual and transition functions defined in C++) are compatible with each other. Currently, the Python API does not provide any particular error handling for verifying this compatibility and may be difficult to debug without more in-depth knowledge about MuJoCo and MJPC.
105
153
106
-
We provide a simple Python API for MJPC. This API is still experimental and expects some more experience from its users. For example, the correct usage requires that the model (defined in Python) and the MJPC task (i.e., the residual and transition functions defined in C++) are compatible with each other. Currently, the Python API does not provide any particular error handling for verifying this compatibility and may be difficult to debug without more in-depth knowledge about mujoco and MJPC.
154
+
## Installation
155
+
156
+
### Prerequisites
157
+
1. Build MJPC (see instructions above).
158
+
159
+
2. Python 3.10
107
160
108
-
## Installing via Pip
109
-
First, build MJPC (see above).
161
+
3. (Optionally) Create a conda environment with **Python 3.10**:
162
+
```sh
163
+
conda create -n mjpc python=3.10
164
+
conda activate mjpc
165
+
```
110
166
167
+
4. Install MuJoCo
168
+
```sh
169
+
pip install mujoco
170
+
```
171
+
172
+
### Install API
111
173
Next, change to the python directory:
112
174
```sh
113
175
cd python
@@ -123,11 +185,14 @@ Test that installation was successful:
123
185
python "mujoco_mpc/agent_test.py"
124
186
```
125
187
126
-
Additionally, the [Python version of MuJoCo](https://pypi.org/project/mujoco/#history) should match the MJPC version (this information can be found in the terminal while the application is running).
127
-
188
+
Example scripts are found in `python/mujoco_mpc/demos`. For example from `python/`:
189
+
```sh
190
+
python mujoco_mpc/demos/agent/cartpole_gui.py
191
+
```
192
+
will run the MJPC GUI application using MuJoCo's passive viewer via Python.
128
193
129
-
##Example Usage
130
-
See [cartpole.py](python/mujoco_mpc/demos/agent/cartpole.py) for example usage for planning.
194
+
### Python API Installation Issues
195
+
If your installation fails or is terminated prematurely, we recommend deleting the MJPC build directory and starting from scratch as the build will likely be corrupted. Additionally, delete the files generated during the installation process from the `python/` directory.
0 commit comments