-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature request
Feature description
If we try to pass an integer value to a double parameter from the command line or from a parameters YAML file we get a rclcpp::ParameterTypeException. For example, passing a parameter from the command line:
ros2 run foo_package foo_node --ros-args -p foo_arg:=1
results in the following error:
terminate called after throwing an instance of 'rclcpp::ParameterTypeException'
what(): expected [double] got [integer]
and we can fix it by explicitly making our value a floating point number:
ros2 run foo_package foo_node --ros-args -p foo_arg:=1.0
But, it seems reasonable to me that if a user forgets to explicitly provide a floating point value that we should implicitly cast an integer to a float (as is done in many programming languages).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request