AutoAPMS
Resilient Robot Mission Management
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_configuration.hpp"
19
25
31{
32
33namespace model = auto_apms_behavior_tree::model;
34
39class MissionBuildHandlerBase : public auto_apms_behavior_tree::TreeBuildHandler
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 MissionBuildHandlerBase(rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr);
48
49private:
50 bool setBuildRequest(
51 const std::string & build_request, const NodeManifest & node_manifest,
52 const std::string & root_tree_name) override final;
53
54 TreeDocument::TreeElement buildTree(TreeDocument & doc, TreeBlackboard & bb) override final;
55
56protected:
57 /* Virtual methods */
58
59 virtual void buildBringUp(TreeDocument::TreeElement & sub_tree, const std::vector<TreeResource::Identity> & trees);
60
61 virtual void buildMission(
62 TreeDocument::TreeElement & sub_tree, const std::vector<TreeResource::Identity> & trees) = 0;
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 MissionConfiguration mission_config_;
83};
84
85} // namespace auto_apms_mission
Base class for plugins that implement patterns for creating behavior trees using a standardized inter...
Models for all available behavior tree nodes.
Mission design utilities incorporating behavior trees to model the complexity of arbitrary operations...
Configuration parameters for standard missions supported by AutoAPMS.