Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

Add return value to void node_handle.param #753

@NikolasE

Description

@NikolasE

There is no way to see if the default value for a loaded parameter was used or if it was read from the parameter server. The function currently does not return anything so it would be simple to improve it like this:

  template<typename T>
  **bool** param(const std::string& param_name, T& param_val, const T& default_val) const
  {
    if (hasParam(param_name))
    {
      if (getParam(param_name, param_val))
      {
        return **true**;
      }
    }
    param_val = default_val;
    return **false**;
}

What do you think? Current code would just ignore the return value so that it should not create a problem for anyone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions