Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

InvertedDoublePendulum

State and action spaces

The fixed 9-value observation is

\[ [x,\sin\theta_1,\sin\theta_2,\cos\theta_1,\cos\theta_2, \operatorname{clip}(\dot q_0,-10,10), \operatorname{clip}(\dot q_1,-10,10), \operatorname{clip}(\dot q_2,-10,10), \operatorname{clip}(f_{constraint,0},-10,10)]. \]

The default action is one cart control in \([-1,1]\).

Dynamics and reward

Let the free tip site position be \((x_{tip},z_{tip})\). Then

\[ p_d=0.01x_{tip}^2+(z_{tip}-2)^2, \qquad p_v=0.001\dot q_1^2+0.005\dot q_2^2, \]

\[ r=r_{healthy}\mathbf{1}[z_{tip}>1]-p_d-p_v. \]

Info contains cart x position and velocity.

Episode end

The task terminates when \(z_{tip}\le1\) and truncates at max_steps.

Configuration

FieldDefaultMeaning
xml_file, frame_skipembedded, 5Model and action duration
healthy_reward10Upright bonus
reset_noise_scale0.1Uniform qpos and Gaussian qvel noise
observation_shape/dtype(9,), f64Descriptive metadata; assembly is fixed by code
max_steps1000Horizon

Reference: Gymnasium InvertedDoublePendulum.