Function cras::getParamVerbose(const ::ros::NodeHandle&, const ::std::string&, const char *, const ::std::string&, const ::cras::GetParamOptions<::std::string>&)

Function Documentation

inline GetParamResult<::std::string> cras::getParamVerbose(const ::ros::NodeHandle &node, const ::std::string &name, const char *defaultValue, const ::std::string &unit = "", const ::cras::GetParamOptions<::std::string> &options = {})

Get the value of the given ROS parameter, falling back to the specified default value, and print out a ROS log message with the loaded values (if specified).

This is a variant allowing use of C-string instead of std::string.

Parameters:
  • node[in] The node handle from which parameters are read.

  • name[in] Name of the parameter.

  • defaultValue[in] The default value to use.

  • unit[in] Optional string serving as a [physical/SI] unit of the parameter, just to make the messages more informative.

  • options[in] Options specifying detailed behavior of this function. Use the braced initializer syntax for comfortable writing, e.g. {.throwIfConvertFails = true, .allowNestedParams = false}.

Returns:

A wrapper containing the loaded parameter value and details about the function execution.