Class GenericParam

Inheritance Relationships

Derived Type

Class Documentation

class GenericParam

Motion planning algorithms often employ parameters to guide their exploration process. (e.g., goal biasing). Motion planners (and some of their components) use this class to declare what the parameters are, in a generic way, so that they can be set externally.

Subclassed by ompl::base::SpecificParam< T >

Public Functions

inline GenericParam(std::string name)

The constructor of a parameter takes the name of the parameter (name)

virtual ~GenericParam() = default
inline const std::string &getName() const

Get the name of the parameter.

inline void setName(const std::string &name)

Set the name of the parameter.

virtual bool setValue(const std::string &value) = 0

Set the value of the parameter. The value is taken in as a string, but converted to the type of that parameter.

virtual std::string getValue() const = 0

Retrieve the value of the parameter, as a string.

template<typename T>
inline GenericParam &operator=(const T &value)

Assignment operator by type. This is just for convenience, as it just calls setValue()

inline void setRangeSuggestion(const std::string &rangeSuggestion)

Set a suggested range.

inline const std::string &getRangeSuggestion() const

Get the suggested range of values.

Protected Attributes

std::string name_

The name of the parameter.

std::string rangeSuggestion_

Suggested range for the parameter.

This can be used to provide a hint to, e.g., a GUI. The convention used in OMPL is to denote ranges for the following types as follows:

  • bool: “0,1”

  • enum: “<enum_val0>,<enum_val1>,<enum_val2>,…”

  • int, double: either “first:last” or “first:stepsize:last”. In the first case, the stepsize is assumed to be 1. It is important to use floating point representations for double ranges (i.e., “1.” instead of “1”) to make sure the type is deduced correctly.