Application
Application class for managing the overall SDK lifecycle and vehicle fleet.
#include <application.hpp>Classes
class Application
Main entry point for a RogueSDK application; owns the fleet lifecycle and fleet-wide configuration.
Application()Constructs the Application instance.
Available since v0.1auto Init(const std::string& config_path) -> boolInitialize the entire fleet from a master configuration.
Available since v0.1| Parameter | Type | Description |
|---|---|---|
config_path |
const std::string& |
Path to the vehicle configuration file (e.g., "config.json"). |
Returns: true if initialization was successful, false otherwise.
auto InitFromIdentityService(const std::string& host = "127.0.0.1", uint16_t port = 14595) -> boolInitialize the fleet by fetching configuration from the identity service.
Available since v0.2| Parameter | Type | Description |
|---|---|---|
host |
const std::string& |
Identity service host (default 127.0.0.1). |
port |
uint16_t |
Identity service port (default 14595). |
Returns: true if the service responded and configuration loaded successfully.
auto Start() -> voidRuns the fleet update loops in the background (non-blocking).
auto Run() -> voidBlocking call that keeps the application alive.
auto Stop() -> voidGracefully shuts down all vehicles and services.
auto GetVehicle(uint8_t id) -> VehicleSharedPtrRetrieves a vehicle by its unique ID. Returns nullptr if not found.
| Parameter | Type | Description |
|---|---|---|
id |
uint8_t |
Unique identifier for the vehicle (0-255). |
Returns: Shared pointer to the Vehicle instance, or nullptr if not found.
auto GetAllVehicles() -> std::vector<VehicleSharedPtr>Returns a list of all vehicles in the fleet.
Returns: Vector of shared pointers to all Vehicle instances managed by the application.
auto SetMission(std::function<void(const std::vector<VehicleSharedPtr>&)> mission_func) -> voidSets mission logic that coordinates multiple vehicles.
| Parameter | Type | Description |
|---|---|---|
mission_func |
std::function<void(const std::vector<VehicleSharedPtr>&)> |
Callable receiving the full fleet; invoked by StartMission. |
auto StartMission(uint8_t vehicle_id = 0) -> voidTriggers mission start on ground control or executes onboard start.
| Parameter | Type | Description |
|---|---|---|
vehicle_id |
uint8_t |
Optional ID of the vehicle to trigger. If 0, triggers all vehicles. |
auto GetSaveLocation() const -> std::stringReturns the configured save location: "ground", "onboard", or "both". Defaults to "ground" if not set in config.
Returns: std::string
auto GetPilotDevice() -> PilotDevicePtrProvides access to the primary pilot controller.
Coming soonNot yet implemented — currently returns nullptr.
Returns: Shared pointer to the primary PilotDevice.
auto GetAllPilotDevices() -> std::vector<PilotDevicePtr>Provides access to all pilot controllers in a multi-pilot configuration.
Coming soonNot yet implemented — currently returns an empty vector.
Returns: Vector of shared pointers to all configured pilot devices.