bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
cart_pole_gif Namespace Reference

Functions

 draw (row, title)
 main ()

Variables

 WIDTH
 HEIGHT
float SCALE = 100.0
float TRACK = 2.4
float POLE = 1.0
int GROUND = 210
float MAX_FORCE = 10.0

Detailed Description

Make a GIF of a cart-pole episode that an example wrote.

es_cart_pole_swing_up writes swing_up.csv, a row per step: t,x,theta,force,
with theta the angle of the pole from upright [rad] and force the push on the
cart [N]. The GIF shows the cart on its track, the pole, and the force as an
arrow, in real time.

Usage: python cart_pole_gif.py swing_up.csv --out swing_up.gif [--title "..."] [--every 2]

Needs imageio and Pillow.

Function Documentation

◆ draw()

cart_pole_gif.draw ( row,
title )

◆ main()

cart_pole_gif.main ( )

Variable Documentation

◆ GROUND

int cart_pole_gif.GROUND = 210

◆ HEIGHT

cart_pole_gif.HEIGHT

◆ MAX_FORCE

float cart_pole_gif.MAX_FORCE = 10.0

◆ POLE

float cart_pole_gif.POLE = 1.0

◆ SCALE

float cart_pole_gif.SCALE = 100.0

◆ TRACK

float cart_pole_gif.TRACK = 2.4

◆ WIDTH

cart_pole_gif.WIDTH