Easy Navigation
Loading...
Searching...
No Matches
FaultyMapsManager.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_MAPS_MANAGER__FAULT_INJECTION__FAULTYMAPSMANAGER_HPP_
20#define EASYNAV_MAPS_MANAGER__FAULT_INJECTION__FAULTYMAPSMANAGER_HPP_
21
22#include <string>
23
24#include "easynav_core/MapsManagerBase.hpp"
25
26namespace easynav
27{
28
39class FaultyMapsManager : public MapsManagerBase
40{
41public:
43 void on_initialize() override;
44
46 void update(NavState & nav_state) override;
47
49 [[nodiscard]] int updates() const {return updates_;}
50
51private:
52 std::string fault_ {"none"};
53 int fault_after_ {0};
54 double hang_time_ {1.0};
55
56 int updates_ {0};
57};
58
59} // namespace easynav
60
61#endif // EASYNAV_MAPS_MANAGER__FAULT_INJECTION__FAULTYMAPSMANAGER_HPP_
Maps manager that misbehaves on purpose, to test how EasyNav copes with it.
Definition FaultyMapsManager.hpp:40
void update(NavState &nav_state) override
Does nothing, or injects the fault.
Definition FaultyMapsManager.cpp:52
int updates() const
Updates run so far (to check that it keeps being called).
Definition FaultyMapsManager.hpp:49
void on_initialize() override
Reads the parameters; throws on an unknown fault.
Definition FaultyMapsManager.cpp:32
A generic, type-safe, thread-safe blackboard to hold runtime state.
Definition NavState.hpp:87
Definition CircularBuffer.hpp:24