Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 4.66 KB

File metadata and controls

69 lines (43 loc) · 4.66 KB

Reset

from tdw.replicant.ik_plans.reset import Reset

Reset the Replicant to its neutral position and then reach for the target.


Fields

  • duration The total duration of the motion in seconds. Each ReachFor action is a fraction of this. For example, if there are 2 ReachFor actions, then the duration of each of them is duration / 2.

  • scale_duration If True, duration will be multiplied by framerate / 60, ensuring smoother motions at faster-than-life simulation speeds.

  • arms The Arm(s) that will reach for each target.

  • collision_detection The CollisionDetection rules.

  • previous The previous action. Can be None.

  • targets The targets per arm. If int: An object ID. If dict: A position as an x, y, z dictionary. If numpy array: A position as an [x, y, z] numpy array.

  • absolute If True, the target position is in world space coordinates. If False, the target position is relative to the Replicant. Ignored if target is an int.

  • arrived_at If the final ReachFor action ends and the hand is this distance or less from the target, the motion succeeds.

  • max_distance If at the start of the first ReachFor action the target is further away than this distance from the hand, the action fails.

  • from_held If False, the Replicant will try to move its hand to the target. If True, the Replicant will try to move its held object to the target.

  • held_point The bounds point of the held object from which the offset will be calculated. Can be "bottom", "top", etc. For example, if this is "bottom", the Replicant will move the bottom point of its held object to the target. This is ignored if from_held == False or ths hand isn't holding an object.


Functions

__init__

__init__

Reset(targets, absolute, arrived_at, max_distance, arms, dynamic, collision_detection, previous, duration, scale_duration, from_held, held_point)

Parameter Type Default Description
targets List[TARGET] The targets per arm. If int: An object ID. If dict: A position as an x, y, z dictionary. If numpy array: A position as an [x, y, z] numpy array.
absolute bool If True, the target position is in world space coordinates. If False, the target position is relative to the Replicant. Ignored if target is an int.
arrived_at float If the final ReachFor action ends and the hand is this distance or less from the target, the motion succeeds.
max_distance float If at the start of the first ReachFor action the target is further away than this distance from the hand, the action fails.
arms List[Arm] The Arm(s) that will reach for each target.
dynamic ReplicantDynamic The ReplicantDynamic data that changes per communicate() call.
collision_detection CollisionDetection The CollisionDetection rules.
previous Optional[Action] The previous action. Can be None.
duration float The total duration of the motion in seconds. Each ReachFor action is a fraction of this. For example, if there are 2 ReachFor actions, then the duration of each of them is duration / 2.
scale_duration bool If True, duration will be multiplied by framerate / 60, ensuring smoother motions at faster-than-life simulation speeds.
from_held bool If False, the Replicant will try to move its hand to the target. If True, the Replicant will try to move its held object to the target. This is ignored if the hand isn't holding an object.
held_point str The bounds point of the held object from which the offset will be calculated. Can be "bottom", "top", etc. For example, if this is "bottom", the Replicant will move the bottom point of its held object to the target. This is ignored if from_held == False or ths hand isn't holding an object.

get_actions

self.get_actions(resp, static, dynamic)

Parameter Type Default Description
resp List[bytes] The response from the build.
static ReplicantStatic The ReplicantStatic data that doesn't change after the Replicant is initialized.
dynamic ReplicantDynamic The ReplicantDynamic data that changes per communicate() call.

Returns: A list of Action.