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

Model lag by applying a low-pass filter to the action of an environment. More...

Public Member Functions

def __init__ (self, env, Union[float, gym.spaces.Box] time_constant)
 Initialize wrapper. More...
 
def reset (self, **kwargs)
 Reset the environment. More...
 
Tuple[np.ndarray, float, bool, bool, dict] step (self, np.ndarray action)
 Step the environment. More...
 

Public Attributes

 filtered_action
 Wrapped action after low-pass filtering.
 
 time_constant
 Cutoff period in seconds of a low-pass filter applied to the action.
 
 time_constant_box
 Box space from which the time constant is sampled at every reset of the environment.
 

Detailed Description

Model lag by applying a low-pass filter to the action of an environment.

Note that there is a difference between "delay" and "lag":

  • Delay is a fixed time interval corresponding to the time it takes the input to affect the output, e.g. output(t + delay) = input(t).
  • Lag is a phase shift in the system's response. It can be thought of as a gradual response to input changes where the output does not immediately match the input, e.g. d/dt{output}(t) = lag * (input(t) - output(t)).

In this wrapper, we model lag where the output (action forward to the wrapped environment) is a low-pass filtered version of the input (action passed to step).


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