https://github.com/leggedrobotics/mpc-net
Accompanying code for the publication "MPC-Net: A First Principles Guided Policy Search"
https://github.com/leggedrobotics/mpc-net
Last synced: 11 months ago
JSON representation
Accompanying code for the publication "MPC-Net: A First Principles Guided Policy Search"
- Host: GitHub
- URL: https://github.com/leggedrobotics/mpc-net
- Owner: leggedrobotics
- License: mit
- Created: 2019-11-28T14:50:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T02:21:25.000Z (over 6 years ago)
- Last Synced: 2025-04-06T20:46:29.227Z (about 1 year ago)
- Language: Python
- Size: 9.77 KB
- Stars: 89
- Watchers: 6
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MPC-Net
This package contains supplementary code and implementation details for the [publication](https://doi.org/10.1109/LRA.2020.2974653)
> J. Carius, F. Farshidian and M. Hutter, "MPC-Net: A First Principles Guided Policy Search," in IEEE Robotics and Automation Letters, vol. 5, no. 2, pp. 2897-2904, April 2020.
A preprint is available on [arxiv](https://arxiv.org/pdf/1909.05197.pdf).
While licensing restrictions do not allow us to release the ANYmal model,
we are providing our training script with an alternative ball-balancing robot.
## Dependencies
* [OCS2 Toolbox](https://bitbucket.org/leggedrobotics/ocs2/)
* [Pybind11](https://github.com/pybind/pybind11)
* [Pytorch](https://pytorch.org/)
* [TensorboardX](https://pypi.org/project/tensorboardX/)
* [Matplotlib](https://matplotlib.org/)
## Setup Instructions
* Build and install Pybind11 according to the instructions in their documentation.
Make sure CMake can locate the Pybind11 installation, for example by adding the install path to your `CMAKE_PREFIX_PATH`.
* Clone [OCS2](https://bitbucket.org/leggedrobotics/ocs2/) into the source folder of a catkin workspace.
Then build the python bindings for the optimal control solver with
`catkin build ocs2_ballbot_example --cmake-args -DUSE_PYBIND_PYTHON_3=ON`
* Install required python packages
`pip3 install torch tensorboardX matplotlib`
Note that we use python3 as it is required for pytorch.
## Running the Policy Training
Make sure your catkin workspace is sourced in the current terminal.
The policy training can then be started with the command
`python3 ballbot_learner.py`
To monitor progress, execute tensorboard
`tensorboard --logdir runs`
During training, the policy will be saved to disk in regular intervals.
The performance of the policy on the internal model can be visualized by running the script
`python3 ballbot_evaluation.py`