Skip to content

Commit fe05cec

Browse files
committed
doc: update readme
1 parent 41c56e6 commit fe05cec

File tree

3 files changed

+9
-47
lines changed

3 files changed

+9
-47
lines changed

examples/plate-balancing/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cc_binary(
3333

3434
cc_binary(
3535
name = "run_osc_controller",
36-
srcs = ["plate_balancing_osc_controller.cc"],
36+
srcs = ["franka_osc_controller.cc"],
3737
data = [
3838
":urdfs",
3939
"@drake_models//:franka_description",

examples/plate-balancing/README.md

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,33 @@
1-
## Experiment Instructions
1+
# Plate-Balancing
22

3-
Central repo for C3 and its examples, including:
4-
- https://arxiv.org/abs/2405.08731
3+
This repository contains code for balancing a tray on the Franka Emika Panda robot, using Contact-Implicit Model Predictive Control (C3-MPC). The controller leverages contacts with the environment to perform manipulation tasks.
54

6-
This branch/repo is being constantly updated so examples may be unstable.
5+
https://arxiv.org/abs/2405.08731
76

87
## Simulated Robot
98

10-
1. Start the procman script containing a list of relevant processes
9+
1. Start the procman script from the workspace directory (dairlib). It contains a list of relevant processes
1110
```
12-
bot-procman-sheriff -l run_simulation.pmd
11+
bot-procman-sheriff -l examples/plate-balancing/procman/plate_balancing_simulation.pmd
1312
```
1413

15-
2. In the procman window, start the operator processes (meshcat visualizer) using the script `script:start_operator_commands`. Scripts are located in the top bar of the procman window.
14+
2. In the procman window, start the operator processes (meshcat visualizer) using the script `script > start_operator_commands`. Scripts are located in the top bar of the procman window.
1615

1716
3. The meshcat visualizer can be viewed by opening a browser and navigating to `localhost:7000`
1817

19-
4. The examples with the C3 controller can be run using the script `script:c3_mpc`. Note, the task can be changed by changing the `scene_index` in the parameters. More details in [changing the scene](#changing-the-scene). This script spawns three processes:
18+
4. The examples with the C3 controller can be run using the script `script > c3_mpc`. Note, the task can be changed by changing the `scene_index` in the parameters. More details in [changing the scene](#changing-the-scene). This script spawns three processes:
2019
- `bazel-bin/examples/plate-balancing/run_simulation`: Simulated environment which takes in torques commands from `franka_osc` and publishes the state of the system via LCM on various channels.
2120
- `bazel-bin/examples/plate-balancing/run_osc_controller`: Low-level task-space controller that tracks task-space trajectories it receives from the MPC
2221
- `bazel-bin/examples/plate-balancing/run_c3_controller`: Contact Implicit MPC controller that takes in the state of the system and publishes end effector trajectories to be tracked by the OSC.
2322

2423
5. The simulator and controller can be stopped using the script `script:stop_controllers_and_simulators`.
2524
6. A comparison using the sampling based MPC controllers from the [MJMPC controllers](https://github.com/google-deepmind/mujoco_mpc) can be run using `script:mjmpc_with_drake_sim`. This extracts out just the controller portion of the MJMPC code base and runs in on the identical task (scene 1) in the Drake simulator. Instructions to build and configure the standalone MJMPC controllers are a WIP.
2625

27-
## Physical Robot
28-
29-
Hardware instructions updated for Ubuntu 22.04. We are no longer using ROS or ROS2 and instead relying on [drake-franka-driver](https://github.com/RobotLocomotion/drake-franka-driver), which works via LCM. Much thanks to the Drake developers who provided this!
30-
31-
### Installing `drake-franka-driver`
32-
33-
```
34-
git clone https://github.com/RobotLocomotion/drake-franka-driver
35-
cd drake-franka-driver
36-
bazel build ...
37-
```
38-
39-
40-
### Running Experiments
41-
42-
1. Start the procman script containing a list of relevant processes. The primary differences from`run_simulation.pmd` script are the lcm_channels and the drake-franka-driver and corresponding translators to communicate with the Franka via LCM.
43-
44-
- In the root of dairlib: ``` bot-procman-sheriff -l examples/plate-balancing/franka_hardware.pmd ```
45-
- In the root of drake-franka-driver: ```bot-procman-deputy franka_control```
46-
47-
2. In the procman window, start the operator processes (meshcat visualizer and xbox controller) using the script `script:start_operator_commands`. Scripts are located in the top bar of the procman window.
48-
49-
3. The meshcat visualizer can be viewed by opening a browser and navigating to `localhost:7000`
50-
51-
4. The processes, except the C3 controller, can be run using the script `script:start_experiment`. This spawns the following processes:
52-
- `start_logging.py`: Starts a lcm-logger with an automatic naming convention for the log number.
53-
- `record_video.py`: Streams all available webcams to a .mp4 file corresponding to the log number.
54-
- `torque_driver`: `drake-franka-driver` in torque control mode.
55-
- `franka_driver_`(in/out): communicates with `drake-franka-driver` to receive/publish franka state information and torque commands. This is just a translator between Drake's Franka Panda specific lcm messages and the standardized robot commands that we use.
56-
- `bazel-bin/examples/plate-balancing/run_osc_controller`: Low-level task-space controller that tracks task-space trajectories it receives from the MPC
57-
58-
59-
5. For safety, start the C3 controller separately after verifying the rest of the processes have started successfully, by manually starting the `franka_c3` process.
60-
6. Using the xbox controller, switch from tracking the teleop commands to the MPC plan by pressing "A".
61-
7. Stop the experiment using `script:stop_experiment`. This also stops logging and recording.
62-
63-
6426
## Changing the scene
6527

6628
We currently have environment descriptions and gains for the following scenes:
6729

68-
The scene can be changed by updating the `scene_index` parameter in BOTH `run_simulation_params.yaml` and `run_c3_controller_params.yaml`.
30+
The scene can be changed by updating the `scene_index` parameter in `examples/plate-balancing/config/plate_balancing_config.yaml`.
6931
The visualizer process must be restarted if changing the scene.
7032

7133
| Scene Index | Description |

examples/plate-balancing/plate_balancing_osc_controller.cc renamed to examples/plate-balancing/franka_osc_controller.cc

File renamed without changes.

0 commit comments

Comments
 (0)