Easy Navigation
Loading...
Searching...
No Matches
FaultyPlanner.hpp
Go to the documentation of this file.
1// Copyright 2026 Intelligent Robotics Lab
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
18
19#ifndef EASYNAV_PLANNER__FAULT_INJECTION__FAULTYPLANNER_HPP_
20#define EASYNAV_PLANNER__FAULT_INJECTION__FAULTYPLANNER_HPP_
21
22#include <string>
23
24#include "nav_msgs/msg/path.hpp"
25
26#include "easynav_core/PlannerMethodBase.hpp"
27
28namespace easynav
29{
30
45class FaultyPlanner : public PlannerMethodBase
46{
47public:
49 void on_initialize() override;
50
52 void update(NavState & nav_state) override;
53
54private:
56 nav_msgs::msg::Path plan(const NavState & nav_state) const;
57
58 std::string fault_ {"none"};
59 int fault_after_ {0};
60 double hang_time_ {1.0};
61
62 int updates_ {0};
63 nav_msgs::msg::Path path_;
64};
65
66} // namespace easynav
67
68#endif // EASYNAV_PLANNER__FAULT_INJECTION__FAULTYPLANNER_HPP_
Planner that misbehaves on purpose, to test how EasyNav copes with it.
Definition FaultyPlanner.hpp:46
void update(NavState &nav_state) override
Plans or injects the fault.
Definition FaultyPlanner.cpp:63
void on_initialize() override
Reads the parameters; throws on an unknown fault.
Definition FaultyPlanner.cpp:42
A generic, type-safe, thread-safe blackboard to hold runtime state.
Definition NavState.hpp:87
Definition CircularBuffer.hpp:24