Class RigidBodyJointExtractor
Extracts joint and rigidbody information for physics-based sensors.
Implements
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: Unity.ML-Agents.dll
Syntax
[MovedFrom("Unity.MLAgents.Extensions.Sensors")]
public class RigidBodyJointExtractor : IJointExtractor
Constructors
RigidBodyJointExtractor(Rigidbody)
Initializes a new instance of the RigidBodyJointExtractor class.
Declaration
public RigidBodyJointExtractor(Rigidbody body)
Parameters
Type | Name | Description |
---|---|---|
Rigidbody | body | The Rigidbody to extract joint information from. |
Methods
NumObservations(PhysicsSensorSettings)
Gets the number of observations for this joint extractor using the provided settings.
Declaration
public int NumObservations(PhysicsSensorSettings settings)
Parameters
Type | Name | Description |
---|---|---|
PhysicsSensorSettings | settings | The physics sensor settings. |
Returns
Type | Description |
---|---|
int | The number of observations for this joint extractor. |
NumObservations(Rigidbody, Joint, PhysicsSensorSettings)
Gets the number of observations for the specified rigidbody and joint using the provided settings.
Declaration
public static int NumObservations(Rigidbody body, Joint joint, PhysicsSensorSettings settings)
Parameters
Type | Name | Description |
---|---|---|
Rigidbody | body | The Rigidbody to extract from. |
Joint | joint | The Joint to extract from. |
PhysicsSensorSettings | settings | The physics sensor settings. |
Returns
Type | Description |
---|---|
int | The number of observations for the specified rigidbody and joint. |
Write(PhysicsSensorSettings, ObservationWriter, int)
Writes the joint observations to the provided writer using the given settings.
Declaration
public int Write(PhysicsSensorSettings settings, ObservationWriter writer, int offset)
Parameters
Type | Name | Description |
---|---|---|
PhysicsSensorSettings | settings | The physics sensor settings. |
ObservationWriter | writer | The observation writer. |
int | offset | The offset in the writer to start writing at. |
Returns
Type | Description |
---|---|
int | The number of floats written to the writer. |