Gimbals#

Description#

The Gimbals component simulates a series of servo actuated gimbals. This is useful for redirecting the thrust from the Motors or Boosters components.

This component represents rotation about two different, arbitrary axes on a link, represented as gimbal_unit_1 and gimbal_unit_2. Rotation follows the right handed rotation rule.

Class Description#

class PyFlyt.core.abstractions.Gimbals(p: BulletClient, physics_period: float, np_random: Generator, gimbal_unit_1: ndarray, gimbal_unit_2: ndarray, gimbal_tau: ndarray, gimbal_range_degrees: ndarray)#

A set of actuated gimbals.

The Gimbals component simulates a series of servo actuated gimbals. Each gimbal can rotate about two arbitrary axis that may not be orthogonal to each other.

Parameters:
  • p (bullet_client.BulletClient) – PyBullet physics client ID.

  • physics_period (float) – physics period of the simulation.

  • np_random (np.random.Generator) – random number generator of the simulation.

  • gimbal_unit_1 (np.ndarray) – first unit vector that the gimbal rotates around.

  • gimbal_unit_2 (np.ndarray) – second unit vector that the gimbal rotates around.

  • gimbal_tau (np.ndarray) – gimbal actuation time constant.

  • gimbal_range_degrees (np.ndarray) – gimbal actuation range in degrees.

compute_rotation(gimbal_command: ndarray) ndarray#

Returns a rotation vector after the gimbal rotation.

Parameters:

gimbal_command (np.ndarray) – (num_gimbals, 2) array of floats between [-1, 1].

Returns:

(num_gimbals, 3, 3) rotation matrices for all gimbals.

Return type:

rotation_vector (np.ndarray)

get_states() ndarray#

Gets the current state of the components.

Returns:

a (2 * num_gimbals, ) array where every pair of values represents the current state of the gimbal

Return type:

np.ndarray

physics_update()#

This does not need to be called for gimbals, call compute_rotation instead.

reset()#

Reset the gimbals.

state_update()#

This does not need to be called for gimbals.