upkie  11.0.0
Open-source wheeled biped robots
UpkiePendulum Class Reference

Backward-compatible wrapper around UpkieGyropod with 4D obs / 1D action. More...

Public Member Functions

def __init__ (self, UpkieServos servos_env, float fall_pitch=1.0, float max_ground_velocity=3.0)
 Initialize environment. More...
 
Tuple[np.ndarray, Dict] reset (self, *Optional[int] seed=None, Optional[dict] options=None)
 Resets the environment and get an initial observation. More...
 
Tuple[np.ndarray, float, bool, bool, dict] step (self, np.ndarray action)
 Run one timestep of the environment's dynamics. More...
 

Public Attributes

 observation_space
 Observation space.
 
 action_space
 Action space.
 

Detailed Description

Backward-compatible wrapper around UpkieGyropod with 4D obs / 1D action.

This wrapper strips the yaw-related dimensions from upkie.envs.upkie_gyropod.UpkieGyropod, providing the same interface as the former pendulum environment:

Action space

\[ a = \begin{bmatrix} \dot{p}^* \end{bmatrix} \]

where \(\dot{p}^*\) is the commanded ground velocity in m/s.

Observation space

\[ o = \begin{bmatrix} \theta \\ p \\ \dot{\theta} \\ \dot{p} \end{bmatrix} \]

where we denote by:

  • \(\theta\) the pitch angle of the base with respect to the world vertical, in radians.
  • \(p\) the position of the average wheel contact point, in meters.
  • \(\dot{\theta}\) the body angular velocity of the base frame along its lateral axis, in radians per seconds.
  • \(\dot{p}\) the velocity of the average wheel contact point, in meters per seconds.

As with all Upkie environments, full observations from the spine (detailed in Observations) are also available in the info dictionary returned by the reset and step functions.


The documentation for this class was generated from the following file: