|
upkie
10.1.0
Open-source wheeled biped robots
|
Wrapper to make Upkie act as a wheeled inverted pendulum with yaw control. More...
Public Member Functions | |
| def | __init__ (self, UpkieServos servos_env, float fall_pitch=1.0, float leg_gain_scale=1.0, float max_ground_velocity=3.0, float max_yaw_velocity=1.0) |
| Initialize environment. More... | |
| float | leg_gain_scale (self) |
| Get the current kp/kd scale upplied to hip and knee joints. More... | |
| None | set_leg_gain_scale (self, float leg_gain_scale) |
| Set a new kp/kd scale upplied to hip and knee joints. More... | |
| Tuple[np.ndarray, Dict] | reset (self, *Optional[int] seed=None, Optional[dict] options=None) |
| Resets the environment and get an initial observation. More... | |
| Tuple[np.ndarray, float, bool, bool, dict] | step (self, np.ndarray action) |
| Run one timestep of the environment's dynamics. More... | |
Public Attributes | |
| observation_space | |
| Observation space. | |
| action_space | |
| Action space. | |
| fall_pitch | |
| Fall detection pitch angle, in radians. | |
Wrapper to make Upkie act as a wheeled inverted pendulum with yaw control.
When this wrapper is applied, Upkie keeps its legs straight and actions affect wheel velocity commands. Overall, the robot behaves like a wheeled inverted pendulum in the sagittal plane, and turns by differential drive.
The action corresponds to the ground sagittal velocity and yaw velocity:
\[ a = \begin{bmatrix} \dot{p}^* \\ \dot{\psi}^* \end{bmatrix} \]
where \(\dot{p}^*\) is the commanded ground velocity in m/s and \(\dot{\psi}^*\) is the commanded yaw velocity in rad/s. Both are internally converted into wheel velocity commands.
Vectorized observations have the following structure:
\[ o = \begin{bmatrix} p \\ \theta \\ \psi \\ \dot{p} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} \]
where we denote by:
As with all Upkie environments, full observations from the spine (detailed in Observations) are also available in the info dictionary returned by the reset and step functions.