Class ParametersHandler
Defined in File parameters_handler.hpp
Class Documentation
-
class ParametersHandler
Handles getting parameters and dynamic parmaeter changes.
Public Types
-
using get_param_func_t = void(const rclcpp::Parameter ¶m)
-
using post_callback_t = void()
-
using pre_callback_t = void()
Public Functions
-
ParametersHandler() = default
Constructor for mppi::ParametersHandler.
-
explicit ParametersHandler(const rclcpp_lifecycle::LifecycleNode::WeakPtr &parent)
Constructor for mppi::ParametersHandler.
- Parameters:
parent – Weak ptr to node
-
void start()
Starts processing dynamic parameter changes.
-
rcl_interfaces::msg::SetParametersResult dynamicParamsCallback(std::vector<rclcpp::Parameter> parameters)
Dynamic parameter callback.
-
inline auto getParamGetter(const std::string &ns)
Get an object to retreive parameters.
- Parameters:
ns – Namespace to get parameters within
- Returns:
Parameter getter object
-
template<typename T>
void addPostCallback(T &&callback) Set a callback to process after parameter changes.
- Parameters:
callback – Callback function
-
template<typename T>
void addPreCallback(T &&callback) Set a callback to process before parameter changes.
- Parameters:
callback – Callback function
-
template<typename T>
void setDynamicParamCallback(T &setting, const std::string &name) Set a parameter to a dynamic parameter callback.
- Parameters:
setting – Parameter
name – Name of parameter
-
inline std::mutex *getLock()
Get mutex lock for changing parameters.
- Returns:
Pointer to mutex
Protected Functions
-
template<typename SettingT, typename ParamT>
void getParam(SettingT &setting, const std::string &name, ParamT default_value, ParameterType param_type = ParameterType::Dynamic) Gets parameter.
Protected Attributes
-
std::mutex parameters_change_mutex_
-
rclcpp::Logger logger_ = {rclcpp::get_logger("MPPIController")}
-
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr on_set_param_handler_
-
rclcpp_lifecycle::LifecycleNode::WeakPtr node_
-
std::string node_name_
-
bool verbose_ = {false}
-
std::unordered_map<std::string, std::function<get_param_func_t>> get_param_callbacks_
-
std::vector<std::function<pre_callback_t>> pre_callbacks_
-
std::vector<std::function<post_callback_t>> post_callbacks_
-
using get_param_func_t = void(const rclcpp::Parameter ¶m)