Reset

June 5, 2023 ยท View on GitHub

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)

ParameterTypeDefaultDescription
targetsList[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.
absoluteboolIf 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_atfloatIf the final ReachFor action ends and the hand is this distance or less from the target, the motion succeeds.
max_distancefloatIf at the start of the first ReachFor action the target is further away than this distance from the hand, the action fails.
armsList[Arm]The Arm(s) that will reach for each target.
dynamicReplicantDynamicThe ReplicantDynamic data that changes per communicate() call.
collision_detectionCollisionDetectionThe CollisionDetection rules.
previousOptional[Action]The previous action. Can be None.
durationfloatThe 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_durationboolIf True, duration will be multiplied by framerate / 60, ensuring smoother motions at faster-than-life simulation speeds.
from_heldboolIf 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_pointstrThe 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)

ParameterTypeDefaultDescription
respList[bytes]The response from the build.
staticReplicantStaticThe ReplicantStatic data that doesn't change after the Replicant is initialized.
dynamicReplicantDynamicThe ReplicantDynamic data that changes per communicate() call.

Returns: A list of Action.