rover_nexus_core 0.2.0

Wire-format message types (Cap'n Proto + JSON) for communication between robotic vehicles and a robot orchestration server: Rover Nexus
Documentation
// Copyright 2026 Rottinghaus Dynamics
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// states.rs
// Useful states and conversions between message types
//
// Mission status sent back
use crate::core_model::{Feature, MissionCapability, MissionStatus, SettingUpdate};
use crate::spatial_types::GeoPose;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MissionState {
    pub unix_time_ms: i64,
    pub mission_id: String,
    pub run_id: String,
    pub name: String,
    pub user_id: String, // Who deployed the mission
    pub status: MissionStatus,
    pub detail: String,
    pub fault_code: String,
    pub progress_pct: f32,
    pub current_path_id: Option<String>,
    pub current_target: Option<GeoPose>,
    pub current_target_index: u32,
    pub total_waypoints: u32,
    // When this mission actually started running on the robot.
    pub scheduled_start: DateTime<Utc>,
    pub time_started: Option<DateTime<Utc>>,
    // The robots current best guess of when it will be done.
    // This can move as the situation changes.
    pub expected_end_time: Option<DateTime<Utc>>,
    // Set when mission reaches a terminal state (COMPLETE / CANCELED / ERROR).
    pub time_completed: Option<DateTime<Utc>>,
    /// Mission-wide parameters from the command
    pub mission_parameters: Vec<SettingUpdate>,
    /// The spatial feature for this mission (path, waypoints, or coverage area)
    pub feature: Option<Feature>,
    /// What features or services this mission should use
    pub capabilities: Vec<MissionCapability>,
}