tbp.monty.frameworks.actions#
tbp.monty.frameworks.actions.action_samplers#
- class ActionSampler(rng: Generator | None = None, actions: list[type[Action]] | None = None)[source]#
Bases:
object
An Action factory that samples from a set of available action types.
- class ConstantSampler(absolute_degrees: float = 0.0, actions: list[type[Action]] | None = None, direction: VectorXYZ | None = None, location: VectorXYZ | None = None, rng: Generator | None = None, rotation_degrees: float = 5.0, rotation_quat: QuaternionWXYZ | None = None, translation_distance: float = 0.004, **kwargs: Any)[source]#
Bases:
ActionSampler
An Action factory using constant, prespecified action parameters.
This Action factory samples actions with constant parameters. The values of action parameters used are set at initialization time and remain the same for all actions created by this factory. For example, if you specify rotation_degrees=5.0, all actions created by this factory that take a rotation_degrees parameter will have it set to 5.0.
When sampling an Action, only applicable parameters are used. For example, when sampling a MoveForward action, only the ConstantCreator’s translation_distance parameter is used to determine the action’s distance parameter.
- sample_move_forward(agent_id: str) MoveForward [source]#
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
- class UniformlyDistributedSampler(actions: list[type[Action]] | None = None, max_absolute_degrees: float = 360.0, min_absolute_degrees: float = 0.0, max_rotation_degrees: float = 20.0, min_rotation_degrees: float = 0.0, max_translation: float = 0.05, min_translation: float = 0.05, rng: Generator | None = None, **kwargs: Any)[source]#
Bases:
ActionSampler
An Action factory using uniformly distributed action creation parameters.
This Action factory samples actions with parameters that are uniformly distributed within a given range. The range of values for each parameter is set at initialization time and remains the same for all actions created by this factory.
When sampling an Action, only applicable parameters are used. For example, when sampling a MoveForward action, only the UniformlyDistributedCreator’s translation_high and translation_low parameters are used to determine the action’s distance parameter.
- sample_move_forward(agent_id: str) MoveForward [source]#
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
tbp.monty.frameworks.actions.actions#
- class Action(agent_id: str)[source]#
Bases:
Protocol
An action that can be taken by an agent.
Actions are generated by the MotorSystem and are executed by an Actuator.
- class LookDown(agent_id: str, rotation_degrees: float, constraint_degrees: float = 90.0)[source]#
Bases:
Action
Rotate the agent downwards by a specified number of degrees.
- act(actuator: LookDownActuator) None [source]#
- static sample(agent_id: str, sampler: LookDownActionSampler) LookDown [source]#
- class LookUp(agent_id: str, rotation_degrees: float, constraint_degrees: float = 90.0)[source]#
Bases:
Action
Rotate the agent upwards by a specified number of degrees.
- act(actuator: LookUpActuator) None [source]#
- static sample(agent_id: str, sampler: LookUpActionSampler) LookUp [source]#
- class MoveForward(agent_id: str, distance: float)[source]#
Bases:
Action
Move the agent forward by a specified distance.
- act(actuator: MoveForwardActuator) None [source]#
- static sample(agent_id: str, sampler: MoveForwardActionSampler) MoveForward [source]#
- class MoveForwardActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_move_forward(agent_id: str) MoveForward [source]#
- class MoveForwardActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_move_forward(action: MoveForward) None [source]#
- class MoveTangentially(agent_id: str, distance: float, direction: Tuple[float, float, float])[source]#
Bases:
Action
Move the agent tangentially.
Moves the agent tangentially to the current orientation by a specified distance along a specified direction.
- act(actuator: MoveTangentiallyActuator) None [source]#
- static sample(agent_id: str, sampler: MoveTangentiallyActionSampler) MoveTangentially [source]#
- class MoveTangentiallyActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- class MoveTangentiallyActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_move_tangentially(action: MoveTangentially) None [source]#
- class OrientHorizontal(agent_id: str, rotation_degrees: float, left_distance: float, forward_distance: float)[source]#
Bases:
Action
Move the agent in the horizontal plane.
Moves the agent in the horizontal plane compensating for the horizontal motion with a rotation in the horizontal plane.
- act(actuator: OrientHorizontalActuator) None [source]#
- static sample(agent_id: str, sampler: OrientHorizontalActionSampler) OrientHorizontal [source]#
- class OrientHorizontalActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- class OrientHorizontalActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_orient_horizontal(action: OrientHorizontal) None [source]#
- class OrientVertical(agent_id: str, rotation_degrees: float, down_distance: float, forward_distance: float)[source]#
Bases:
Action
Move the agent in the vertical plane.
Moves the agent in the vertical plane compensating for the vertical motion with a rotation in the vertical plane.
- act(actuator: OrientVerticalActuator) None [source]#
- static sample(agent_id: str, sampler: OrientVerticalActionSampler) OrientVertical [source]#
- class OrientVerticalActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- class OrientVerticalActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_orient_vertical(action: OrientVertical) None [source]#
- class SetAgentPitch(agent_id: str, pitch_degrees: float)[source]#
Bases:
Action
Set the agent pitch rotation in degrees.
Note that unless otherwise changed, the sensors maintain identity orientation with regard to the agent. So, this will also adjust the pitch of agent’s sensors with regard to the environment.
- act(actuator: SetAgentPitchActuator) None [source]#
- static sample(agent_id: str, sampler: SetAgentPitchActionSampler) SetAgentPitch [source]#
- class SetAgentPitchActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- class SetAgentPitchActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_agent_pitch(action: SetAgentPitch) None [source]#
- class SetAgentPose(agent_id: str, location: Tuple[float, float, float], rotation_quat: Tuple[float, float, float, float])[source]#
Bases:
Action
Set the agent pose.
Set the agent pose to absolute location coordinates and orientation in the environment.
- act(actuator: SetAgentPoseActuator) None [source]#
- static sample(agent_id: str, sampler: SetAgentPoseActionSampler) SetAgentPose [source]#
- class SetAgentPoseActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- class SetAgentPoseActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_agent_pose(action: SetAgentPose) None [source]#
- class SetSensorPitch(agent_id: str, pitch_degrees: float)[source]#
Bases:
Action
Set the sensor pitch rotation.
Note that this does not update the pitch of the agent. Imagine the body associated with the eye remaining in place, while the eye moves.
- act(actuator: SetSensorPitchActuator) None [source]#
- static sample(agent_id: str, sampler: SetSensorPitchActionSampler) SetSensorPitch [source]#
- class SetSensorPitchActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- class SetSensorPitchActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_pitch(action: SetSensorPitch) None [source]#
- class SetSensorPose(agent_id: str, location: Tuple[float, float, float], rotation_quat: Tuple[float, float, float, float])[source]#
Bases:
Action
Set the sensor pose.
Set the sensor pose to absolute location coordinates and orientation in the environment.
- act(actuator: SetSensorPoseActuator) None [source]#
- static sample(agent_id: str, sampler: SetSensorPoseActionSampler) SetSensorPose [source]#
- class SetSensorPoseActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- class SetSensorPoseActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_pose(action: SetSensorPose) None [source]#
- class SetSensorRotation(agent_id: str, rotation_quat: Tuple[float, float, float, float])[source]#
Bases:
Action
Set the sensor rotation relative to the agent.
- act(actuator: SetSensorRotationActuator) None [source]#
- static sample(agent_id: str, sampler: SetSensorRotationActionSampler) SetSensorRotation [source]#
- class SetSensorRotationActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
- class SetSensorRotationActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_rotation(action: SetSensorRotation) None [source]#
- class SetYaw(agent_id: str, rotation_degrees: float)[source]#
Bases:
Action
Set the agent body yaw rotation.
- act(actuator: SetYawActuator) None [source]#
- static sample(agent_id: str, sampler: SetYawActionSampler) SetYaw [source]#
- class TurnLeft(agent_id: str, rotation_degrees: float)[source]#
Bases:
Action
Rotate the agent to the left.
- act(actuator: TurnLeftActuator) None [source]#
- static sample(agent_id: str, sampler: TurnLeftActionSampler) TurnLeft [source]#
- class TurnRight(agent_id: str, rotation_degrees: float)[source]#
Bases:
Action
Rotate the agent to the right.
- act(actuator: TurnRightActuator) None [source]#
- static sample(agent_id: str, sampler: TurnRightActionSampler) TurnRight [source]#