upkie 9.0.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
UpkieEnv Class Reference

Base class with features shared by all Upkie environments. More...

Public Member Functions

None __init__ (self, Backend backend, Optional[float] frequency, bool frequency_checks, Optional[RobotState] init_state, bool regulate_frequency)
 Initialize environment. More...
 
None close (self)
 Close the environment and clean up resources. More...
 
Optional[float] dt (self)
 Regulated period of the control loop in seconds, or None if there is no loop frequency regulation.
 
Optional[float] frequency (self)
 Regulated frequency of the control loop in Hz, or None if there is no loop frequency regulation.
 
def get_env_observation (self, dict spine_observation)
 Get Gym environment observation from spine observation. More...
 
def get_neutral_action (self)
 Get neutral action for this environment. More...
 
dict get_spine_action (self, env_action)
 Get spine action from Gym environment action. More...
 
Tuple[dict, dict] reset (self, Optional[int] seed=None, Optional[dict] options=None)
 Resets the backend and get an initial observation. More...
 
Tuple[dict, float, bool, bool, dict] step (self, dict action)
 Run one timestep of the environment's dynamics. More...
 
None update_init_rand (self, **kwargs)
 Update initial-state randomization. More...
 
dict get_bullet_action (self)
 Get the bullet action that will be applied at next step (only applies to the spine backend). More...
 
None set_bullet_action (self, dict bullet_action)
 Set bullet action for the next step (only for SpineBackend). More...
 

Public Attributes

 action_space
 Action space of the environment.
 
 init_state
 Initial state for the floating base of the robot, which may be randomized upon resets.
 
 model
 Upkie robot model.
 
 observation_space
 Observation space of the environment.
 

Detailed Description

Base class with features shared by all Upkie environments.

Upkie environments do a number of things under the hood:

  • Communication with backends (simulators or spines).
  • Initial state randomization (e.g. when training a policy).
  • Loop frequency regulation (optional).

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