Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/extensions/rcs_fr3.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ROBOT_IP = "172.16.0.2" # Replace with your robot IP

user, pw = load_creds_franka_desk()
with FCI(Desk(ROBOT_IP, user, pw), unlock=False, lock_when_done=False):
urdf_path = rcs.scenes["fr3_empty_world"].urdf
ik = rcs.common.RL(str(urdf_path))
robot_meta = rcs.ROBOTS[rcs.common.RobotType.FR3]
ik = rcs.common.Pin(robot_meta.mjcf_model_path, robot_meta.attachment_site)

# Configure Robot
robot = hw.Franka(ROBOT_IP, ik)
Expand Down
30 changes: 10 additions & 20 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,17 @@ from time import sleep
import numpy as np

# Load simulation scene
simulation = sim.Sim(rcs.scenes["fr3_empty_world"].mjb)
urdf_path = rcs.scenes["fr3_empty_world"].urdf
ik = rcs.common.RL(str(urdf_path))
robot_meta = rcs.ROBOTS[rcs.common.RobotType.FR3]
simulation = sim.Sim(rcs.SCENE_PATHS["empty_world"])
ik = rcs.common.Pin(robot_meta.mjcf_model_path, robot_meta.attachment_site)

# Configure robot
cfg = sim.SimRobotConfig()
cfg.add_postfix("_0")
cfg.tcp_offset = rcs.common.Pose(rcs.common.FrankaHandTCPOffset())
robot = rcs.sim.SimRobot(simulation, ik, cfg)

# Configure gripper
gripper_cfg_sim = sim.SimGripperConfig()
gripper_cfg_sim.add_postfix("_0")
gripper = sim.SimGripper(simulation, gripper_cfg_sim)

# Configure cameras
Expand Down Expand Up @@ -93,24 +91,16 @@ input("press enter to close")
RCS provides a high-level [Gymnasium](https://gymnasium.farama.org/) interface for Reinforcement Learning and general control.

```python
from rcs.envs.creators import SimEnvCreator
from rcs.envs.utils import (
default_mujoco_cameraset_cfg,
default_sim_gripper_cfg,
default_sim_robot_cfg,
)
from rcs.envs.base import ControlMode, RelativeTo
from rcs.envs.configs import EmptyWorldFR3
import numpy as np

# Create environment
env_rel = SimEnvCreator()(
control_mode=ControlMode.JOINTS,
robot_cfg=default_sim_robot_cfg(),
gripper_cfg=default_sim_gripper_cfg(),
cameras=default_mujoco_cameraset_cfg(),
max_relative_movement=np.deg2rad(5),
relative_to=RelativeTo.LAST_STEP,
)
scene = EmptyWorldFR3()
cfg = scene.config()
cfg.control_mode = ControlMode.JOINTS
cfg.max_relative_movement = np.deg2rad(5)
cfg.relative_to = RelativeTo.LAST_STEP
env_rel = scene.create_env(cfg)

# Open GUI
env_rel.get_wrapper_attr("sim").open_gui()
Expand Down
8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@

## Documentation

```{toctree}
:maxdepth: 2
:caption: User Guide

getting_started/index
user_guide/index
```

```{toctree}
:maxdepth: 2
:caption: API
Expand Down
39 changes: 21 additions & 18 deletions docs/user_guide/gym_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ The high-level interface of RCS is based on [Gymnasium](https://gymnasium.farama

## Environment Creation

To facilitate environment creation, RCS ships with environment factory classes that create an envrionment already wrapped with the most common wrappers.
Simulated environments are created using the `SimEnvCreator`.
To facilitate environment creation, RCS ships with config-based creator classes that return environments already wrapped with the most common wrappers.
Simulated environments are typically created through a scene config class such as `EmptyWorldFR3`.

```python
from rcs.envs.creators import SimEnvCreator
from rcs.envs.base import ControlMode

env = SimEnvCreator()(
control_mode=ControlMode.JOINTS,
# ... configuration objects ...
)
from rcs.envs.base import ControlMode, RelativeTo
from rcs.envs.configs import EmptyWorldFR3

scene = EmptyWorldFR3()
cfg = scene.config()
cfg.control_mode = ControlMode.JOINTS
cfg.relative_to = RelativeTo.LAST_STEP
env = scene.create_env(cfg)
```

Hardware environments are created using the robot-specific environment creator functions, located in the hardware extensions, usually named `<RobotName>EnvCreator`.
Hardware environments are created using the robot-specific config creators and default config classes from the hardware extensions.
```python
from rcs_fr3.creators import RCSFR3EnvCreator
from rcs.envs.base import ControlMode

env = RCSFR3EnvCreator()(
ip="192.168.100.1",
control_mode=ControlMode.JOINTS,
# ... configuration objects ...
)
from rcs.envs.base import ControlMode, RelativeTo
from rcs_fr3.configs import DefaultFR3HardwareEnv

creator = DefaultFR3HardwareEnv()
creator.ip = "192.168.100.1"
cfg = creator.config()
cfg.control_mode = ControlMode.JOINTS
cfg.camera_cfgs = None
cfg.relative_to = RelativeTo.LAST_STEP
env = creator.create_env(cfg)
```


Expand Down
11 changes: 11 additions & 0 deletions docs/user_guide/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# User Guide

The User Guide provides in-depth information about the core concepts and components of the Robot Control Stack.

```{toctree}
:maxdepth: 2

architecture
gym_interface
low_level_api
```
Loading