-
Notifications
You must be signed in to change notification settings - Fork 16
DeadReckoning_BPFL
Dead Reckoning Blueprint Function Library. Houses functions for performing dead reckoning.
class UDeadReckoning_BPFL
: public UBlueprintFunctionLibrary
- CoreMinimal
- Kismet/BlueprintFunctionLibrary
- DISEnumsAndStructs
- PDUMasterInclude
- DIS_BPFL
- glm/gtx/quaternion
Access | Type | Name | Description | |
---|---|---|---|---|
Private | Static Const | double | MIN_ROTATION_RATE |
Access | Return | Name | Description | |
---|---|---|---|---|
Private | Static | FRotator | CalculateDeadReckonedEulerAnglesFromQuaternion(glm::dvec3 AngularVelocityVector, FQuat EntityRotationQuaternion, float DeltaTime) | Calculates the Psi, Theta, Phi orientation for the entity from the given orientation quaternion. Utilized as a final step in converting quaternion OtherParameters to an orientation |
Private | Static | void | CalculateDeadReckonedOrientation(double PsiRadians, double ThetaRadians, double PhiRadians, glm::dvec3 AngularVelocityVector, float DeltaTime, double& OutPsiRadians, double& OutThetaRadians, double& OutPhiRadians) | Calculates the new orientation vector using the given velocity, acceleration, and time increment |
Private | Static | glm::dvec3 | CalculateDeadReckonedPosition(glm::dvec3 PositionVector, glm::dvec3 VelocityVector, glm::dvec3 AccelerationVector, double DeltaTime) | Calculates the new position vector using the given velocity, acceleration, and time increment |
Private | Static | void | ConvertLocalRotatorToPsiThetaPhiRadians(FEntityStatePDU EntityPDUToDeadReckon, FRotator LocalRotatorRadians, FPsiThetaPhi& PsiThetaPhiRadians) | Converts the given local heading, pitch, roll rotator in radians into world space psi, theta, phi rotator in radians |
Public | Static | glm::dmat3 | CreateDeadReckoningMatrix(glm::dvec3 AngularVelocityVector, double DeltaTime) | Calculates and returns the dead reckoning matrix used for calculating entity rotation |
Public | Static | FQuat | CreateDeadReckoningQuaternion(glm::dvec3 AngularVelocityVector, double DeltaTime) | Calculates and returns the dead reckoning quaternion used for calculating entity rotation |
Public | Static | bool | DeadReckoning(FEntityStatePDU EntityPDUToDeadReckon, float DeltaTime, [FEntityStatePDU& DeadReckonedEntityPDU) | Performs dead reckoning on the given Entity PDU |
Public | Static | TArray<uint8> | FormOtherParameters(EDeadReckoningAlgorithm DeadReckoningAlgorithm, FRotator EntityPsiThetaPhiRadians, FVector EntityECEFLocation) | Forms the Other Parameters section utilized in Dead Reckoning Parameters |
Private | Static | glm::dvec3 | GetEntityBodyDeadReckonedPosition(glm::dvec3 InitialPositionVector, glm::dvec3 BodyVelocityVector, glm::dvec3 BodyLinearAccelerationVector, glm::dvec3 BodyAngularVelocityVector, glm::dvec3 EntityOrientation, double DeltaTime) | Calculates the new position vector using the given velocity, acceleration, and time increment given in body coordinates |
Public | Static | glm::dmat3 | GetEntityOrientationMatrix(double PsiRadians, double ThetaRadians, double PhiRadians) | Calculates a DIS entity's orientation matrix from the provided Euler angles |
Public | Static | FQuat | GetEntityOrientationQuaternion(double PsiRadians, double ThetaRadians, double PhiRadians) | Calculates a DIS entity's orientation quaternion from the provided Euler angles |
Private | Static | bool | GetLocalEulerAngles(TArray<uint8> OtherDeadReckoningParameters, FRotator& LocalRotator) | Gets the local yaw, pitch, and roll from the other parameters structure. The yaw, pitch, and roll act on the entity's local North, East, Down vectors |
Private | Static | bool | GetLocalQuaternionAngles(TArray<uint8> OtherDeadReckoningParameters, FQuat& EntityOrientation) | Gets the local entity orientation as a quaternion from the dead reckoning other parameters |
Private | Static | bool | IsMachineLittleEndian() | Checks if the machine is in Little Endian. Returns true if Little Endian or false if Big Endian |
double MIN_ROTATION_RATE
private static FRotator CalculateDeadReckonedEulerAnglesFromQuaternion
(
glm::dvec3 AngularVelocityVector,
FQuat EntityRotationQuaternion,
float DeltaTime
)
Calculates the Psi, Theta, Phi orientation for the entity from the given orientation quaternion. Utilized as a final step in converting quaternion OtherParameters to an orientation.
Parameter | Description |
---|---|
AngularVelocityVector | The angular velocity of the entity |
EntityRoationQuaternion | The orientation quaternion to use to calculate the Psi, Theta, Phi orientation |
DeltaTime | The time increment for dead reckoning calculation |
Returns |
---|
Psi, Theta, Phi orientation for the entity from the given orientation quaternion as FRotator |
private static void CalculateDeadReckonedOrientation
(
double PsiRadians,
double ThetaRadians,
double PhiRadians,
glm::dvec3 AngularVelocityVector,
float DeltaTime,
double& OutPsiRadians,
double& OutThetaRadians,
double& OutPhiRadians
)
Calculates the new orientation vector using the given velocity, acceleration, and time increment.
Parameter | Description |
---|---|
PsiRadians | The rotation about the Z axis in radians |
ThetaRadians | The rotation about the Y axis in radians |
PhiRadians | The rotation about the X axis in radians |
AngularVelocityVector | The angular velocity vector in body coordinates |
DeltaTime | The time increment for dead reckoning calculation |
&OutPsiRadians | The rotation about the Z axis in radians after time step DeltaTime |
&OutThetaRadians | The rotation about the Y axis in radians after time step DeltaTime |
&OutPhiRadians | The rotation about the X axis in radians after time step DeltaTime |
private static glm::dvec3 CalculateDeadReckonedPosition
(
glm::dvec3 PositionVector,
glm::dvec3 VelocityVector,
glm::dvec3 AccelerationVector,
double DeltaTime
)
Calculates the new position vector using the given velocity, acceleration, and time increment.
Parameter | Description |
---|---|
PositionVector | The initial position of the entity in world coordinates |
VelocityVector | The initial velocity in world coordinates |
AccelerationVector | The initial acceleration in world coordinates |
DeltaTime | The time increment for dead reckoning calculation |
Returns |
---|
Calculated entity ECEF position vector |
private static void ConvertLocalRotatorToPsiThetaPhiRadians
(
FEntityStatePDU EntityPDUToDeadReckon,
FRotator LocalRotatorRadians,
FPsiThetaPhi& PsiThetaPhiRadians
)
Converts the given local heading, pitch, roll rotator in radians into world space psi, theta, phi rotator in radians.
Parameter | Description |
---|---|
EntityPDUToDeadReckon | The entity PDU being dead reckoned. |
LocalRotatorRadians | The local heading, pitch, roll rotator in radians |
&PsiThetaPhiRadians | The world space psi, theta, phi rotator in radians |
public static glm::dmat3 CreateDeadReckoningMatrix
(
glm::dvec3 AngularVelocityVector,
double DeltaTime
)
Calculates and returns the dead reckoning matrix used for calculating entity rotation.
Parameter | Description |
---|---|
AngularVelocityVector | The angular velocity vector in body coordinates |
DeltaTime | The time increment for dead reckoning calculations |
Returns |
---|
The dead reckoning matrix used for calculating entity rotation |
public static FQuat CreateDeadReckoningQuaternion
(
glm::dvec3 AngularVelocityVector,
double DeltaTime
)
Calculates and returns the dead reckoning quaternion used for calculating entity rotation.
Parameter | Description |
---|---|
AngularVelocityVector | The angular velocity vector in body coordinates |
DeltaTime | The time increment for dead reckoning calculations |
Returns |
---|
The dead reckoning quaternion used for calculating entity rotation |
public static bool DeadReckoning
(
FEntityStatePDU EntityPDUToDeadReckon,
float DeltaTime,
FEntityStatePDU& DeadReckonedEntityPDU
)
Performs dead reckoning on the given Entity PDU.
Category: GRILL DIS|Dead Reckoning
Parameter | Description |
---|---|
EntityPDUToDeadReckon | The Entity State PDU to perform dead reckoning on |
DeltaTime | The time elapsed in seconds that dead reckoning should be calculated for |
DeadReckonedEntityPDU | The resulting dead reckoned EntityStatePDU that contains all of the dead reckoning information |
Returns |
---|
True if dead reckoning algorithm is supported and dead reckoning was performed. False otherwise. |
public static TArray<uint8> FormOtherParameters
(
EDeadReckoningAlgorithm DeadReckoningAlgorithm,
FRotator EntityPsiThetaPhiRadians,
FVector EntityECEFLocation
)
Forms the Other Parameters section utilized in Dead Reckoning Parameters.
Category: GRILL DIS|Dead Reckoning
Parameter | Description |
---|---|
DeadReckoningAlgorithm | The dead reckoning algorithm being used |
EntityPsiThetaPhiRadians | The Psi, Theta, Phi orientation of the entity |
EntityECEFLocation | The ECEF location of the entity |
Returns |
---|
An array of 15 bytes representing the Other Parameters of the Dead Reckoning PDU |
private static glm::dvec3 GetEntityBodyDeadReckonedPosition
(
glm::dvec3 InitialPositionVector,
glm::dvec3 BodyVelocityVector,
glm::dvec3 BodyLinearAccelerationVector,
glm::dvec3 BodyAngularVelocityVector,
glm::dvec3 EntityOrientation,
double DeltaTime
)
Calculates the new position vector using the given velocity, acceleration, and time increment given in body coordinates.
Parameter | Description |
---|---|
InitialPositionVector | The initial position of the entity in body coordinates |
BodyVelocityVector | The initial velocity in body coordinates |
BodyLinearAccelerationVector | The initial linear acceleration in body coordinates |
BodyAngularVelocityVector | The initial angular acceleration in body coordinates |
EntityOrientation | The orientation of the entity (Psi[Yaw]/Theta[Pitch]/Phi[Roll]) in radians |
DeltaTime | The time increment for dead reckoning calculation |
Returns |
---|
The new position vector using the given velocity, acceleration, and time increment given in body coordinates |
public static glm::dmat3 GetEntityOrientationMatrix
(
double PsiRadians,
double ThetaRadians,
double PhiRadians
)
Calculates a DIS entity's orientation matrix from the provided Euler angles.
Parameter | Description |
---|---|
PsiRadians | The rotation about the Z axis in radians |
ThetaRadians | The rotation about the Y axis in radians |
PhiRadians | The rotation about the X axis in radians |
Returns |
---|
Orientation matrix from the provided Euler angles of a DIS entity |
public static FQuat GetEntityOrientationQuaternion
(
double PsiRadians,
double ThetaRadians,
double PhiRadians
)
Calculates a DIS entity's orientation quaternion from the provided Euler angles.
Parameter | Description |
---|---|
PsiRadians | The rotation about the Z axis in radians |
ThetaRadians | The rotation about the Y axis in radians |
PhiRadians | The rotation about the X axis in radians |
Returns |
---|
A DIS entity's orientation quaternion from the provided Euler angles |
private static bool GetLocalEulerAngles
(
TArray<uint8> OtherDeadReckoningParameters,
FRotator& LocalRotator
)
Gets the local yaw, pitch, and roll from the other parameters structure. The yaw, pitch, and roll act on the entity's local North, East, Down vectors.
Parameter | Description |
---|---|
OtherDeadReckoningParameters | The 120 bits sent as part of the dead reckoning parameters marked as other parameters sent as an array of bytes |
LocalRotator | The local yaw, pitch, and roll of the entity in radians. Yaw is the heading from true north, positive to the right. Pitch is the elevation angle above or below the local horizon, positive up. Roll is the bank angle from the local horizontal, positive tile to the right |
Returns |
---|
False if OtherDeadReckoningParameters has a length less than 15 or the Dead Reckoning Parameter Type (OtherDeadReckoningParameters[0] ) is not set to 1. True otherwise. |
private static bool GetLocalQuaternionAngles
(
TArray<uint8> OtherDeadReckoningParameters,
FQuat& EntityOrientation
)
Gets the local entity orientation as a quaternion from the dead reckoning other parameters.
Parameter | Description |
---|---|
OtherDeadReckoningParameters | The 120 bits sent as part of the dead reckoning parameters marked as other parameters sent as an array of bytes |
EntityOrientation | The four-valued unit quaternion that represents the entity's orientation |
Returns |
---|
False if OtherDeadReckoningParameters has a length less than 15 or the Dead Reckoning Parameter Type (OtherDeadReckoningParameters[0] ) is not set to 2. True otherwise. |
private static bool IsMachineLittleEndian()
Checks if the machine is in Little Endian. Returns true if Little Endian or false if Big Endian.
Returns |
---|
True if machine is little Endian. False if machine is big Endian. |