Class ConfigurationManager

Class Documentation

class ConfigurationManager

Manager for ROS2 node parameters Provides CRUD operations on node parameters via native rclcpp APIs Also caches initial parameter values as “defaults” for reset operations

Public Functions

explicit ConfigurationManager(rclcpp::Node *node)
~ConfigurationManager()
void shutdown()

Clean up shared param node and cached clients before ROS 2 context shutdown. Must be called before rclcpp::shutdown() to prevent use-after-free. Idempotent - safe to call multiple times.

ParameterResult list_parameters(const std::string &node_name)

List all parameters for a node

Parameters:

node_name – Fully qualified node name (e.g., “/powertrain/engine/engine_temp_sensor”)

Returns:

ParameterResult with array of {name, value, type} objects

ParameterResult get_parameter(const std::string &node_name, const std::string &param_name)

Get a specific parameter value

Parameters:
  • node_name – Fully qualified node name

  • param_name – Parameter name

Returns:

ParameterResult with {name, value, type, description, read_only}

ParameterResult set_parameter(const std::string &node_name, const std::string &param_name, const json &value)

Set a parameter value

Parameters:
  • node_name – Fully qualified node name

  • param_name – Parameter name

  • value – New value (JSON type will be converted to appropriate ROS2 type)

Returns:

ParameterResult with {name, value, type}

ParameterResult reset_parameter(const std::string &node_name, const std::string &param_name)

Reset a specific parameter to its default (initial) value

Parameters:
  • node_name – Fully qualified node name

  • param_name – Parameter name

Returns:

ParameterResult with reset parameter info

ParameterResult reset_all_parameters(const std::string &node_name)

Reset all parameters of a node to their default (initial) values

Parameters:

node_name – Fully qualified node name

Returns:

ParameterResult with count of reset parameters