ResetHead

December 9, 2022 ยท View on GitHub

from tdw.replicant.actions.reset_head import ResetHead

Reset the head to its neutral rotation.

The head will continuously move over multiple communicate() calls until it is at its neutral rotation.


Fields

  • duration The duration of the motion in seconds.

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

  • status The current status of the action. By default, this is ongoing (the action isn't done).

  • initialized If True, the action has initialized. If False, the action will try to send get_initialization_commands(resp) on this frame.

  • done If True, this action is done and won't send any more commands.

  • duration The duration of the motion in seconds.

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

  • status The current status of the action. By default, this is ongoing (the action isn't done).

  • initialized If True, the action has initialized. If False, the action will try to send get_initialization_commands(resp) on this frame.

  • done If True, this action is done and won't send any more commands.

  • status The current status of the action. By default, this is ongoing (the action isn't done).

  • initialized If True, the action has initialized. If False, the action will try to send get_initialization_commands(resp) on this frame.

  • done If True, this action is done and won't send any more commands.


Functions

__init__

ResetHead(duration, scale_duration)

ParameterTypeDefaultDescription
durationfloatThe duration of the motion in seconds.
scale_durationboolIf True, duration will be multiplied by framerate / 60), ensuring smoother motions at faster-than-life simulation speeds.

get_initialization_commands

self.get_initialization_commands(resp, static, dynamic, image_frequency)

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.
image_frequencyImageFrequencyAn ImageFrequency value describing how often image data will be captured.

Returns: A list of commands to initialize this action.

get_ongoing_commands

self.get_ongoing_commands(resp, static, dynamic)

Evaluate an action per-frame to determine whether it's done.

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 commands to send to the build to continue the action.

get_end_commands

self.get_end_commands(resp, static, dynamic, image_frequency)

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.
image_frequencyImageFrequencyAn ImageFrequency value describing how often image data will be captured.

Returns: A list of commands that must be sent to end any action.