Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

inconsistent declare/undeclare parameter behaviour

Abierto
#2,736 4 comentarios 0 reacciones 1 asignado Ver en GitHub

@fujitatomoya ya está trabajando en esto.

Desde el 20/2/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

current behaviour

A ROS node can:

  1. explicitly declare a parameter via declare_parameter and explicitly undeclare it viaundeclare_parameter
  2. implicitly declare a parameter by setting the option allow_undeclared_parameters(true) and then just setting the parameter via set_parameter and implicitly undeclare a dynamic parameter by changing its type to PARAMETER_NOT_SET

It is also possible to mix these modes and implicitly undeclare an explicitly declared parameter by not allowing undeclared parameters, using dynamic parameter types and then setting its type to PARAMETER_NOT_SET. In such a situation, it will not be possible to "reactivate" the parameter again, without the node explicitly declaring the parameter again.

This mix of explicit creating and implicit deletion of parameters is inconsistent.

expected behaviour

If an explicitly declared dynamic parameters type is changed to PARAMETER_NOT_SET, it should result into the same behaviour as declaring the parameter with PARAMETER_NOT_SET in the first place. That means, after changing the type to PARAMETER_NOT_SET, has_parameter must return true and ros2 param get should return Parameter not set. and ros2 param dump should show the value as null.
Additionally, it would be useful if this would still work with static types, such that a parameter has a static type and its value is either be set or unset (null), comparable to a NULL pointer in C.

The current implicitly undeclare behaviour should only apply when allow_undeclared_parameters is true and parameters are declared implicitly via set_parameter.

Lenguaje dominante
C++
Estrellas
805
Forks
564
Merge medio
1 d 22 h
PR fusionados (30 d)
21

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ros2/rclcpp

Todos los issues de ros2/rclcpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.