SMACC2
Loading...
Searching...
No Matches
cp_goal_checker.hpp
Go to the documentation of this file.
1// Copyright 2025 Robosoft 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#pragma once
16
17#include <cmath>
18#include <smacc2/smacc.hpp>
19
20namespace cl_px4_mr
21{
22
23class CpVehicleLocalPosition;
24
26{
27public:
29 virtual ~CpGoalChecker();
30
31 void onInitialize() override;
32 void update() override;
33
34 void setGoal(float x, float y, float z, float xy_tolerance = 0.5f, float z_tolerance = 0.3f);
35 void clearGoal();
36 bool isGoalActive() const;
37
39
40private:
42 float goalX_ = 0.0f;
43 float goalY_ = 0.0f;
44 float goalZ_ = 0.0f;
45 float xyTolerance_ = 0.5f;
46 float zTolerance_ = 0.3f;
47 bool goalActive_ = false;
48};
49
50} // namespace cl_px4_mr
CpVehicleLocalPosition * localPosition_
void setGoal(float x, float y, float z, float xy_tolerance=0.5f, float z_tolerance=0.3f)
smacc2::SmaccSignal< void()> onGoalReached_