Package io.fleetcoreplatform.Builders
Class MissionPlanBuilder
java.lang.Object
io.fleetcoreplatform.Builders.MissionPlanBuilder
Constructs valid QGroundControl-compatible mission plans (.plan files). Employs a fluent builder
pattern to incrementally stack flight commands, waypoints, and parameter adjustments.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Finalizes the mission configuration and packages all components into a compliant layout.static MissionPlanBuilderbuilder()Initializes a new builder with default operating speeds.cruiseSpeed(int cruiseSpeed) Configures the primary flight speed during mission execution.homePosition(double x, double y, double z) Defines the origin point for the mission.hoverSpeed(int hoverSpeed) Configures the transit speed used while navigating between waypoints.Appends a new sequential command item to the mission plan.
-
Method Details
-
builder
Initializes a new builder with default operating speeds. Starts with a hover speed of 5 m/s and a cruise speed of 15 m/s.- Returns:
- A fresh
MissionPlanBuilderinstance.
-
hoverSpeed
Configures the transit speed used while navigating between waypoints.- Parameters:
hoverSpeed- Target speed in meters per second.- Returns:
- The current builder instance for chaining.
-
cruiseSpeed
Configures the primary flight speed during mission execution.- Parameters:
cruiseSpeed- Target speed in meters per second.- Returns:
- The current builder instance for chaining.
-
item
public MissionPlanBuilder item(int altitude, int altitudeMode, int command, int frame, Double x, Double y, Double z) Appends a new sequential command item to the mission plan. Wraps the raw MAVLink command specifications into the JSON structure expected by PX4/ArduPilot planners.- Parameters:
altitude- Target altitude for the command, depending on the chosen altitude mode.altitudeMode- Determines the altitude frame of reference (e.g., MSL, AGL).command- The standard MAVLink command ID (e.g., 16 for WAYPOINT, 22 for TAKEOFF).frame- The coordinate frame applied to this item (e.g., 3 for GLOBAL_RELATIVE_ALT).x- The primary coordinate (longitude), or null if the command does not require spatial data.y- The secondary coordinate (latitude), or null if the command does not require spatial data.z- An additional parameter field, typically used for altitude overrides or auxiliary parameters.- Returns:
- The current builder instance for chaining.
-
homePosition
Defines the origin point for the mission. This dictates where the drone launches from and where it will return upon a standard RTL (Return to Launch) command.- Parameters:
x- Longitude coordinate.y- Latitude coordinate.z- Altitude above mean sea level.- Returns:
- The current builder instance for chaining.
-
build
Finalizes the mission configuration and packages all components into a compliant layout. Populates empty geofence and rally point objects to ensure schema compliance for standard ground stations.- Returns:
- A fully populated
MissionFileready for JSON serialization.
-