Observations#
- genesis_forge.mdp.observations.contact_force(env: GenesisEnv, contact_manager: ContactManager) torch.Tensor[source]#
Returns the vector norm contact force at each contact point.
- Parameters:
env – The Genesis Forge environment
contact_manager – The contact manager to check for contact
- Returns:
Shape (num_envs, num_contacts).
- Return type:
- genesis_forge.mdp.observations.current_actions(env: GenesisEnv, action_manager: PositionActionManager = None) torch.Tensor[source]#
The most current step actions.
- genesis_forge.mdp.observations.entity_angular_velocity(env: GenesisEnv, entity_manager: EntityManager = None, entity_attr: str = 'robot') torch.Tensor[source]#
The angular velocity of the entity’s base link, in the entity’s local frame.
- Parameters:
env – The Genesis environment containing the entity
entity_manager – The entity manager for the robot/entity the observation is being computed for. This is slightly more performant than using the entity_attr parameter.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if entity_manager is provided.
- Returns:
The angular velocity of the entity’s base link, in the entity’s local frame.
- Return type:
- genesis_forge.mdp.observations.entity_dofs_force(env: GenesisEnv, actuator_manager: ActuatorManager = None, entity_attr: str = 'robot', dofs_idx: list[int] = None, clip_to_max_force: bool = False, action_manager: PositionActionManager = None) torch.Tensor[source]#
The DOF’s force being experienced.
- Parameters:
env – The Genesis environment containing the entity
actuator_manager – The actuator manager for the robot/entity. This bypasses the need for dofs_idx and entity_attr parameters.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if action_manager is provided.
dofs_idx – The indices of the DOFs to get the force of. This isn’t necessary if action_manager is provided.
clip_to_max_force – Clip the force to the maximum force defined in the action_manager.
action_manager – (deprecated) The action manager for the robot/entity.
- Returns:
The force of the entity’s DOFs.
- Return type:
- genesis_forge.mdp.observations.entity_dofs_position(env: GenesisEnv, actuator_manager: ActuatorManager = None, entity_attr: str = 'robot', dofs_idx: list[int] = None, action_manager: PositionActionManager = None) torch.Tensor[source]#
The position of the entity’s DOFs.
- Parameters:
env – The Genesis environment containing the entity
actuator_manager – The actuator manager for the robot/entity. This bypasses the need for dofs_idx and entity_attr parameters.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if action_manager is provided.
dofs_idx – The indices of the DOFs to get the position of. This isn’t necessary if action_manager is provided.
action_manager – (deprecated) The action manager for the robot/entity. This bypasses the need for dofs_idx and entity_attr parameters.
- Returns:
The position of the entity’s DOFs.
- Return type:
- genesis_forge.mdp.observations.entity_dofs_velocity(env: GenesisEnv, action_manager: PositionActionManager = None, entity_attr: str = 'robot', dofs_idx: list[int] = None) torch.Tensor[source]#
The velocity of the entity’s DOFs.
- Parameters:
env – The Genesis environment containing the entity
action_manager – The action manager for the robot/entity. This is slightly more performant than using the entity_attr parameter.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if action_manager is provided.
dofs_idx – The indices of the DOFs to get the velocity of. This isn’t necessary if action_manager is provided.
- Returns:
The velocity of the entity’s DOFs.
- Return type:
- genesis_forge.mdp.observations.entity_linear_velocity(env: GenesisEnv, entity_manager: EntityManager = None, entity_attr: str = 'robot') torch.Tensor[source]#
The linear velocity of the entity’s base link, in the entity’s local frame.
- Parameters:
env – The Genesis environment containing the entity
entity_manager – The entity manager for the robot/entity the observation is being computed for. This is slightly more performant than using the entity_attr parameter.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if entity_manager is provided.
- Returns:
The linear velocity of the entity’s base link, in the entity’s local frame.
- Return type:
- genesis_forge.mdp.observations.entity_projected_gravity(env: GenesisEnv, entity_manager: EntityManager = None, entity_attr: str = 'robot') torch.Tensor[source]#
The projected gravity of the entity’s base link, in the entity’s local frame.
- Parameters:
env – The Genesis environment containing the entity
entity_manager – The entity manager for the robot/entity the observation is being computed for. This is slightly more performant than using the entity_attr parameter.
entity_attr – The attribute name of the entity in the environment. This isn’t necessary if entity_manager is provided.
- Returns:
The projected gravity of the entity’s base link, in the entity’s local frame.
- Return type:
- genesis_forge.mdp.observations.has_contact(env: GenesisEnv, contact_manager: ContactManager, threshold=1.0) torch.Tensor[source]#
Return boolean (1/0) for each link in the contact manager that meets the contact threshold.
- Parameters:
env – The Genesis Forge environment
contact_manager – The contact manager to check for contact
threshold – The minimum force necessary for contact detection (default: 1.0)
- Returns:
1 for each link meeting the contact threshold
- genesis_forge.mdp.observations.read_imu(env: GenesisEnv, imu: genesis.gs.sensors.IMU) torch.Tensor[source]#
Makes an IMU reading and returns the concatenated linear acceleration and angular velocity readings.
Example:
self.imu = gs.sensors.IMU( entity_idx=self.robot.idx, pos_offset=(0.24, 0.0, 0.0), euler_offset=(0.0, 0.0, 0.0), ) ... ObservationManager( self, cfg={ "imu_sensor": { "fn": self.imu_observation, }, } )
- Returns:
Shape (n_envs, 6) — [lin_acc_xyz, ang_vel_xyz] per env.
- Return type: