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) None [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]#
- Return type:
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- Return type:
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- Return type:
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- Return type:
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- Return type:
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- Return type:
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- Return type:
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- Return type:
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
- Return type:
- 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]#
- Return type:
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- Return type:
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- Return type:
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- Return type:
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- Return type:
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- Return type:
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- Return type:
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- Return type:
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
- Return type:
tbp.monty.frameworks.actions.actions#
- class Action(agent_id: str) None [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) None [source]#
Bases:
Action
Rotate the agent downwards by a specified number of degrees.
- act(actuator: LookDownActuator) None [source]#
- Return type:
- static sample(agent_id: str, sampler: LookDownActionSampler) LookDown [source]#
- Return type:
- class LookUp(agent_id: str, rotation_degrees: float, constraint_degrees: float = 90.0) None [source]#
Bases:
Action
Rotate the agent upwards by a specified number of degrees.
- act(actuator: LookUpActuator) None [source]#
- Return type:
- class MoveForward(agent_id: str, distance: float) None [source]#
Bases:
Action
Move the agent forward by a specified distance.
- act(actuator: MoveForwardActuator) None [source]#
- Return type:
- static sample(agent_id: str, sampler: MoveForwardActionSampler) MoveForward [source]#
- Return type:
- class MoveForwardActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_move_forward(agent_id: str) MoveForward [source]#
- Return type:
- class MoveForwardActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_move_forward(action: MoveForward) None [source]#
- Return type:
- class MoveTangentially(agent_id: str, distance: float, direction: Tuple[float, float, float]) None [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]#
- Return type:
- static sample(agent_id: str, sampler: MoveTangentiallyActionSampler) MoveTangentially [source]#
- Return type:
- class MoveTangentiallyActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_move_tangentially(agent_id: str) MoveTangentially [source]#
- Return type:
- class MoveTangentiallyActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_move_tangentially(action: MoveTangentially) None [source]#
- Return type:
- class OrientHorizontal(agent_id: str, rotation_degrees: float, left_distance: float, forward_distance: float) None [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]#
- Return type:
- static sample(agent_id: str, sampler: OrientHorizontalActionSampler) OrientHorizontal [source]#
- Return type:
- class OrientHorizontalActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_orient_horizontal(agent_id: str) OrientHorizontal [source]#
- Return type:
- class OrientHorizontalActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_orient_horizontal(action: OrientHorizontal) None [source]#
- Return type:
- class OrientVertical(agent_id: str, rotation_degrees: float, down_distance: float, forward_distance: float) None [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]#
- Return type:
- static sample(agent_id: str, sampler: OrientVerticalActionSampler) OrientVertical [source]#
- Return type:
- class OrientVerticalActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_orient_vertical(agent_id: str) OrientVertical [source]#
- Return type:
- class OrientVerticalActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_orient_vertical(action: OrientVertical) None [source]#
- Return type:
- class SetAgentPitch(agent_id: str, pitch_degrees: float) None [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]#
- Return type:
- static sample(agent_id: str, sampler: SetAgentPitchActionSampler) SetAgentPitch [source]#
- Return type:
- class SetAgentPitchActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_agent_pitch(agent_id: str) SetAgentPitch [source]#
- Return type:
- class SetAgentPitchActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_agent_pitch(action: SetAgentPitch) None [source]#
- Return type:
- class SetAgentPose(agent_id: str, location: Tuple[float, float, float], rotation_quat: Tuple[float, float, float, float]) None [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]#
- Return type:
- static sample(agent_id: str, sampler: SetAgentPoseActionSampler) SetAgentPose [source]#
- Return type:
- class SetAgentPoseActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_agent_pose(agent_id: str) SetAgentPose [source]#
- Return type:
- class SetAgentPoseActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_agent_pose(action: SetAgentPose) None [source]#
- Return type:
- class SetSensorPitch(agent_id: str, pitch_degrees: float) None [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]#
- Return type:
- static sample(agent_id: str, sampler: SetSensorPitchActionSampler) SetSensorPitch [source]#
- Return type:
- class SetSensorPitchActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_pitch(agent_id: str) SetSensorPitch [source]#
- Return type:
- class SetSensorPitchActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_pitch(action: SetSensorPitch) None [source]#
- Return type:
- class SetSensorPose(agent_id: str, location: Tuple[float, float, float], rotation_quat: Tuple[float, float, float, float]) None [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]#
- Return type:
- static sample(agent_id: str, sampler: SetSensorPoseActionSampler) SetSensorPose [source]#
- Return type:
- class SetSensorPoseActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_pose(agent_id: str) SetSensorPose [source]#
- Return type:
- class SetSensorPoseActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_pose(action: SetSensorPose) None [source]#
- Return type:
- class SetSensorRotation(agent_id: str, rotation_quat: Tuple[float, float, float, float]) None [source]#
Bases:
Action
Set the sensor rotation relative to the agent.
- act(actuator: SetSensorRotationActuator) None [source]#
- Return type:
- static sample(agent_id: str, sampler: SetSensorRotationActionSampler) SetSensorRotation [source]#
- Return type:
- class SetSensorRotationActionSampler(*args, **kwargs)[source]#
Bases:
Protocol
- sample_set_sensor_rotation(agent_id: str) SetSensorRotation [source]#
- Return type:
- class SetSensorRotationActuator(*args, **kwargs)[source]#
Bases:
Protocol
- actuate_set_sensor_rotation(action: SetSensorRotation) None [source]#
- Return type:
- class SetYaw(agent_id: str, rotation_degrees: float) None [source]#
Bases:
Action
Set the agent body yaw rotation.
- act(actuator: SetYawActuator) None [source]#
- Return type:
- class TurnLeft(agent_id: str, rotation_degrees: float) None [source]#
Bases:
Action
Rotate the agent to the left.
- act(actuator: TurnLeftActuator) None [source]#
- Return type:
- static sample(agent_id: str, sampler: TurnLeftActionSampler) TurnLeft [source]#
- Return type:
- class TurnRight(agent_id: str, rotation_degrees: float) None [source]#
Bases:
Action
Rotate the agent to the right.
- act(actuator: TurnRightActuator) None [source]#
- Return type:
- static sample(agent_id: str, sampler: TurnRightActionSampler) TurnRight [source]#
- Return type: