|
1 | 1 | # Robot Control Stack |
2 | | -RCS is a unified and multilayered robot control interface over a MuJoCo simulation and real world robot currently implemented for the FR3/Panda, xArm7, UR5e and SO101. |
| 2 | + |
| 3 | +**Robot Control Stack (RCS)** is a unified and multilayered robot control interface over a MuJoCo simulation and real world robot currently implemented for the FR3/Panda, xArm7, UR5e and SO101. |
3 | 4 |
|
4 | 5 | ## Installation |
| 6 | + |
5 | 7 | We build and test RCS on the latest Debian and on the latest Ubuntu LTS. |
6 | 8 |
|
7 | | -1. Install the system dependencies: |
8 | | -```shell |
9 | | -sudo apt install $(cat debian_deps.txt) |
10 | | -``` |
11 | | -2. Create, activate and configure a [Python virtual environment](https://docs.python.org/3/library/venv.html): |
12 | | -```shell |
13 | | -python3 -m venv .venv |
14 | | -source .venv/bin/activate |
15 | | -``` |
16 | | -Then, install the package: |
17 | | -```shell |
18 | | -pip install -r requirements_dev.txt |
19 | | -pip config --site set global.no-build-isolation false |
20 | | -``` |
21 | | -3. Build and install RCS: |
22 | | -```shell |
23 | | -pip install -ve . |
24 | | -``` |
| 9 | +1. **System Dependencies**: |
| 10 | + ```shell |
| 11 | + sudo apt install $(cat debian_deps.txt) |
| 12 | + ``` |
25 | 13 |
|
26 | | -For a docker deployment see the [docker](docker) folder. |
27 | | - |
28 | | -## Usage |
29 | | -The python package is called `rcs`. |
30 | | - |
31 | | -### Direct Robot Control |
32 | | -Simple direct robot control: |
33 | | -```python |
34 | | -import rcs |
35 | | -from rcs import sim |
36 | | -from rcs._core.sim import CameraType |
37 | | -from rcs.camera.sim import SimCameraConfig, SimCameraSet |
38 | | -from time import sleep |
39 | | -simulation = sim.Sim(rcs.scenes["fr3_empty_world"].mjb) |
40 | | -urdf_path = rcs.scenes["fr3_empty_world"].urdf |
41 | | -ik = rcs.common.RL(str(urdf_path)) |
42 | | -cfg = sim.SimRobotConfig() |
43 | | -cfg.add_id("0") |
44 | | -cfg.tcp_offset = rcs.common.Pose(rcs.common.FrankaHandTCPOffset()) |
45 | | -robot = rcs.sim.SimRobot(simulation, ik, cfg) |
46 | | - |
47 | | -gripper_cfg_sim = sim.SimGripperConfig() |
48 | | -gripper_cfg_sim.add_id("0") |
49 | | -gripper = sim.SimGripper(simulation, gripper_cfg_sim) |
50 | | - |
51 | | -camera_set = SimCameraSet(simulation, {}) |
52 | | -simulation.open_gui() |
53 | | -# wait for gui |
54 | | -sleep(5) |
55 | | -# step the robot 10 cm in x direction |
56 | | -robot.set_cartesian_position( |
57 | | - robot.get_cartesian_position() * rcs.common.Pose(translation=np.array([0.1, 0, 0])) |
58 | | -) |
59 | | -# close gripper |
60 | | -gripper.grasp() |
61 | | -simulation.step_until_convergence() |
62 | | -input("press enter to close") |
63 | | -``` |
64 | | -### Gym Env Interface |
65 | | -```python |
66 | | -from rcs.envs.creators import SimEnvCreator |
67 | | -from rcs.envs.utils import ( |
68 | | - default_mujoco_cameraset_cfg, |
69 | | - default_sim_gripper_cfg, |
70 | | - default_sim_robot_cfg, |
71 | | -) |
72 | | -from rcs.envs.base import ControlMode, RelativeTo |
73 | | -env_rel = SimEnvCreator()( |
74 | | - control_mode=ControlMode.JOINTS, |
75 | | - robot_cfg=default_sim_robot_cfg(), |
76 | | - gripper_cfg=default_sim_gripper_cfg(), |
77 | | - cameras=default_mujoco_cameraset_cfg(), |
78 | | - max_relative_movement=np.deg2rad(5), |
79 | | - relative_to=RelativeTo.LAST_STEP, |
80 | | -) |
81 | | -env_rel.get_wrapper_attr("sim").open_gui() |
82 | | - |
83 | | -for _ in range(100): |
84 | | - obs, info = env_rel.reset() |
85 | | - for _ in range(10): |
86 | | - # sample random relative action and execute it |
87 | | - act = env_rel.action_space.sample() |
88 | | - print(act) |
89 | | - obs, reward, terminated, truncated, info = env_rel.step(act) |
90 | | - print(obs) |
91 | | -``` |
| 14 | +2. **Python Environment**: |
| 15 | + ```shell |
| 16 | + python3 -m venv .venv |
| 17 | + source .venv/bin/activate |
| 18 | + pip install -r requirements_dev.txt |
| 19 | + ``` |
92 | 20 |
|
| 21 | +3. **Install RCS**: |
| 22 | + ```shell |
| 23 | + pip install -ve . |
| 24 | + ``` |
93 | 25 |
|
94 | | -### Examples |
95 | | -Checkout the python examples in the [examples](examples) folder. For example |
96 | | -[fr3_direct_control.py](examples/fr3/fr3_direct_control.py) shows direct robot control with RCS's python bindings. |
97 | | -And [fr3_env_joint_control.py](examples/fr3/fr3_env_joint_control.py) and [fr3_env_cartesian_control.py](examples/fr3/fr3_env_cartesian_control.py) demonstrates RCS's high level [gymnasium](https://gymnasium.farama.org/) interface both for joint- and end effector space control |
98 | | -Checkout the other sub folders for other robot-specific examples. |
99 | | -Most of these examples work both in the MuJoCo simulation as well as on hardware. |
| 26 | +## Hardware Extensions |
100 | 27 |
|
| 28 | +RCS supports various hardware extensions (e.g., FR3, xArm7, RealSense). These are located in the `extensions` directory. |
| 29 | + |
| 30 | +To install an extension: |
101 | 31 |
|
102 | | -### Hardware Extensions |
103 | | -To enable hardware usage in RCS, install the needed hardware extensions via pip. RCS itself comes with a couple of supported extensions e.g. control of the FR3 via the [`rcs_fr3`](extensions/rcs_fr3) extension. All native supported extension are located in [extensions](extensions). |
104 | | -To install extensions: |
105 | 32 | ```shell |
106 | 33 | pip install -ve extensions/rcs_fr3 |
107 | 34 | ``` |
108 | | -For more details real the readme file of the respective extension. |
109 | 35 |
|
110 | | -After the required hardware extensions are installed the examples also above work on real hardware: |
111 | | -Switch to hardware by setting the following flag: |
112 | | -```python |
113 | | -# ROBOT_INSTANCE = RobotPlatform.SIMULATION |
114 | | -ROBOT_INSTANCE = RobotPlatform.HARDWARE |
115 | | -``` |
| 36 | +For a full list of extensions and detailed documentation, visit [robot-control-stack.org/extensions](https://robot-control-stack.org/extensions). |
| 37 | + |
| 38 | +## Documentation |
116 | 39 |
|
117 | | -#### Command Line Interface |
118 | | -Some modules include command line interfaces, e.g. rcs_fr3 defines useful commands to handle the FR3 robot without the need to use the Desk Website. |
119 | | -You can see the available subcommands as follows: |
120 | | -```shell |
121 | | -python -m rcs_fr3 --help |
122 | | -python -m rcs_realsense --help |
123 | | -``` |
124 | 40 |
|
125 | | -## Developer Documentation |
126 | | -See [robot-control-stack.org](https://robot-control-stack.org) for the development documentation. |
| 41 | +For full documentation, including installation, usage, and API reference, please visit: |
127 | 42 |
|
| 43 | +**[robot-control-stack.org](https://robot-control-stack.org)** |
128 | 44 |
|
129 | 45 | ## Citation |
| 46 | + |
130 | 47 | If you find RCS useful for your academic work, please consider citing it: |
131 | | -``` |
| 48 | + |
| 49 | +```bibtex |
132 | 50 | @misc{juelg2025robotcontrolstack, |
133 | 51 | title={{Robot Control Stack}: {A} Lean Ecosystem for Robot Learning at Scale}, |
134 | 52 | author={Tobias J{\"u}lg and Pierre Krack and Seongjin Bien and Yannik Blei and Khaled Gamal and Ken Nakahara and Johannes Hechtl and Roberto Calandra and Wolfram Burgard and Florian Walter}, |
135 | 53 | year={2025}, |
136 | 54 | howpublished = {\url{https://arxiv.org/abs/2509.14932}} |
137 | 55 | } |
138 | | -``` |
| 56 | +``` |
| 57 | + |
| 58 | +For more scientific info, visit the [paper website](https://robotcontrolstack.github.io/). |
0 commit comments