AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
mission_builder_base.hpp
1// Copyright 2024 Robin Müller
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include "auto_apms_behavior_tree/build_handler.hpp"
18#include "auto_apms_mission/mission_config.hpp"
19
25
31{
32
33namespace model = auto_apms_behavior_tree::model;
34
40{
41public:
42 static const std::string ORCHESTRATOR_EXECUTOR_NAME;
43 static const std::string MISSION_EXECUTOR_NAME;
44 static const std::string EVENT_MONITOR_EXECUTOR_NAME;
45 static const std::string EVENT_HANDLER_EXECUTOR_NAME;
46
47 using TreeBuildHandler::TreeBuildHandler;
48
49private:
50 bool setBuildRequest(
51 const std::string & build_request, const std::string & entrypoint,
52 const NodeManifest & node_manifest) override final;
53
54 TreeDocument::TreeElement buildTree(TreeDocument & doc, TreeBlackboard & bb) override final;
55
56protected:
57 /* Virtual methods */
58 virtual MissionConfig createMissionConfig(const std::string & build_request) = 0;
59
60 virtual void buildBringUp(TreeDocument::TreeElement & sub_tree, const std::vector<TreeResource::Identity> & trees);
61
62 virtual void buildMission(TreeDocument::TreeElement & sub_tree, const std::vector<TreeResource::Identity> & trees);
63
64 virtual void buildEventMonitor(
65 TreeDocument::TreeElement & sub_tree,
66 const std::vector<std::pair<TreeResource::Identity, TreeResource::Identity>> & contingencies,
67 const std::vector<std::pair<TreeResource::Identity, TreeResource::Identity>> & emergencies);
68
69 virtual void buildContingencyHandling(
70 TreeDocument::TreeElement & sub_tree,
71 const std::vector<std::pair<TreeResource::Identity, TreeResource::Identity>> & contingencies);
72
73 virtual void buildEmergencyHandling(
74 TreeDocument::TreeElement & sub_tree,
75 const std::vector<std::pair<TreeResource::Identity, TreeResource::Identity>> & emergencies);
76
77 virtual void buildShutDown(TreeDocument::TreeElement & sub_tree, const std::vector<TreeResource::Identity> & trees);
78
79 virtual void configureOrchestratorRootBlackboard(TreeBlackboard & bb);
80
81private:
82 MissionConfig mission_config_;
83};
84
85} // namespace auto_apms_mission
Base class for plugins that implement patterns for creating behavior trees using a standardized inter...
Base class for behavior tree build handlers that are used to configure missions including fallback me...
Models for all available behavior tree nodes.
Mission design utilities incorporating behavior trees to model the complexity of arbitrary operations...
Configuration parameters for generic missions supported by AutoAPMS.