﻿ GroundVehicle Attitude Systems

# GroundVehicle Attitude Systems

Top  Previous  Next

The attitude system specifies the method FreeFlyer uses to orient a GroundVehicle with respect to the chosen attitude reference frame. Most of the attitude systems supported for Spacecraft objects, detailed on the Spacecraft Attitude Systems guide, are also available for the GroundVehicle. The list of those available for the GroundVehicle is as follows.

As noted above, the available systems themselves are analogous to those used with the Spacecraft object, and thus most documentation here will refer back to that page while providing new examples specifically as they pertain to the GroundVehicle use-case.

## Euler Angles

An Euler angle attitude system consists of an Euler sequence, the Euler angles, and Euler angle rates. Any orientation can be converted to any other orientation through a maximum of three rotations about the specified axes. A brief synopsis of the role of each of these elements is provided below, but more information can be found in the Spacecraft Attitude Systems guide.

 •The Euler sequence specifies the sequence of axes about which the Euler angles will be applied. •The Euler angles themselves represent the angles the frame is rotated around the specified axes. •The Euler rate then defines the rate at which the corresponding Euler angle is changing over time.

An example of assigning and manipulating all of these elements is provided below.

 GroundVehicle1.AttitudeSystem   = "EulerAngles"; GroundVehicle1.AttitudeRefFrame = "MJ2000";   // Set the GroundVehicle's Euler Sequence to 3-1-3 GroundVehicle1.EulerSequence = {3, 1, 3};   // 30-degree rotation about the 1st axis (specified by EulerSequence[0]) // 45-degree rotation about the 2nd axis (specified by EulerSequence[1]) // 5-degree rotation about the 3rd axis  (specified by EulerSequence[2]) GroundVehicle1.EulerAngles = {30, 45, 5};   // The 1st Euler Angle is not changing with time // The 2nd Euler Angle is changing at a rate of 0.1 degrees per second // The 3rd Euler Angle is changing at a rate of 2 degrees per second GroundVehicle1.EulerRates = {0, 0.1, 2};

## Quaternions

The Quaternion attitude system consists of a hyper-complex number, the elements of which can be used to calculate the components of a vector representing an axis of rotation, and an angle to be rotated about that axis. In the GroundVehicle.Quaternion array, the first 3 components represent the quaternion vector and the last component represents the quaternion scalar. See the Spacecraft Attitude Systems guide for complete documentation on how quaternions are defined in FreeFlyer. A brief example of setting quaternions in FreeFlyer script follows, additionally showing how you might set the angular velocity associated with the quaternions as well.

 GroundVehicle1.AttitudeSystem  = "Quaternion"; GroundVehicle1.Quaternion      = {0, 0, 0, 1}; GroundVehicle1.AngularVelocity = {0, 0, 0};

## Attitude Matrix

The attitude matrix allows the user to define a GroundVehicle's attitude with respect to its attitude reference frame using a 3x3 matrix. More information on the requirements of the attitude matrix is found on the Spacecraft Attitude Systems guide. As shown below, it's easy to set an attitude matrix for a GroundVehicle in FreeFlyer script.

 GroundVehicle1.AttitudeSystem = "AttitudeMatrix";   GroundVehicle1.AttitudeMatrix = [1, 0, 0;                                  0, 1, 0;                                  0, 0, 1];