SMACC2
Loading...
Searching...
No Matches
cb_obstacle_guard.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
23#include <functional>
24
27
28namespace cl_px4_mr
29{
30
31// Turns CpForwardObstacleGuard's signals into state machine events
32// EvObstacleTooClose / EvObstacleCleared<CbObstacleGuard, TOrthogonal>.
33// Synchronous behavior: onEntry runs on the state machine thread, so it may
34// resolve the component and create signal connections there. Configure it
35// once on a container state (e.g. the in-flight mode state) so a single
36// instance covers every inner flight state.
38{
39public:
41 virtual ~CbObstacleGuard();
42
43 template <typename TOrthogonal, typename TSourceObject>
49
50 void onEntry() override;
51 void onExit() override;
52
53private:
54 void onTooClose();
55 void onCleared();
56
58 std::function<void()> postTooClose_;
59 std::function<void()> postCleared_;
60};
61
62} // namespace cl_px4_mr
CpForwardObstacleGuard * guard_
std::function< void()> postTooClose_
std::function< void()> postCleared_