The ranges in the parameter descriptor are inclusive (https://github.com/ros2/rcl_interfaces/blob/rolling/rcl_interfaces/msg/FloatingPointRange.msg#L3), but currently the gt<> validator sets the lower limit to the specified value (instead of the next larger value):
|
descriptor.floating_point_range.at({{loop.index0}}).from_value = {{validation.arguments[0]}}; |
This results in inconsistent behavior between parameter descriptor and parameter validation:
jonas@ade $ ros2 param describe /example_node background.gt_zero_float
Parameter name: background.gt_zero_float
Type: double
Description: Parameter with default value 1.0 and gt<>: 0.0 validation
Constraints:
Min value: 0.0
Max value: 1.7976931348623157e+308
jonas@ade $ ros2 param set /example_node background.gt_zero_float 0.0
Setting parameter failed: Parameter 'background.gt_zero_float' with the value '0' must be greater than '0'
The ranges in the parameter descriptor are inclusive (https://github.com/ros2/rcl_interfaces/blob/rolling/rcl_interfaces/msg/FloatingPointRange.msg#L3), but currently the
gt<>validator sets the lower limit to the specified value (instead of the next larger value):generate_parameter_library/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_parameter
Line 17 in 13a1043
This results in inconsistent behavior between parameter descriptor and parameter validation: