Skip to content

Commit

Permalink
Remove last mentions of nuserdata from codebase, improve README, ad…
Browse files Browse the repository at this point in the history
…d reference to MIT talk.

PiperOrigin-RevId: 495488238
Change-Id: Ic9f2a7a1d80025f8936a84fa3d9e883ed65f761c
  • Loading branch information
yuvaltassa authored and copybara-github committed Dec 15, 2022
1 parent 684ca0f commit 689c6fa
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,37 @@

MJPC allows the user to easily author and solve complex robotics tasks, and currently supports three shooting-based planners: derivative-based iLQG and Gradient Descent, and a simple yet very competitive derivative-free method called Predictive Sampling.

- [Overview](#overview)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Predictive Control](#predictive-control)
- [Contributing](#contributing)
- [Known Issues](#known-issues)
- [Citation](#citation)
- [Acknowledgments](#acknowledgments)
- [License and Disclaimer](#license-and-disclaimer)

## Installation
## Overview

You will need [CMake](https://cmake.org/) and a working C++20 compiler to build MJPC. We recommend using [VSCode](https://code.visualstudio.com/) and 2 of its extensions ([CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) and [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)) to simplify the build process.
To read the paper describing this software package, please see out [preprint](https://arxiv.org/abs/2212.00541).

1. Clone the repository: `git clone https://github.com/deepmind/mujoco_mpc.git`
2. Configure the project with CMake (a pop-up should appear in VSCode)
3. Build and run the `mjpc` target. This will open and run the graphical user interface.
For a quick video overview of MJPC, click below.

## Getting Started
[![Video](http://img.youtube.com/vi/Bdx7DuAMB6o/hqdefault.jpg)](https://dpmd.ai/mjpc)

For a video overview of MJPC, click below.
For a longer talk at the MIT Robotics Seminar describing our results, click below.

[![Getting Started](http://img.youtube.com/vi/Bdx7DuAMB6o/hqdefault.jpg)](https://dpmd.ai/mjpc)
[![Talk](http://img.youtube.com/vi/2xVN-qY78P4/hqdefault.jpg)](https://www.youtube.com/watch?v=2xVN-qY78P4)

For a detailed dive of the graphical user interface, see the [MJPC GUI](docs/GUI.md) documentation.

## Installation

You will need [CMake](https://cmake.org/) and a working C++20 compiler to build MJPC. We recommend using [VSCode](https://code.visualstudio.com/) and 2 of its extensions ([CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) and [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)) to simplify the build process.

1. Clone the repository: `git clone https://github.com/deepmind/mujoco_mpc.git`
2. Configure the project with CMake (a pop-up should appear in VSCode)
3. Build and run the `mjpc` target in "release" mode (VSCode defaults to "debug"). This will open and run the graphical user interface.

## Predictive Control

See the [Predictive Control](docs/OVERVIEW.md) documentation for more information.
Expand Down
2 changes: 0 additions & 2 deletions docs/OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ It is also possible to create GUI elements for parameters that are passed to th
- `lower_bound`: Real specifying lower bound of GUI slider.
- `upper_bound`: Real specifying upper bound of GUI slider.

Finally, the task file must specify `<size nuserdata="1"/>`, as that memory space is used by the planners. In our task examples, this line appears in the file [`common.xml`](../mjpc/tasks/common.xml) that also shares visual definitions across the tasks.

### Residual Specification

As mentioned above, the cost is a sum of terms, each computed as a (scalar) norm of a (vector) residual. Each term is defined as a [user sensor](https://mujoco.readthedocs.io/en/latest/XMLreference.html#sensor-user). The sensor values constitute the residual vector (implemented by the residual function, see below). The norm for each term is defined by the [`user` attribute](https://mujoco.readthedocs.io/en/latest/modeling.html#cuser) of the respective user sensor, according to the following format:
Expand Down
3 changes: 0 additions & 3 deletions mjpc/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ void Agent::Initialize(mjModel* model, mjData* data,
ResidualFunction* residual,
TransitionFunction* transition) {
// ----- model ----- //
if (!(model->nuserdata == 1)) {
mju_error("Model passed to Agent requires nuserdata == 1\n");
}
if (this->model_) mj_deleteModel(this->model_);
this->model_ = mj_copyModel(nullptr, model); // agent's copy of model

Expand Down
1 change: 0 additions & 1 deletion mjpc/tasks/common.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<mujoco>
<size nuserdata="1"/>

<visual>
<headlight ambient=".4 .4 .4" diffuse=".8 .8 .8" specular="0.1 0.1 0.1"/>
Expand Down
2 changes: 1 addition & 1 deletion mjpc/test/testdata/cartpole_task.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<mujoco model="Cart-Pole Swing-Up">
<include file="cartpole.xml" />

<size nuserdata="1" memory="40K"/>
<size memory="40K"/>

<custom>
<numeric name="agent_planner" data="0" />
Expand Down
2 changes: 1 addition & 1 deletion mjpc/test/testdata/particle_task.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<mujoco model="Particle Control">
<include file="particle.xml" />

<size nuserdata="1" memory="10K"/>
<size memory="10K"/>

<custom>
<numeric name="task_risk" data="1.0" />
Expand Down

0 comments on commit 689c6fa

Please sign in to comment.