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

Act on the derivative of the action. More...

Public Member Functions

def __init__ (self, env, np.ndarray min_derivative, np.ndarray max_derivative, float action_penalty=0.0)
 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

 action_space
 Action space.
 
 action_penalty
 Weight for an additional penalty on the differential action added to the reward.
 

Detailed Description

Act on the derivative of the action.

Constructor & Destructor Documentation

◆ __init__()

def upkie.envs.wrappers.differentiate_action.DifferentiateAction.__init__ (   self,
  env,
np.ndarray  min_derivative,
np.ndarray  max_derivative,
float   action_penalty = 0.0 
)

Initialize wrapper.

Parameters
envEnvironment to wrap.
min_derivativeLower bound on the derivative of the original action.
max_derivativeUpper bound on the derivative of the original action.
action_penaltyWeight for an additional penalty on the differential action added to the reward.
Note
We assume the original action lives in a vector space.

Member Function Documentation

◆ reset()

def upkie.envs.wrappers.differentiate_action.DifferentiateAction.reset (   self,
**  kwargs 
)

Reset the environment.

Parameters
kwargsKeyword arguments forwarded to the wrapped environment.

◆ step()

Tuple[np.ndarray, float, bool, bool, dict] upkie.envs.wrappers.differentiate_action.DifferentiateAction.step (   self,
np.ndarray  action 
)

Step the environment.

Parameters
actionAction from the agent.
Returns
Tuple with (observation, reward, terminated, truncated,info). See upkie.envs.upkie_base_env.UpkieBaseEnv.step for details.

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