Template Function ros2_ouster::declare_parameter_if_not_declared(NodeTypePtr, const std::string&, const rclcpp::ParameterValue&, const rcl_interfaces::msg::ParameterDescriptor&)

Function Documentation

template<typename NodeTypePtr>
void ros2_ouster::declare_parameter_if_not_declared(NodeTypePtr node_ptr, const std::string &param_name, const rclcpp::ParameterValue &default_value, const rcl_interfaces::msg::ParameterDescriptor &parameter_descriptor = rcl_interfaces::msg::ParameterDescriptor())

Declares static ROS2 parameter and sets it to a given value if it was not already declared.

This utility function is borrowed from the navigation2 package.

Parameters:
  • node_ptr[in] A node in which given parameter to be declared

  • param_name[in] The name of parameter

  • default_value[in] Parameter value to initialize with

  • parameter_descriptor[in] Parameter descriptor (optional)