Class RigidBodyPoseExtractor
Utility class to track a hierarchy of RigidBodies. These are assumed to have a root node, and child nodes are connect to their parents via Joints.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: Unity.ML-Agents.dll
Syntax
[MovedFrom("Unity.MLAgents.Extensions.Sensors")]
public class RigidBodyPoseExtractor : PoseExtractor
Constructors
RigidBodyPoseExtractor(Rigidbody, GameObject, GameObject, Dictionary<Rigidbody, bool>)
Initialize given a root RigidBody.
Declaration
public RigidBodyPoseExtractor(Rigidbody rootBody, GameObject rootGameObject = null, GameObject virtualRoot = null, Dictionary<Rigidbody, bool> enableBodyPoses = null)
Parameters
Type | Name | Description |
---|---|---|
Rigidbody | rootBody | The root Rigidbody. This has no Joints on it (but other Joints may connect to it). |
GameObject | rootGameObject | Optional GameObject used to find Rigidbodies in the hierarchy. |
GameObject | virtualRoot | Optional GameObject used to determine the root of the poses, separate from the actual Rigidbodies in the hierarchy. For locomotion tasks, with ragdolls, this provides a stabilized reference frame, which can improve learning. |
Dictionary<Rigidbody, bool> | enableBodyPoses | Optional mapping of whether a body's psoe should be enabled or not. |
Methods
GetLinearVelocityAt(int)
Return the world space linear velocity of the i'th object.
Declaration
protected override Vector3 GetLinearVelocityAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the pose for which to get the linear velocity. |
Returns
Type | Description |
---|---|
Vector3 | The world space linear velocity at given index. |
Overrides
GetObjectAt(int)
Return the underlying object at the given index. This is only used for display in the inspector.
Declaration
protected override Object GetObjectAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the object to retrieve. |
Returns
Type | Description |
---|---|
Object | The |
Overrides
GetPoseAt(int)
Return the world space Pose of the i'th object.
Declaration
protected override Pose GetPoseAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the pose to retrieve. |
Returns
Type | Description |
---|---|
Pose | The world space Pose at given index. |