SMACC2
Loading...
Searching...
No Matches
cb_load_kml_mission.hpp
Go to the documentation of this file.
1// Copyright 2026 RobosoftAI Inc.
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// http://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/*****************************************************************************************************************
16 *
17 * Authors: Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#pragma once
22
25#include <smacc2/smacc.hpp>
26
27#include <string>
28#include <vector>
29
30namespace cl_px4_mr
31{
32
33class CpKmlMissionLoader;
34
35// Loads the mission backbone (first LineString) from an ABSOLUTE KML path into
36// CpKmlMissionLoader. The config file is a convenience: if it is absent or
37// unparseable and a fallback backbone was supplied, the fallback is stored
38// instead and the behavior still succeeds (with a WARN). Failure is posted
39// only when nothing usable is available.
41{
42public:
43 explicit CbLoadKmlMission(
44 std::string absoluteKmlPath, std::vector<GeoPoint> fallbackBackbone = {});
45
46 void setFilePath(const std::string & absoluteKmlPath) { path_ = absoluteKmlPath; }
47 void setFallback(std::vector<GeoPoint> fallbackBackbone)
48 {
49 fallback_ = std::move(fallbackBackbone);
50 }
51
52 template <typename TOrthogonal, typename TSourceObject>
58
59 void onEntry() override;
60 void onExit() override;
61
62private:
64 std::string path_;
65 std::vector<GeoPoint> fallback_;
66};
67
68} // namespace cl_px4_mr
void setFilePath(const std::string &absoluteKmlPath)
CbLoadKmlMission(std::string absoluteKmlPath, std::vector< GeoPoint > fallbackBackbone={})
std::vector< GeoPoint > fallback_
void setFallback(std::vector< GeoPoint > fallbackBackbone)
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)