Skip to content

gt<> validator sets incorrect from_value in parameter descriptor #256

Open
@ottojo

Description

@ottojo

The ranges in the parameter descriptor are exclusive (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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions