ProtoTwin is an online simulation software for robotics and industrial automation. This repository provides a set of examples that you can use with ProtoTwin Connect to train RL agents. To run these example models, you will first need to create a ProtoTwin account and then download the ProtoTwin Connect desktop application. The following OS are supported:
- Windows 10/11 on x64 and Arm
- MacOS on Apple Silicon
- Linux on x64
Clone the repository by running the following command:
git clone https://github.com/prototwin/RLExamples.git
You need to install the following Python packages:
pip install prototwin-gymnasium
pip install tensorboard
The prototwin package provides a client for starting and connecting to an instance of ProtoTwin Connect. This client may be used to issue commands to load a ProtoTwin model, step the simulation forward in time by one time-step, read signal values and write signal values. The prototwin gymnasium package provides vectorized and non-vectorized base environments for Gymnasium.
ProtoTwin single inverted pendulum (cartpole) tasked with swinging the pole up and balancing it.
To train the cartpole-v1 model:
cd cartpole-v1
python cartpole-v1.py
ProtoTwin cartpole v2 has reduced acceleration in the cart and domain randomization compared to v1 (designed for sim-to-real).
To train the cartpole-v2 model:
cd cartpole-v2
python cartpole-v2.py
ProtoTwin bipedal robot tasked with walking forward.
To train the bipedal model:
cd bipedal
python bipedal.py
Unitree Go2 quadruped robot tasked with performing a handstand.
To train the handstand model:
cd handstand
python handstand.py
uFactory xArm 6 robot tasked with bouncing a ping pong ball to the target height for as long as possible.
To train the pingpong model:
cd pingpong
python pingpong.py
Quadrotor drone tasked with hovering to a randomly initialized target position marked by a yellow sphere.
To train the quadrotor model:
cd quadrotor
python quadrotor.py






