// Copyright (c) 2022 Boston Dynamics, Inc.  All rights reserved.
//
// Downloading, reproducing, distributing or otherwise using the SDK Software
// is subject to the terms and conditions of the Boston Dynamics Software
// Development Kit License (20191101-BDSDK-SL).

syntax = "proto3";

package bosdyn.api.mission;

option java_outer_classname = "MissionServiceProto";

import "bosdyn/api/data_chunk.proto";
import "bosdyn/api/mission/mission.proto";

// The MissionService can be used to specify high level autonomous behaviors for Spot using behavior trees.
service MissionService {
    // Load a mission to run later.
    rpc LoadMission(LoadMissionRequest) returns (LoadMissionResponse) {}

    // Alternative loading method for large missions, that allows you to break the 
    // mission up into multiple streamed requests.  The data chunks should deserialize
    // into a LoadMissionRequest
    rpc LoadMissionAsChunks (stream DataChunk) returns (LoadMissionResponse) {}

    // Start executing a loaded mission.
    // Will not restart a mission that has run to completion. Use RestartMission to do that.
    rpc PlayMission(PlayMissionRequest) returns (PlayMissionResponse) {}

    // Pause mission execution.
    rpc PauseMission(PauseMissionRequest) returns (PauseMissionResponse) {}

    // Stop a running mission.
    // Must use RestartMission, not PlayMission, to begin from the beginning.
    rpc StopMission(StopMissionRequest) returns (StopMissionResponse) {}

    // Start executing a loaded mission from the beginning.
    // Does not need to be called after LoadMission.
    rpc RestartMission(RestartMissionRequest) returns (RestartMissionResponse) {}

    // Get the state of the mission.
    rpc GetState(GetStateRequest) returns (GetStateResponse) {}

    // Get static information regarding the mission. Used to interpret mission state.
    rpc GetInfo(GetInfoRequest) returns (GetInfoResponse) {}

    // Download the mission as it was uploaded to the service.
    rpc GetMission(GetMissionRequest) returns (GetMissionResponse) {}

    // Specify an answer to the question asked by the mission.
    rpc AnswerQuestion(AnswerQuestionRequest) returns (AnswerQuestionResponse) {}
}
