Skip to content

prototwin/RLExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prototwin

PyPI Version PyPI Version GitHub Stars Follow on Twitter Follow on LinkedIn Subscribe on YouTube

    ProtoTwin Reinforcement Learning Examples


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 Repository

Clone the repository by running the following command:

git clone https://github.com/prototwin/RLExamples.git

Install Dependencies

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.

Examples

CartPole V1

ProtoTwin single inverted pendulum (cartpole) tasked with swinging the pole up and balancing it.

CartPoleV1

To train the cartpole-v1 model:

cd cartpole-v1
python cartpole-v1.py

CartPole V2

ProtoTwin cartpole v2 has reduced acceleration in the cart and domain randomization compared to v1 (designed for sim-to-real).

CartPoleV2

To train the cartpole-v2 model:

cd cartpole-v2
python cartpole-v2.py

Bipedal Robot

ProtoTwin bipedal robot tasked with walking forward.

Bipedal

To train the bipedal model:

cd bipedal
python bipedal.py

Quadruped Robot Handstand

Unitree Go2 quadruped robot tasked with performing a handstand.

Handstand

To train the handstand model:

cd handstand
python handstand.py

Robotic Ping Pong

uFactory xArm 6 robot tasked with bouncing a ping pong ball to the target height for as long as possible.

PingPong

To train the pingpong model:

cd pingpong
python pingpong.py

Quadrotor Drone

Quadrotor drone tasked with hovering to a randomly initialized target position marked by a yellow sphere.

Quadrotor

To train the quadrotor model:

cd quadrotor
python quadrotor.py