ReDySim RL manual
ReDySim RL: train robots with reinforcement learning from a GUI, or use its Gymnasium environments in your own code.
A GUI to set up, run, watch and compare reinforcement-learning runs, on Gymnasium environments built on the fixed-step simulators of the ReDySim packages. The GUI is the easiest way in; the environments can also be used directly in your own code. A vector environment advances many robots with one call of the compiled batch stepper, so that learning algorithms get hundreds of thousands of environment steps per second, a million for simple arm tasks, on a laptop processor, and a single environment (the same code with one robot) works with any Gymnasium program.
What would you like to do?
Set up a run, watch every checkpoint play as it trains, and compare runs.
Open guideInstall the packages, with the GUI extra.
Open guideObservations, rewards, robots and randomisation.
Open guideTorques, PD targets or impedance, and stable gains.
Open guideStable-Baselines3, what to expect, and speed.
Open guideA space robot, a quadruped and a wheeled robot between obstacles.
Open guideimport redysim_rl
env = redysim_rl.make_vec("joint_reach", num_envs=64, action_mode="impedance")
obs, info = env.reset(seed=0)
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
To see the GUI at work first, watch the video tour on the ReDySim website (about 6 minutes, with voice and captions).
What is in it:
- Tasks. Fixed base: reach a joint configuration, reach a point in space, swing up a two-link arm whose shoulder has no motor (the acrobot), balance a pole on a cart (the cart-pole), bring the triangle of the 3-RRR parallel robot (a robot with closed loops) to a goal pose. Floating base: a free-floating space robot reaches a goal while its base recoils, and a quadruped on the ground that is to track a commanded velocity (with the default reward a 15 M-step run walks), and a Pioneer-size differential-drive robot that drives to a goal between obstacles.
- Action modes. Joint torques, PD targets, or targets together with stiffness and damping (impedance); the PD gains are derived from the robot's own inertia, so any robot gets a stable law.
- Robots. The bundled
three_linkarm by default; any bundled model by name, your ownRobotorFloatingRobot, and a pendulum. - A GUI for runs. Set a run up, start it, watch every checkpoint play as the policy learns,
stop it when it goes wrong, and compare runs (needs
pip install "./redysim_rl-1.0[gui]"). - Details that matter for learning. Reproducible seeds, all three Gymnasium autoreset modes, mass randomisation at every reset, and an adapter for Stable-Baselines3.
Requirements. Python 3.10 or newer; NumPy and Gymnasium (installed automatically); the fixed-base
package redysim, installed first (it is not on PyPI, so redysim_rl cannot be installed without it); and
the floating-base package redysim_floating, which the GUI needs (it offers the floating-base tasks) and
which scripts need for space_reach, quadruped_velocity and wheeled_nav. The GUI and training with
Stable-Baselines3 also need stable-baselines3 and PyTorch (the gui extra installs them).
Before you start¶
- System. The environments are plain Python; the GUI in the download is compiled for each system (one build runs on every Python from 3.10), so each system has its own download. Today that is Linux x86-64 and Windows 10 or 11 (64-bit), the systems the compiled simulators of the fixed-base and floating-base packages are built for. No GPU is needed.
- Software. The packages listed above; training also needs a learning library. The examples use Stable-Baselines3 (PPO), but the vector environment follows Gymnasium's own interface, so any library that trains on Gymnasium environments can use it.
- Background. Basic reinforcement learning (observations, actions, rewards, episodes) and Gymnasium's
resetandstep. No knowledge of the dynamics code is needed to use the environments. - Hardware and time. The environments run on the CPU, in parallel over its threads, so more cores means more speed; the figures in this manual come from a 16-thread laptop processor. The arm tasks learn in minutes; legged walking needs hours (see Training).
Scope
Open-chain fixed-base robots, a floating base in free flight, one legged task (a quadruped that learns to walk at a commanded speed in a 15 M-step run) and one wheeled task (a differential-drive robot between obstacles, whose policy trained for 10 million steps (one seed) reaches the goal more often than a hand-written reactive controller). Closed-loop mechanisms are not covered. No trained policies are shipped: the environments are the product, and the training scripts show how to use them.