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

At each step, with a given probability, apply a random push to the robot. More...

Public Member Functions

def __init__ (self, env, push_prob=0.01, push_generator=lambda:np.random.normal(0, 400, 3))
 Initialize wrapper. More...
 
def get_spine_action (self, action)
 

Public Attributes

 env
 Wrapped environment.
 
 push_prob
 Probability of pushing at each step.
 
 push_generator
 Function that generates the push force. More...
 

Detailed Description

At each step, with a given probability, apply a random push to the robot.

Constructor & Destructor Documentation

◆ __init__()

def upkie.envs.wrappers.random_push.RandomPush.__init__ (   self,
  env,
  push_prob = 0.01,
  push_generator = lambda: np.random.normal(0, 400, 3) 
)

Initialize wrapper.

Parameters
envEnvironment to wrap.
push_probProbability of pushing at each step.
push_generatorFunction that generates the push force. It should return a 3D numpy array.

Member Function Documentation

◆ get_spine_action()

def upkie.envs.wrappers.random_push.RandomPush.get_spine_action (   self,
  action 
)
Adds a random push to the action.

Member Data Documentation

◆ push_generator

upkie.envs.wrappers.random_push.RandomPush.push_generator

Function that generates the push force.

It should return a 3D numpy array.


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