Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Inconsistent usage of non-numeric validator arguments

Open
#287 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp, python, yaml
Domain
tooling

Research direction

The bug is in the Python code that generates C++ validation code. Start by finding where bounds validator arguments are emitted—likely in a code generation module or template. Compare with the descriptor initialization code that correctly leaves arguments unquoted. Remove the quoting for non-numeric arguments in the validation path. Run the existing tests to ensure the generated code compiles and behaves correctly.

Written by the indexing model from the issue text.

Description

I would like to refer to variables that I already have in code (in an underlying driver library) to define bounds of a parameter.

I.e., doing something like this

gain:
    type: double
    default_value: 0.0
    read_only: false
    description: "The amplifier gain in dB"
    validation:
      bounds<>: [device_params::Gain::min, device_params::Gain::max]

In the generated header file, it does work how I want it at the declaration of the parameter: it puts the unquoted arguments there, resulting in properly working code:

descriptor.read_only = false;
descriptor.floating_point_range.resize(1);
descriptor.floating_point_range.at(0).from_value = device_params::Gain::min;
descriptor.floating_point_range.at(0).to_value = device_params::Gain::max;

However, at the validation part of the generated code, it quotes the arguments, leading to compile errors:

param = parameters_interface_->get_parameter(prefix_ + "gain");
RCLCPP_DEBUG_STREAM(logger_, param.get_name() << ": " << param.get_type_name() << " = " << param.value_to_string());
if(auto validation_result = bounds<double>(param, "device_params::Gain::min", "device_params::Gain::max"); validation_result) {
    throw rclcpp::exceptions::InvalidParameterValueException(fmt::format("Invalid value set during initialization for parameter 'gain': {}", validation_result.error()));
}

Could it be an easy fix if it's just the quoting?

Dominant language
Python
Stars
385
Forks
81
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PickNikRobotics/generate_parameter_library

All issues in PickNikRobotics/generate_parameter_library

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.