|
upkie
10.1.0
Open-source wheeled biped robots
|
Wrapper where the Upkie balances itself and the action is directly a base velocity. More...
Public Member Functions | |
| def | __init__ (self, UpkieServos servos_env, float fall_pitch=1.0, float max_ground_velocity=3.0, float max_yaw_velocity=1.0, float leg_length=0.58, float max_ground_accel=10.0) |
| Initialize environment. More... | |
| MPCBalancer | mpc_balancer (self) |
| Get the internal MPC balancer. | |
| 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. | |
Wrapper where the Upkie balances itself and the action is directly a base velocity.
This wrapper embeds an MPCBalancer to handle sagittal balance internally. The user commands the robot's base velocity in se(2) and observes its SE(2) pose in the horizontal plane.
The action is an element of \(\mathfrak{se}(2)\):
\[ a = \begin{bmatrix} v \\ \dot{\psi}^* \end{bmatrix} \]
where \(v\) is the target linear velocity in m/s and \(\dot{\psi}^*\) is the commanded yaw velocity in rad/s. The linear velocity is tracked by the internal MPC balancer, which computes the ground velocity needed to maintain balance while following the target.
Observations are the robot's SE(2) pose in the horizontal plane:
\[ o = \begin{bmatrix} x \\ y \\ \psi \end{bmatrix} \]
where \(x\) and \(y\) are positions in meters, dead-reckoned from the commanded linear velocity and current yaw, and \(\psi\) is the yaw angle in radians (accumulated freely, not wrapped).
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.