ParameterHandler
A library that handles parameters at runtime.
Use the parameter handler in your program

Access the parameter handler

The parameter handler is stored as a global shared pointer and accessible from your executable or helper library using the following lines of code.

Set the parameter handler

In the source file of your main application you should set the parameter handler type. Three parameter handlers are provided:

ParameterHandlerNone

This is an empty implementation of the parameter handler.

ParameterHandlerStd

The ParameterHandlerStd allows setting/getting parameters from everywhere in the current application.

ParameterHandlerRos

The ros implementation of the parameter handler additionally provides services that allow setting/getting the parameters via ros. It can be used in combination with the rqt plugin.

Add variables to the parameter handler

A parameter must be of the templated type parameter_handler::Parameter.

Where T stands for any of the supported types (see below).
The parameter can be initialized as follows:

// Initializer list
MyConstructor():
myDoubleParam_ ("myDouble", 33.33, 11.11, 66.66)
{
}
// Copy constructor
myDoubleParam_ = parameter_handler::Parameter<double>("myDouble", 33.33, 11.11, 66.66);
// Setters
myDoubleParam_.setName("myDouble");
myDoubleParam_.setValue(33.33);
myDoubleParam_.setDefaultValue(33.33);
myDoubleParam_.setMinValue(11.11);
myDoubleParam_.setMaxValue(66.66);

The parameter can then easily be added to the handler.

parameter_handler::handler->addParam(myDoubleParam_);

Cleanup the parameter handler

You should shutdown the parameter handler in the destructor of your main application. E.g the parameter handler ros should shutdown all ros communication as long as the nodehandle is still valid.

Supported types

The currently supported types are:

  • Integral Types
    bool
    char
    char16_t
    char32_t
    wchar_t
    signed char
    short int
    int
    long int
    unsigned char
    unsigned short int
  • Floating Point Types
    float
    double
  • Eigen Integral Types
    Eigen::Matrix3i
    Eigen::MatrixXi
    Eigen::Vector2i
    Eigen::Vector3i
    Eigen::Vector4i
    Eigen::VectorXi
  • Eigen Floating Point Types
    Eigen::Matrix3f
    Eigen::MatrixXf
    Eigen::Vector2f
    Eigen::Vector3f
    Eigen::Vector4f
    Eigen::VectorXf
    Eigen::Matrix3d
    Eigen::MatrixXd
    Eigen::Vector2d
    Eigen::Vector3d
    Eigen::Vector4d
    Eigen::VectorXd