SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_px4_mr
include
cl_px4_mr
components
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
20
namespace
cl_px4_mr
21
{
22
23
class
CpVehicleLocalPosition;
24
25
class
CpGoalChecker
:
public
smacc2::ISmaccComponent
,
public
smacc2::ISmaccUpdatable
26
{
27
public
:
28
CpGoalChecker
();
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
38
smacc2::SmaccSignal
<void()>
onGoalReached_
;
39
40
private
:
41
CpVehicleLocalPosition
*
localPosition_
=
nullptr
;
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
cl_px4_mr::CpGoalChecker
Definition
cp_goal_checker.hpp:26
cl_px4_mr::CpGoalChecker::CpGoalChecker
CpGoalChecker()
Definition
cp_goal_checker.cpp:21
cl_px4_mr::CpGoalChecker::goalActive_
bool goalActive_
Definition
cp_goal_checker.hpp:47
cl_px4_mr::CpGoalChecker::goalY_
float goalY_
Definition
cp_goal_checker.hpp:43
cl_px4_mr::CpGoalChecker::localPosition_
CpVehicleLocalPosition * localPosition_
Definition
cp_goal_checker.hpp:41
cl_px4_mr::CpGoalChecker::~CpGoalChecker
virtual ~CpGoalChecker()
Definition
cp_goal_checker.cpp:23
cl_px4_mr::CpGoalChecker::goalZ_
float goalZ_
Definition
cp_goal_checker.hpp:44
cl_px4_mr::CpGoalChecker::update
void update() override
Definition
cp_goal_checker.cpp:31
cl_px4_mr::CpGoalChecker::goalX_
float goalX_
Definition
cp_goal_checker.hpp:42
cl_px4_mr::CpGoalChecker::setGoal
void setGoal(float x, float y, float z, float xy_tolerance=0.5f, float z_tolerance=0.3f)
Definition
cp_goal_checker.cpp:50
cl_px4_mr::CpGoalChecker::onGoalReached_
smacc2::SmaccSignal< void()> onGoalReached_
Definition
cp_goal_checker.hpp:38
cl_px4_mr::CpGoalChecker::xyTolerance_
float xyTolerance_
Definition
cp_goal_checker.hpp:45
cl_px4_mr::CpGoalChecker::zTolerance_
float zTolerance_
Definition
cp_goal_checker.hpp:46
cl_px4_mr::CpGoalChecker::onInitialize
void onInitialize() override
Definition
cp_goal_checker.cpp:25
cl_px4_mr::CpGoalChecker::isGoalActive
bool isGoalActive() const
Definition
cp_goal_checker.cpp:65
cl_px4_mr::CpGoalChecker::clearGoal
void clearGoal()
Definition
cp_goal_checker.cpp:63
cl_px4_mr::CpVehicleLocalPosition
Definition
cp_vehicle_local_position.hpp:26
smacc2::ISmaccComponent
Definition
component.hpp:30
smacc2::ISmaccUpdatable
Definition
smacc_updatable.hpp:33
smacc2::SmaccSignal
Definition
smacc_signal.hpp:46
cl_px4_mr
Definition
cl_px4_mr.hpp:28
smacc.hpp
Generated by
1.12.0