GroundVehicle Propagators

Top  Previous  Next

FreeFlyer uses the Step command to propagate a GroundVehicle object forward or backward in time. A common usage, shown in the following image, is to enclose the Step command in a While loop, in order to repeat the propagation over some specified time period. The GroundVehicle.StepToEpoch() method can also be used to propagate the GroundVehicle to a user-specified epoch.

 

Propagation Loop

Propagation Loop

 

The Step command can be used the same way whether the GroundVehicle object uses a GroundHeading or GroundWaypoints propagator. If a GroundHeading propagator is used, the Step command will cause FreeFlyer to use the vehicle's location and surface velocity to calculate the state of the GroundVehicle based on the amount of time specified by the Step Size. If the GroundWaypoints propagator is used, the the Step command will cause FreeFlyer to step the GroundVehicle to the next waypoint based on the propagator's selected interpolation method.

 

 

Propagating the GroundVehicle Object


The GroundVehicle's state can be propagated using one of two propagator types. The first type is the Simple Motion model, which uses the vehicle's location and surface velocity as an input and propagates the state forward in time when the Step command is called. The second type is the Waypoints Motion model, which overwrites the GroundVehicle's initial state and instead updates the GroundVehicle's position to follow a series of waypoints when the GroundVehicle is stepped, interpolating between each as appropriate. The different approaches are covered below.

 

GroundVehicle Propagator GUI

GroundVehicle Propagator GUI

 

Setting the Simple Motion Model

A user can define a GroundVehicle object's propagator to use the "Simple Motion" model in FreeFlyer script as shown in the example below.

 

GroundVehicle GroundVehicle1;

 

GroundVehicle1.SetPropagatorType(TypeOf(GroundHeading));

Alias gvHeadingProp = (GroundVehicle1.Propagator AsType GroundHeading);

 

GroundVehicle1.Heading          = 90; // deg (East Heading)

GroundVehicle1.Speed          = 65; // km/hr

 

Setting the Waypoints Motion Model

A user can define a GroundVehicle object's propagator to use the "Waypoints Motion" model in FreeFlyer script as shown in the example below.

 

GroundVehicle1.SetPropagatorType(TypeOf(GroundWaypoints));

Alias gvWaypointProp = (GroundVehicle1.Propagator AsType GroundWaypoints);

 

After a user has set the GroundVehicle's propagator to use the "Waypoints Motion" model they can load any number of waypoints by providing the waypoint epoch, latitude, and longitude. The ability to add waypoints is only available via script as shown in the example below.

 

// Define Waypoint Epochs, Latitude, and Longitude

TimeSpanArray epochs = {"Jan 01 2020 10:00:00.000".ParseCalendarDate(), "Jan 01 2020 12:00:00.000".ParseCalendarDate(), "Jan 01 2020 14:00:00.000".ParseCalendarDate()};

Array latitudes  = {  38.0,  38.5,  39.0};

Array longitudes = { 260.0, 260.5, 261.0};

 

// Add Waypoints to the GroundVehicle

gvWaypointProp.AddWaypoints(epochs, latitudes, longitudes);

 

Note: When adding waypoints to a GroundVehicle using the AddWaypoints() method a user must ensure that all wapoints and epochs are inputted in monotonic order.

 

Setting the GroundVehicle Step Size

A user can define a GroundVehicle's step size by type casting the current propagator as shown in the example below.

 

(GroundVehicle1.Propagator AsType GroundHeading).StepSize = TIMESPAN(300 seconds);

 

GroundVehicle Interpolation Method

If you have configured the GroundVehcicle object to use the "Waypoints Motion" model a user has the ability to control the interpolation method used when traversing from one waypoint to the next. The current methods available are the Step Function, Rhumb Line, or Geodesic interpolation. The Geodesic interpolation method is the default for the "Waypoints Motion" model propagator.

 

The StepFunction method simply snaps between two waypoints, by waiting at the previous waypoint until the GroundVehicle's epoch is the same as the next waypoints epoch.

The Rhumb Line method moves between two waypoints by maintaining a constant bearing between the previous and next waypoint.

The Geodesic method moves between waypoints using a geodetic path that creates the shortest distance between the two points on a central bodies surface.

 

A different method can be configured for a GroundVehicle propagator by assigning the InterpolationMethod property.

 

gvWaypointProp.InterpolationMethod = "RhumbLine";

 

Stepping the GroundVehicle

Once the GroundVehicle object's propagator has been defined, you can use the Step command to advance the GroundVehicle by the current propagator step size.

 

// Step Command

Step GroundVehicle1;

 

// or

 

// Step Method

GroundVehicle1.Step();

 

If a user wishes to sync the GroundVehicle's epoch with another object's epoch or wants to step to a specific epoch they must use the StepToEpoch() method.

 

// Sync the GroundVehicle's Epoch

GroundVehicle1.StepToEpoch(Spacecraft1.Epoch);

 

// or

 

// Step the GroundVehicle for one hour

GroundVehicle1.StepToEpoch(GroundVehicle1.Epoch + TIMESPAN(1 hours));

 

Note: The WhileStepping and Step to commands are not presently supported for the GroundVehicle object.

 

 

Example: Using the Simple Motion Propagator to Step a GroundVehicle


In this example, the GroundVehicle is propagated for one hour on a westward heading at a constant speed.

 

GroundVehicle GroundVehicle1;

 

GroundVehicle1.SetPropagatorType(TypeOf(GroundHeading));

Alias gvHeadingProp = (GroundVehicle1.Propagator AsType GroundHeading);

 

// Configure the GroundVehicle Heading and Speed

GroundVehicle1.Heading = 270; // deg (West Heading)

GroundVehicle1.Speed   = 70;  // km/hr

 

// Propagate GroundVehicle using a Constant Heading and Speed

While(GroundVehicle1.ElapsedTime <= TIMESPAN(1 hours));

 

 Step GroundVehicle1;

 View GroundVehicle1;

 

End;

 

 

Example: Using the Waypoints Motion Propagator to Step a GroundVehicle


In this example, the GroundVehicle is propagated for one hour to multiple waypoints. The system will automatically adjust the speed as necessary.

 

GroundVehicle GroundVehicle1;

 

GroundVehicle1.SetPropagatorType(TypeOf(GroundWaypoints));

Alias gvWaypointProp = (GroundVehicle1.Propagator AsType GroundWaypoints);

 

// Define Waypoint Epochs, Latitude, and Longitude

TimeSpanArray epochs = {"Jan 01 2020 01:00:00.000".ParseCalendarDate(), , "Jan 01 2020 02:00:00.000".ParseCalendarDate(), "Jan 01 2020 03:00:00.000".ParseCalendarDate()};

Array latitudes      = {  38.846127 /*Colorado Springs*/,   39.742043 /*Denver*/,   40.014984 /*Boulder*/};

Array longitudes     = {-104.800644 /*Colorado Springs*/, -104.991531 /*Denver*/, -104.270546 /*Boulder*/};

 

// Add Waypoints to the GroundVehicle

gvWaypointProp.AddWaypoints(epochs, latitudes, longitudes);

 

// Propagate GroundVehicle along Waypoints

While(GroundVehicle1.ElapsedTime <= TIMESPAN(3 hours));

 

 Step GroundVehicle1;

 View GroundVehicle1;

 

End;

 

 

See Also


Step Command

FreeFlyer Script Syntax and the FreeForm Script Editor