public class PlanUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PlanUtilities.Waypoint
This inner class represents a IMC plan waypoint.
|
Constructor and Description |
---|
PlanUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<double[]> |
computeLocations(Maneuver m)
Compute all the locations for a given maneuver message
|
static java.util.Collection<double[]> |
computeLocations(PlanSpecification plan)
Given a PlanSpecification message, computes its list of WGS84 locations
|
static java.util.Collection<PlanUtilities.Waypoint> |
computeWaypoints(Maneuver m)
Similar to
computeLocations(Maneuver) but in this case returning
waypoint structures |
static java.util.List<PlanUtilities.Waypoint> |
computeWaypoints(PlanSpecification plan)
This method parses an IMC plan and calculates its waypoints.
|
static PlanSpecification |
createPlan(java.lang.String plan_id,
float speed,
float altitude,
double[] latitudes,
double[] longitudes)
Creates a plan containing a FollowPath maneuver that goes through all provided waypoints
|
static PlanSpecification |
createPlan(java.lang.String id,
Maneuver... maneuvers)
Creates an IMC plan corresponding to given maneuver sequence
|
static java.util.List<Maneuver> |
getManeuverCycleOrSequence(PlanSpecification plan)
This method calculates the maneuver sequence present in a plan.
|
static java.util.List<Maneuver> |
getManeuverSequence(PlanSpecification plan)
This method calculates the maneuver sequence present in a plan.
|
static float |
getSpeed(Maneuver m) |
static PlanUtilities.Waypoint |
getStartLocation(Maneuver m)
Compute the start location for a given maneuver
|
static boolean |
isCyclic(PlanSpecification plan)
Check if Plan is Cyclic (last maneuver transits to first one)
|
public static java.util.List<Maneuver> getManeuverCycleOrSequence(PlanSpecification plan)
plan
- The plan to parsed.getManeuverSequence(PlanSpecification)
public static java.util.List<Maneuver> getManeuverSequence(PlanSpecification plan)
plan
- The plan to parsed.public static java.util.Collection<double[]> computeLocations(PlanSpecification plan)
plan
- a PlanSpecification messagepublic static java.util.List<PlanUtilities.Waypoint> computeWaypoints(PlanSpecification plan)
plan
- An IMC plan to be parsedPlanUtilities.Waypoint
public static java.util.Collection<PlanUtilities.Waypoint> computeWaypoints(Maneuver m)
computeLocations(Maneuver)
but in this case returning
waypoint structuresm
- The Maneuver to be converted to a list of waypointsPlanUtilities.Waypoint
public static float getSpeed(Maneuver m)
public static PlanUtilities.Waypoint getStartLocation(Maneuver m)
m
- The maneuvernull
if no
waypoint can be calculated.public static java.util.Collection<double[]> computeLocations(Maneuver m)
m
- The maneuverpublic static boolean isCyclic(PlanSpecification plan)
plan
- The planpublic static PlanSpecification createPlan(java.lang.String id, Maneuver... maneuvers)
id
- The id of the generated planmaneuvers
- The maneuvers contained in the planpublic static PlanSpecification createPlan(java.lang.String plan_id, float speed, float altitude, double[] latitudes, double[] longitudes)
plan_id
- The id of the plan to be createdspeed
- The speed to use for the plan (in m/s)altitude
- The altitude to use for the plan (in m). For values <= 0, DEPTH will be used instead.latitudes
- The latitude coordinates, in degrees.longitudes
- The longitude coordinates, in degrees.