Easy Navigation
Toggle main menu visibility
Loading...
Searching...
No Matches
easynav_system
include
easynav_system
safety
ParameterFreezer.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
17
18
#ifndef EASYNAV_SYSTEM__SAFETY__PARAMETERFREEZER_HPP_
19
#define EASYNAV_SYSTEM__SAFETY__PARAMETERFREEZER_HPP_
20
21
#include <atomic>
22
#include <map>
23
#include <mutex>
24
#include <string>
25
#include <vector>
26
27
#include "rclcpp/rclcpp.hpp"
28
29
#include "
easynav_system/safety/ConfigurationFingerprint.hpp
"
30
31
namespace
easynav::safety
32
{
33
41
class
ParameterFreezer
42
{
43
public
:
45
void
freeze
(
const
Nodes
& nodes);
46
48
[[nodiscard]]
bool
is_frozen
()
const
{
return
!handles_.empty();}
49
51
void
accept_new_parameters
(
bool
accept) {accept_new_ = accept;}
52
53
private
:
55
std::map<std::string, std::map<std::string, rclcpp::ParameterValue>> frozen_;
56
std::mutex
mutex_
;
57
std::atomic<bool> accept_new_ {
true
};
58
std::vector<rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr> handles_;
59
};
60
61
}
// namespace easynav::safety
62
63
#endif
// EASYNAV_SYSTEM__SAFETY__PARAMETERFREEZER_HPP_
ConfigurationFingerprint.hpp
Fingerprint (dump and SHA-256) of the EasyNav configuration.
easynav::safety::ParameterFreezer
Rejects any change to the parameters of a set of nodes.
Definition
ParameterFreezer.hpp:42
easynav::safety::ParameterFreezer::accept_new_parameters
void accept_new_parameters(bool accept)
Whether parameters not frozen yet may be declared (on by default).
Definition
ParameterFreezer.hpp:51
easynav::safety::ParameterFreezer::is_frozen
bool is_frozen() const
Whether anything was frozen.
Definition
ParameterFreezer.hpp:48
easynav::safety::ParameterFreezer::freeze
void freeze(const Nodes &nodes)
Freezes the current values of nodes. Called again, refreezes them.
Definition
ParameterFreezer.cpp:27
easynav::safety
Definition
CommandGuard.hpp:36
easynav::safety::Nodes
std::map< std::string, rclcpp_lifecycle::LifecycleNode::SharedPtr > Nodes
EasyNav nodes by name.
Definition
ConfigurationFingerprint.hpp:30
easynav::mutex_
std::mutex Singleton< C >::mutex_
Definition
Singleton.hpp:80
Generated by
1.18.0