upkie 6.1.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
upkie.envs.wrappers.add_action_to_observation.AddActionToObservation Class Reference

Append last action vector to the observation vector. More...

Public Member Functions

def __init__ (self, env)
 Initialize wrapper. More...
 
np.ndarray observation (self, np.ndarray observation)
 rGet wrapped observation. More...
 
def step (self, np.ndarray action)
 Step the environment. More...
 

Public Attributes

 observation_space
 Observation space.
 

Detailed Description

Append last action vector to the observation vector.

Can be used in combination with gymnasium.wrappers.FrameStackObservation to create histories. (If there were directly a history wrapper in gymnasium we wouldn't need this wrapper.)

Constructor & Destructor Documentation

◆ __init__()

def upkie.envs.wrappers.add_action_to_observation.AddActionToObservation.__init__ (   self,
  env 
)

Initialize wrapper.

Parameters
envWrapped environment.

The initial action is set to zero.

Member Function Documentation

◆ observation()

np.ndarray upkie.envs.wrappers.add_action_to_observation.AddActionToObservation.observation (   self,
np.ndarray  observation 
)

rGet wrapped observation.

Parameters
observationObservation from the wrapped environment.
Returns
Wrapped observation.

◆ step()

def upkie.envs.wrappers.add_action_to_observation.AddActionToObservation.step (   self,
np.ndarray  action 
)

Step the environment.

Parameters
actionAction from the agent.

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