Domain randomization parameters for Upkie's state.
More...
|
def | __init__ (self, float roll=0.0, float pitch=0.0, float x=0.0, float z=0.0, float omega_x=0.0, float omega_y=0.0, Optional[np.ndarray] linear_velocity=None) |
| Initialize sampler. More...
|
|
None | update (self, Optional[float] roll=None, Optional[float] pitch=None, Optional[float] x=None, Optional[float] z=None, Optional[float] omega_x=None, Optional[float] omega_y=None, Optional[float] v_x=None, Optional[float] v_z=None) |
| Update some fields. More...
|
|
ScipyRotation | sample_orientation (self, np.random.Generator np_random) |
| Sample an orientation within the given bounds. More...
|
|
np.ndarray | sample_position (self, np.random.Generator np_random) |
| Sample a position within the given bounds. More...
|
|
np.ndarray | sample_angular_velocity (self, np.random.Generator np_random) |
| Sample an angular velocity within the given bounds. More...
|
|
np.ndarray | sample_linear_velocity (self, np.random.Generator np_random) |
| Sample a linear velocity within the given bounds. More...
|
|
|
| roll |
| Amount of roll angle randomization, in radians.
|
|
| pitch |
| Amount of pitch angle randomization, in radians.
|
|
| x |
| Amount of x-axis position randomization, in meters.
|
|
| z |
| Amount of z-axis position randomization, in meters.
|
|
| omega_x |
| Amount of x-axis randomization on the angular-velocity vector, in rad/s.
|
|
| omega_y |
| Amount of y-axis randomization on the angular-velocity vector, in rad/s.
|
|
| linear_velocity |
| Magnitude of linear velocity randomization, as a 3D vector in m/s.
|
|
Domain randomization parameters for Upkie's state.
- Note
- The API for this class is likely to change. Initially all its attributes where floating-point numbers due to a quick-and-dirty design decision.
◆ __init__()
def upkie.utils.robot_state_randomization.RobotStateRandomization.__init__ |
( |
|
self, |
|
|
float |
roll = 0.0 , |
|
|
float |
pitch = 0.0 , |
|
|
float |
x = 0.0 , |
|
|
float |
z = 0.0 , |
|
|
float |
omega_x = 0.0 , |
|
|
float |
omega_y = 0.0 , |
|
|
Optional[np.ndarray] |
linear_velocity = None |
|
) |
| |
Initialize sampler.
- Parameters
-
roll | Amount of roll angle randomization, in radians. |
pitch | Amount of pitch angle randomization, in radians. |
x | Amount of x-axis position randomization, in meters. |
z | Amount of z-axis position randomization, in meters. |
omega_x | Amount of x-axis randomization on the angular-velocity vector, in rad/s. |
omega_y | Amount of y-axis randomization on the angular-velocity vector, in rad/s. |
linear_velocity | Magnitude of linear velocity randomization, as a 3D vector in m/s. |
◆ sample_angular_velocity()
np.ndarray upkie.utils.robot_state_randomization.RobotStateRandomization.sample_angular_velocity |
( |
|
self, |
|
|
np.random.Generator
|
np_random |
|
) |
| |
Sample an angular velocity within the given bounds.
- Parameters
-
[in] | np_random | NumPy random number generator. |
- Returns
- Sampled angular-velocity vector.
◆ sample_linear_velocity()
np.ndarray upkie.utils.robot_state_randomization.RobotStateRandomization.sample_linear_velocity |
( |
|
self, |
|
|
np.random.Generator
|
np_random |
|
) |
| |
Sample a linear velocity within the given bounds.
- Parameters
-
[in] | np_random | NumPy random number generator. |
- Returns
- Sampled linear-velocity vector.
◆ sample_orientation()
ScipyRotation upkie.utils.robot_state_randomization.RobotStateRandomization.sample_orientation |
( |
|
self, |
|
|
np.random.Generator
|
np_random |
|
) |
| |
Sample an orientation within the given bounds.
- Parameters
-
[in] | np_random | NumPy random number generator. |
- Returns
- Sampled rotation matrix.
◆ sample_position()
np.ndarray upkie.utils.robot_state_randomization.RobotStateRandomization.sample_position |
( |
|
self, |
|
|
np.random.Generator |
np_random |
|
) |
| |
Sample a position within the given bounds.
- Parameters
-
[in] | np_random | NumPy random number generator. |
- Returns
- Sampled position vector.
◆ update()
None upkie.utils.robot_state_randomization.RobotStateRandomization.update |
( |
|
self, |
|
|
Optional[float] |
roll = None , |
|
|
Optional[float] |
pitch = None , |
|
|
Optional[float] |
x = None , |
|
|
Optional[float] |
z = None , |
|
|
Optional[float] |
omega_x = None , |
|
|
Optional[float] |
omega_y = None , |
|
|
Optional[float] |
v_x = None , |
|
|
Optional[float] |
v_z = None |
|
) |
| |
Update some fields.
- Parameters
-
roll | Roll angle for the rotation from the randomized frame to the parent frame (Euler Z-Y-X convention). |
pitch | Pitch angle for the rotation from the randomized frame to the parent frame (Euler Z-Y-X convention). |
x | Translation of the randomized frame along the x-axis of the parent frame. |
z | Translation of the randomized frame along the z-axis of the parent frame. |
omega_x | Angular velocity from the randomized frame to the parent frame, expressed in the randomized frame, along the x-axis. |
omega_y | Angular velocity from the randomized frame to the parent frame, expressed in the randomized frame, along the y-axis. |
v_x | Linear velocity from the randomized frame to the parent frame, expressed in the parent frame and along the x-axis. |
v_z | Linear velocity from the randomized frame to the parent frame, expressed in the parent frame and along the z-axis. |
The documentation for this class was generated from the following file:
- upkie/utils/robot_state_randomization.py