upkie 6.1.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
upkie.utils.robot_state.RobotState Class Reference

Robot state (configuration and velocity) with optional randomization. More...

Public Member Functions

def __init__ (self, Optional[np.ndarray] angular_velocity_base_in_base=None, Optional[np.ndarray] joint_configuration=None, Optional[np.ndarray] joint_velocity=None, Optional[np.ndarray] linear_velocity_base_to_world_in_world=None, Optional[ScipyRotation] orientation_base_in_world=None, Optional[np.ndarray] position_base_in_world=None, Optional[RobotStateRandomization] randomization=None)
 Initialize a new state. More...
 
np.ndarray sample_angular_velocity (self, np.random.Generator np_random)
 Sample an angular velocity around the one in this state. More...
 
np.ndarray sample_linear_velocity (self, np.random.Generator np_random)
 Sample a linear velocity around the one in this state. More...
 
ScipyRotation sample_orientation (self, np.random.Generator np_random)
 Sample an orientation around the one in this state. More...
 
np.ndarray sample_position (self, np.random.Generator np_random)
 Sample a position around the one in this state. More...
 

Public Attributes

 angular_velocity_base_in_base
 Angular velocity of the base in body coordinates, in rad/s.
 
 joint_configuration
 Vector of joint angles in radians.
 
 joint_velocity
 Vector of joint velocities, in rad/s.
 
 linear_velocity_base_to_world_in_world
 Linear velocity of the base in world coordinates, in m/s.
 
 orientation_base_in_world
 Orientation of the base frame with respect to the world frame.
 
 position_base_in_world
 Position of the base frame in the world frame.
 
 randomization
 Displacements and velocities added to the state when calling one of the sampling functions.
 

Detailed Description

Robot state (configuration and velocity) with optional randomization.

Constructor & Destructor Documentation

◆ __init__()

def upkie.utils.robot_state.RobotState.__init__ (   self,
Optional[np.ndarray]   angular_velocity_base_in_base = None,
Optional[np.ndarray]   joint_configuration = None,
Optional[np.ndarray]   joint_velocity = None,
Optional[np.ndarray]   linear_velocity_base_to_world_in_world = None,
Optional[ScipyRotation]   orientation_base_in_world = None,
Optional[np.ndarray]   position_base_in_world = None,
Optional[RobotStateRandomization]   randomization = None 
)

Initialize a new state.

Parameters
[in]angular_velocity_base_in_baseBody angular velocity of the floating-base link.
[in]joint_configurationJoint configuration vector (not including the floating-base joint).
[in]joint_velocityJoint velocity vector (not including the floating-base joint).
[in]linear_velocity_base_to_world_in_worldLinear velocity of the floating-base link in the world frame.
[in]orientation_base_in_worldRotation from the floating-base frame to the world frame.
[in]position_base_in_worldPosition of the floating-base frame in the world frame.
[in]randomizationOptional state randomization distribution.

Member Function Documentation

◆ sample_angular_velocity()

np.ndarray upkie.utils.robot_state.RobotState.sample_angular_velocity (   self,
np.random.Generator   np_random 
)

Sample an angular velocity around the one in this state.

Parameters
[in]np_randomNumPy random number generator.
Returns
Sampled angular velocity.

◆ sample_linear_velocity()

np.ndarray upkie.utils.robot_state.RobotState.sample_linear_velocity (   self,
np.random.Generator   np_random 
)

Sample a linear velocity around the one in this state.

Parameters
[in]np_randomNumPy random number generator.
Returns
Sampled linear velocity.

◆ sample_orientation()

ScipyRotation upkie.utils.robot_state.RobotState.sample_orientation (   self,
np.random.Generator   np_random 
)

Sample an orientation around the one in this state.

Parameters
[in]np_randomNumPy random number generator.
Returns
Sampled orientation.

◆ sample_position()

np.ndarray upkie.utils.robot_state.RobotState.sample_position (   self,
np.random.Generator  np_random 
)

Sample a position around the one in this state.

Parameters
[in]np_randomNumPy random number generator.
Returns
Randomized position.

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