Skip to content

Param dump on slam node not working if stack_size_to_use is not specified #755

@MarcoMagriDev

Description

@MarcoMagriDev

Required Info:

  • Operating System:
    • Ubuntu 24.04
  • Installation type:
    • Both
  • ROS Version
    • ROS2 Jazzy
  • Version or commit hash:
    • Tag 2.8.2
  • Laser unit:
    • Simulated

Steps to reproduce issue

ros2 launch slam_toolbox online_async_launch.py slam_params_file:=./my_params.yaml 

where my_params.yaml does not contain a specific value for stack_size_to_use

ros2 param dump /slam_node

Expected behavior

The dump output should contain parameters

Actual behavior

/slam_toolbox:
  ros__parameters: {}

Additional information

After investigating, I suspect the issue is related to how parameters with unspecified values are handled. Specifically, in the code, here:

"stack_size_to_use", rclcpp::ParameterType::PARAMETER_INTEGER, descriptor);

It seems that the /slam_node/get_parameters service returns an empty list when requesting a parameter with an unspecified value.
I'm not sure if this is a ROS-level issue or specific to this package, but the issue might stem from the handling of the stack_size parameter.
The value for stack_size, defined here, will never be used unless you modify this line as follows:

this->declare_parameter(
-      "stack_size_to_use", rclcpp::ParameterType::PARAMETER_INTEGER, descriptor);
+      "stack_size_to_use", stack_size, descriptor);

This would ensure the stack_size value is used properly.


If you’d like, I can submit a pull request to fix this. Let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions