Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Inconsistent usage of non-numeric validator arguments

Aperta
#287 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
cpp, python, yaml
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Python
Stelle
385
Fork
81
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PickNikRobotics/generate_parameter_library

Tutte le issue di PickNikRobotics/generate_parameter_library

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.