-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugs in load_parameter_file
#960
Comments
@huweiATgithub can you provide the complete procedure (command line steps) that explain the problem here? |
|
ros2/ros2cli#960 Signed-off-by: Tomoya Fujita <[email protected]>
using fujitatomoya/ros2_test_prover@1fcc859 and the following procedure that you provided above, it does not generate the exception. ### start the node with string parameter
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run prover_rclpy ros2cli_960
[INFO] [1736797972.379024312] [minimal_param_node]: Got my_parameter:
[INFO] [1736798063.849885193] [minimal_param_node]: Got my_parameter:
### set the string parameter with ros2 param load
root@tomoyafujita:~/ros2_ws/colcon_ws# cat param_string_empty.yaml
/**:
ros__parameters:
my_parameter: ''
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param load minimal_param_node param_string_empty.yaml
Set parameter my_parameter successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /minimal_param_node my_parameter
String value is:
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param describe /minimal_param_node my_parameter
Parameter name: my_parameter
Type: string
Constraints:
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param load minimal_param_node param_string_empty.yaml
Set parameter my_parameter successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /minimal_param_node my_parameter
String value is:
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param describe /minimal_param_node my_parameter
Parameter name: my_parameter
Type: string
Constraints: i would like to ask you again, could you please provide the Short, Self Contained, Correct (Compilable), Example? |
ros2/ros2cli#960 Signed-off-by: Tomoya Fujita <[email protected]>
Bug report
Required Info:
ros2cli/ros2param/ros2param/api/__init__.py
Lines 59 to 65 in 28d73d2
Steps to reproduce issue
The current implementation has an extra
yaml.safe_load
for parameter value which has been loaded once already.This will result in wrong results, e.g.,
is once being loaded to
{"key": ""}
. Another load for the empty string""
will convert it intoNone
.Implementation considerations
Consider removing the extra yaml load.
The text was updated successfully, but these errors were encountered: