From 6977c84d23cd4fc49a53411fd24f34af74e87db3 Mon Sep 17 00:00:00 2001 From: David Bensoussan Date: Tue, 11 Aug 2026 09:47:03 +0200 Subject: [PATCH 1/2] refactor(dc_measurements,dc_core): rename custom_params to custom_keys What custom_str_params/custom_params add are custom keys in the Record JSON, not parameters of the node. Rename the node parameters (custom_str_params_list -> custom_key_str_list, custom_str_params -> custom_keys_str) and every C++ variable/member/method mirroring them (custom_params_ -> custom_keys_, setCustomParameters -> setCustomKeys, addCustomParameters -> addCustomKeys, etc.), and update demo configs, docs, and the strictdoc requirements to match. Note the breaking config rename in migration.md. Closes #186 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01DgSaCimN2ce7nborgttsPB Signed-off-by: David Bensoussan --- dc_core/include/dc_core/measurement.hpp | 4 +- dc_demos/params/elasticsearch.yaml | 4 +- dc_demos/params/qrcodes_minio_pgsql.yaml | 4 +- dc_demos/params/qrcodes_stdout.yaml | 4 +- dc_demos/params/tb3_simulation_influxdb.yaml | 4 +- .../params/tb3_simulation_pgsql_minio.yaml | 4 +- dc_demos/params/tb3_simulation_stdout.yaml | 4 +- dc_demos/params/uptime_stdout.yaml | 4 +- .../include/dc_measurements/measurement.hpp | 18 +++---- .../dc_measurements/measurement_server.hpp | 14 +++--- dc_measurements/src/measurement_server.cpp | 47 +++++++++---------- doc/src/dc/demos/qrcodes_minio_pgsql.md | 10 ++-- doc/src/dc/demos/tb3_stdout.md | 8 ++-- doc/src/dc/demos/uptime_stdout.md | 16 +++---- doc/src/dc/measurements.md | 34 +++++++------- doc/src/dc/migration.md | 33 +++++++++++++ requirements/measurement_server.sdoc | 6 +-- 17 files changed, 125 insertions(+), 93 deletions(-) diff --git a/dc_core/include/dc_core/measurement.hpp b/dc_core/include/dc_core/measurement.hpp index eadce7f07..55b41106c 100644 --- a/dc_core/include/dc_core/measurement.hpp +++ b/dc_core/include/dc_core/measurement.hpp @@ -51,7 +51,7 @@ class Measurement * from if_all/if_any/if_none, which are re-evaluated on every collection * @param run_id Unique ID of the current run * @param run_id Whether Run Id is enabled - * @param custom_params Vector of JSON with custom parameters + * @param custom_keys Vector of JSON with custom keys */ virtual void configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr& parent, const std::string& name, const std::map>& conditions, @@ -68,7 +68,7 @@ class Measurement const bool& nest, const bool& flatten, const std::string& save_local_base_path, const std::string& all_base_path, const std::string& all_base_path_expanded, const std::string& save_local_base_path_expanded, const std::string& run_id, - const bool& run_id_enabled, const std::vector& custom_params) = 0; + const bool& run_id_enabled, const std::vector& custom_keys) = 0; /** * @brief Method to cleanup resources used on shutdown. diff --git a/dc_demos/params/elasticsearch.yaml b/dc_demos/params/elasticsearch.yaml index 072828be2..86921984f 100644 --- a/dc_demos/params/elasticsearch.yaml +++ b/dc_demos/params/elasticsearch.yaml @@ -33,8 +33,8 @@ dc_bridge: measurement_server: ros__parameters: measurement_plugins: ["cpu", "memory", "os", "uptime"] - custom_str_params_list: ["robot_name"] - custom_str_params: + custom_key_str_list: ["robot_name"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" diff --git a/dc_demos/params/qrcodes_minio_pgsql.yaml b/dc_demos/params/qrcodes_minio_pgsql.yaml index f24c0f715..612321ead 100644 --- a/dc_demos/params/qrcodes_minio_pgsql.yaml +++ b/dc_demos/params/qrcodes_minio_pgsql.yaml @@ -70,8 +70,8 @@ measurement_server: robot_name: "C3PO" measurement_plugins: ["cmd_vel", "position", "speed", "map", "right_camera", "left_camera"] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" diff --git a/dc_demos/params/qrcodes_stdout.yaml b/dc_demos/params/qrcodes_stdout.yaml index 38950d8ea..5e0a72c7c 100644 --- a/dc_demos/params/qrcodes_stdout.yaml +++ b/dc_demos/params/qrcodes_stdout.yaml @@ -19,8 +19,8 @@ measurement_server: save_local_base_path: "$HOME/dc_data/" all_base_path: "=robot_name/%Y/%m/%d/%H" condition_plugins: ["moving"] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "r2d2" diff --git a/dc_demos/params/tb3_simulation_influxdb.yaml b/dc_demos/params/tb3_simulation_influxdb.yaml index bd6fd7604..520dc35d3 100644 --- a/dc_demos/params/tb3_simulation_influxdb.yaml +++ b/dc_demos/params/tb3_simulation_influxdb.yaml @@ -69,8 +69,8 @@ measurement_server: # Infrastructure "influxdb_health", ] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "Turtlebot" diff --git a/dc_demos/params/tb3_simulation_pgsql_minio.yaml b/dc_demos/params/tb3_simulation_pgsql_minio.yaml index 8ea58f882..0cd63e2b4 100644 --- a/dc_demos/params/tb3_simulation_pgsql_minio.yaml +++ b/dc_demos/params/tb3_simulation_pgsql_minio.yaml @@ -78,8 +78,8 @@ measurement_server: "rustfs_health", "pgsql_health", ] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "Turtlebot" diff --git a/dc_demos/params/tb3_simulation_stdout.yaml b/dc_demos/params/tb3_simulation_stdout.yaml index 33dc349b7..934b27f90 100644 --- a/dc_demos/params/tb3_simulation_stdout.yaml +++ b/dc_demos/params/tb3_simulation_stdout.yaml @@ -30,8 +30,8 @@ measurement_server: ros__parameters: robot_name: "C3PO" measurement_plugins: ["cmd_vel", "map", "position", "speed"] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" diff --git a/dc_demos/params/uptime_stdout.yaml b/dc_demos/params/uptime_stdout.yaml index 872f91278..558d84608 100644 --- a/dc_demos/params/uptime_stdout.yaml +++ b/dc_demos/params/uptime_stdout.yaml @@ -27,8 +27,8 @@ measurement_server: counter: true counter_path: "$HOME/run_id" uuid: false - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: force_override: false robot_name: name: robot_name diff --git a/dc_measurements/include/dc_measurements/measurement.hpp b/dc_measurements/include/dc_measurements/measurement.hpp index affaba0f8..bb16b124f 100644 --- a/dc_measurements/include/dc_measurements/measurement.hpp +++ b/dc_measurements/include/dc_measurements/measurement.hpp @@ -423,7 +423,7 @@ class Measurement : public dc_core::Measurement addTags(msg); addMeasurementName(msg); addMeasurementPluginName(msg); - addCustomParameters(msg); + addCustomKeys(msg); } if (!msg.data.empty() && msg.data != "null") { @@ -482,9 +482,9 @@ class Measurement : public dc_core::Measurement } } - void addCustomParameters(dc_interfaces::msg::StringStamped& msg) + void addCustomKeys(dc_interfaces::msg::StringStamped& msg) { - if (!custom_params_.empty() && (!msg.data.empty() && msg.data != "null")) + if (!custom_keys_.empty() && (!msg.data.empty() && msg.data != "null")) { json data; try @@ -493,9 +493,9 @@ class Measurement : public dc_core::Measurement } catch (json::parse_error& e) { - RCLCPP_ERROR_STREAM(logger_, "Error parsing JSON when adding custom parameters: " << data.dump()); + RCLCPP_ERROR_STREAM(logger_, "Error parsing JSON when adding custom keys: " << data.dump()); } - for (auto& param : custom_params_) + for (auto& param : custom_keys_) { auto key = param["key"].get(); auto value = param["value"].get(); @@ -535,7 +535,7 @@ class Measurement : public dc_core::Measurement const std::vector& remote_prefixes, const bool& nested, const bool& flatten, const std::string& save_local_base_path, const std::string& all_base_path, const std::string& all_base_path_expanded, const std::string& save_local_base_path_expanded, - const std::string& run_id, const bool& run_id_enabled, const std::vector& custom_params) override + const std::string& run_id, const bool& run_id_enabled, const std::vector& custom_keys) override { node_ = parent; auto node = node_.lock(); @@ -569,7 +569,7 @@ class Measurement : public dc_core::Measurement save_local_base_path_expanded_ = save_local_base_path_expanded; run_id_ = run_id; run_id_enabled_ = run_id_enabled; - custom_params_ = custom_params; + custom_keys_ = custom_keys; condition_max_measurements_ = condition_max_measurements; if_all_conditions_ = if_all_conditions; @@ -665,8 +665,8 @@ class Measurement : public dc_core::Measurement bool run_id_enabled_; std::string run_id_; - // Custom params - std::vector custom_params_; + // Custom keys + std::vector custom_keys_; // Parameters bool init_collect_; diff --git a/dc_measurements/include/dc_measurements/measurement_server.hpp b/dc_measurements/include/dc_measurements/measurement_server.hpp index 8a2a62f48..7b1479290 100644 --- a/dc_measurements/include/dc_measurements/measurement_server.hpp +++ b/dc_measurements/include/dc_measurements/measurement_server.hpp @@ -83,7 +83,7 @@ class MeasurementServer : public nav2_util::LifecycleNode nav2_util::CallbackReturn on_shutdown(const rclcpp_lifecycle::State& state) override; void setRunId(); - void setCustomParameters(); + void setCustomKeys(); void setBaseSavePath(); std::shared_ptr tf_; @@ -99,9 +99,9 @@ class MeasurementServer : public nav2_util::LifecycleNode bool run_id_counter_; bool run_id_uuid_; - // Custom parameters - std::vector custom_str_params_list_; - std::vector custom_params_; + // Custom keys + std::vector custom_key_str_list_; + std::vector custom_keys_; // std::vector measurement_plugins_; std::vector measurement_group_key_; @@ -129,9 +129,9 @@ class MeasurementServer : public nav2_util::LifecycleNode std::string save_local_base_path_expanded_; std::string all_base_path_; std::string all_base_path_expanded_; - std::vector measurement_custom_str_params_; - std::map custom_str_params_map_; - bool custom_str_params_force_override_; + std::vector measurement_custom_keys_str_; + std::map custom_keys_str_map_; + bool custom_keys_str_force_override_; // Conditions std::map> conditions_; diff --git a/dc_measurements/src/measurement_server.cpp b/dc_measurements/src/measurement_server.cpp index a542683fc..189707b64 100644 --- a/dc_measurements/src/measurement_server.cpp +++ b/dc_measurements/src/measurement_server.cpp @@ -24,43 +24,42 @@ void MeasurementServer::setBaseSavePath() save_local_base_path_expanded_ = dc_util::expand_values(save_local_base_path_expanded_, this); RCLCPP_INFO(get_logger(), "Base save path expanded to %s", save_local_base_path_expanded_.c_str()); all_base_path_expanded_ = dc_util::expand_env(all_base_path_); - all_base_path_expanded_ = dc_util::expand_values(all_base_path_expanded_, this, "custom_str_params.", ".value"); + all_base_path_expanded_ = dc_util::expand_values(all_base_path_expanded_, this, "custom_keys_str.", ".value"); RCLCPP_INFO(get_logger(), "All Base path expanded to %s", all_base_path_expanded_.c_str()); } -void MeasurementServer::setCustomParameters() +void MeasurementServer::setCustomKeys() { - // Declared for override parity with the per-parameter custom_str_params..force_override - // below; not consumed here (each custom param's own force_override is what's actually read). - dc_util::get_bool_type_param(this, "custom_str_params", "force_override", false); - custom_str_params_list_ = dc_util::get_str_array_param(this, "custom_str_params_list", std::vector()); + // Declared for override parity with the per-parameter custom_keys_str..force_override + // below; not consumed here (each custom key's own force_override is what's actually read). + dc_util::get_bool_type_param(this, "custom_keys_str", "force_override", false); + custom_key_str_list_ = dc_util::get_str_array_param(this, "custom_key_str_list", std::vector()); - for (auto param = std::begin(measurement_custom_str_params_); param != std::end(measurement_custom_str_params_); - ++param) + for (auto param = std::begin(measurement_custom_keys_str_); param != std::end(measurement_custom_keys_str_); ++param) { - custom_str_params_map_[*param] = dc_util::get_str_param(this, *param, ""); + custom_keys_str_map_[*param] = dc_util::get_str_param(this, *param, ""); } - custom_params_.resize(custom_str_params_list_.size()); + custom_keys_.resize(custom_key_str_list_.size()); - for (size_t i = 0; i < custom_str_params_list_.size(); i++) + for (size_t i = 0; i < custom_key_str_list_.size(); i++) { - auto custom_param = custom_str_params_list_[i]; - std::string custom_param_ns = "custom_str_params." + custom_param; - std::string key = dc_util::get_str_type_param(this, custom_param_ns, "name", ""); - std::string value = dc_util::get_str_type_param(this, custom_param_ns, "value", ""); - std::string value_from_file = dc_util::get_str_type_param(this, custom_param_ns, "value_from_file", ""); - bool force_override = dc_util::get_bool_type_param(this, custom_param_ns, "force_override", false); - - custom_params_[i]["key"] = key; - custom_params_[i]["override"] = force_override; + auto custom_key = custom_key_str_list_[i]; + std::string custom_key_ns = "custom_keys_str." + custom_key; + std::string key = dc_util::get_str_type_param(this, custom_key_ns, "name", ""); + std::string value = dc_util::get_str_type_param(this, custom_key_ns, "value", ""); + std::string value_from_file = dc_util::get_str_type_param(this, custom_key_ns, "value_from_file", ""); + bool force_override = dc_util::get_bool_type_param(this, custom_key_ns, "force_override", false); + + custom_keys_[i]["key"] = key; + custom_keys_[i]["override"] = force_override; if (!value.empty()) { - custom_params_[i]["value"] = value; + custom_keys_[i]["value"] = value; } else if (!value_from_file.empty()) { - custom_params_[i]["value"] = dc_util::get_file_content(value_from_file); + custom_keys_[i]["value"] = dc_util::get_file_content(value_from_file); } } } @@ -129,7 +128,7 @@ nav2_util::CallbackReturn MeasurementServer::on_configure(const rclcpp_lifecycle RCLCPP_INFO(get_logger(), "Configuring"); auto node = shared_from_this(); setRunId(); - setCustomParameters(); + setCustomKeys(); setBaseSavePath(); tf_ = std::make_shared(get_clock()); @@ -281,7 +280,7 @@ bool MeasurementServer::loadMeasurementPlugins() measurement_if_all_conditions_[i], measurement_if_any_conditions_[i], measurement_if_none_conditions_[i], measurement_gate_condition_[i], measurement_remote_keys_[i], measurement_remote_prefixes_[i], measurement_nested_[i], measurement_flatten_[i], save_local_base_path_, all_base_path_, - all_base_path_expanded_, save_local_base_path_expanded_, run_id_, run_id_enabled_, custom_params_); + all_base_path_expanded_, save_local_base_path_expanded_, run_id_, run_id_enabled_, custom_keys_); } catch (const pluginlib::PluginlibException& ex) { diff --git a/doc/src/dc/demos/qrcodes_minio_pgsql.md b/doc/src/dc/demos/qrcodes_minio_pgsql.md index 818663178..5793c8dd6 100644 --- a/doc/src/dc/demos/qrcodes_minio_pgsql.md +++ b/doc/src/dc/demos/qrcodes_minio_pgsql.md @@ -136,11 +136,11 @@ group_server: measurement_server: ros__parameters: - custom_str_params: ["robot_name"] + custom_keys_str: ["robot_name"] robot_name: "C3PO" measurement_plugins: ["cmd_vel", "position", "speed"] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" @@ -289,8 +289,8 @@ measurement_server: ... measurement_plugins: ["cmd_vel", "position", "speed", "map", "right_camera", "left_camera"] condition_plugins: ["moving", "inspected_exists"] - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" diff --git a/doc/src/dc/demos/tb3_stdout.md b/doc/src/dc/demos/tb3_stdout.md index f75f29cc9..bcbdb1450 100644 --- a/doc/src/dc/demos/tb3_stdout.md +++ b/doc/src/dc/demos/tb3_stdout.md @@ -135,7 +135,7 @@ This record contains the map data from the measurement. ```yaml measurement_server: ros__parameters: - custom_str_params: ["robot_name"] + custom_keys_str: ["robot_name"] robot_name: "C3PO" measurement_plugins: ["cmd_vel", "map", "position", "speed"] run_id: @@ -178,7 +178,7 @@ measurement_server: **save_local_base_path (Optional)**: Used as a common base for all saved files from measurement plugins. *all_base_path* is concatenated to it afterwards for defining the path where files are saved. -**all_base_path (Optional)**: Used as a common base for some measurements to save files. Is concatenated to *save_local_base_path*. Note the =robot_name, which is later replaced by C3PO (the variable defined in custom_str_params) +**all_base_path (Optional)**: Used as a common base for some measurements to save files. Is concatenated to *save_local_base_path*. Note the =robot_name, which is later replaced by C3PO (the variable defined in custom_keys_str) **map.remote_keys**: creates a dictionary inside **remote_paths** which is named by the strings in this field — each name must match a `receives: files` Destination in the `dc_bridge` block below, so the Bridge's Uploader knows where to send the file. @@ -225,8 +225,8 @@ dc_bridge: measurement_server: ros__parameters: - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: "C3PO" diff --git a/doc/src/dc/demos/uptime_stdout.md b/doc/src/dc/demos/uptime_stdout.md index c6c538cbf..ea7351be4 100644 --- a/doc/src/dc/demos/uptime_stdout.md +++ b/doc/src/dc/demos/uptime_stdout.md @@ -33,8 +33,8 @@ measurement_server: enable_validator: true debug: true init_collect: true - custom_str_params_list: ["robot_name", "id"] - custom_str_params: + custom_key_str_list: ["robot_name", "id"] + custom_keys_str: robot_name: name: robot_name value: C3PO @@ -74,17 +74,17 @@ This will collect the uptime every 5 seconds (including when the node starts), w Here, we want to append some content in every record: the robot name and its ID. While the robot name comes from a fixed variable in the parameter file, the id comes from the machine-id file. -**custom_str_params_list (Optional)**: Look for those keys in this configuration to add them as keys and values in each record. +**custom_key_str_list (Optional)**: Look for those keys in this configuration to add them as keys and values in each record. -**custom_str_params.robot_name (Optional)**: This parameter is loaded since it is mentioned in custom_str_params_list +**custom_keys_str.robot_name (Optional)**: This parameter is loaded since it is mentioned in custom_key_str_list -**custom_str_params.robot_name.name (Optional)**: Key in the dictionary to add +**custom_keys_str.robot_name.name (Optional)**: Key in the dictionary to add -**custom_str_params.robot_name.value (Optional)**: Value associated to the key in the dictionary to add +**custom_keys_str.robot_name.value (Optional)**: Value associated to the key in the dictionary to add -**custom_str_params.id.name (Optional)**: Key in the dictionary to add +**custom_keys_str.id.name (Optional)**: Key in the dictionary to add -**custom_str_params.id.value_from_file (Optional)**: Value associated to the key in the dictionary to add taken from the content of a file +**custom_keys_str.id.value_from_file (Optional)**: Value associated to the key in the dictionary to add taken from the content of a file ```admonish info diff --git a/doc/src/dc/measurements.md b/doc/src/dc/measurements.md index dbfa5a970..fa664c44d 100644 --- a/doc/src/dc/measurements.md +++ b/doc/src/dc/measurements.md @@ -34,23 +34,23 @@ the Record as a `tags` field, but it has no routing effect — remove it. See th [migration guide](./migration.md#tags-what-changed). ``` -| Parameter name | Description | Type(s) | Default | -| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------------------------- | -| measurement_plugins | Name of the measurement plugins to load | list\[str\] | N/A (mandatory) | -| condition_plugins | Name of the condition plugins to load | list\[str\] | N/A (mandatory) | -| save_local_base_path | Path where files will be saved locally (e.g camera images). Expands $X to environment variables and =Y to custom string parameters | str | "$HOME/ros2/data/%Y/%M/%D/%H" | -| all_base_path | Path where files will be saved at their destination (S3, RustFS...). Expands $X to environment variables and =Y to custom string parameters | str | "" | -| custom_str_params_list | Custom strings to use in other parameters. They are also appended in the json sent to the destination | list\[str\] | N/A | -| custom_str_params.force_override | Override values if the keys are already present in the measurement. Applies to all and can be overridden by `custom_str_params..force_override` | bool | false | -| | -| custom_str_params..name | Key to add in the serialized data | str | N/A (optional) | -| custom_str_params..value | Value to set for the key as a fixed string | str | N/A (optional) | -| custom_str_params..value_from_file | Path to a file containing the value to set | str | N/A (optional) | -| custom_str_params..force_override | Override value if the key is already present in the measurement | bool | false | -| run_id.enabled | Identify which run the robot is. A new one is generated at every start of the node. Uses either a counter or UUID | str | true | -| run_id.counter | Enable counter for the run_id | str | true | -| run_id.counter_path | Path to store the last run. It is expanded with environment variables id | str | "$HOME/run_id" | -| run_id.uuid | Generate a new run ID by using a random UUID | str | false | +| Parameter name | Description | Type(s) | Default | +| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------------------------- | +| measurement_plugins | Name of the measurement plugins to load | list\[str\] | N/A (mandatory) | +| condition_plugins | Name of the condition plugins to load | list\[str\] | N/A (mandatory) | +| save_local_base_path | Path where files will be saved locally (e.g camera images). Expands $X to environment variables and =Y to custom string parameters | str | "$HOME/ros2/data/%Y/%M/%D/%H" | +| all_base_path | Path where files will be saved at their destination (S3, RustFS...). Expands $X to environment variables and =Y to custom string parameters | str | "" | +| custom_key_str_list | Custom strings to use in other parameters. They are also appended in the json sent to the destination | list\[str\] | N/A | +| custom_keys_str.force_override | Override values if the keys are already present in the measurement. Applies to all and can be overridden by `custom_keys_str..force_override` | bool | false | +| | | | | +| custom_keys_str..name | Key to add in the serialized data | str | N/A (optional) | +| custom_keys_str..value | Value to set for the key as a fixed string | str | N/A (optional) | +| custom_keys_str..value_from_file | Path to a file containing the value to set | str | N/A (optional) | +| custom_keys_str..force_override | Override value if the key is already present in the measurement | bool | false | +| run_id.enabled | Identify which run the robot is. A new one is generated at every start of the node. Uses either a counter or UUID | str | true | +| run_id.counter | Enable counter for the run_id | str | true | +| run_id.counter_path | Path to store the last run. It is expanded with environment variables id | str | "$HOME/run_id" | +| run_id.uuid | Generate a new run ID by using a random UUID | str | false | ## Plugin parameters diff --git a/doc/src/dc/migration.md b/doc/src/dc/migration.md index 64012aef1..50fbfab22 100644 --- a/doc/src/dc/migration.md +++ b/doc/src/dc/migration.md @@ -617,6 +617,38 @@ Set `time_format: "double"` explicitly to keep the old fractional-seconds column remains supported, and remains lossy: a float64 has ~15-16 significant digits and current epoch seconds already spend 10 of them. `iso8601` is the other lossless option. +## `custom_str_params*` renamed to `custom_keys_str*` + +`measurement_server`'s custom-key parameters were named `custom_str_params_list` / +`custom_str_params.*`, even though what they add are custom **keys** in the Record JSON, +not parameters of the node. Rename them: + +| DC 1.x / earlier `jazzy` | DC 2.0 | +| --------------------------------- | ----------------------------- | +| `custom_str_params_list` | `custom_key_str_list` | +| `custom_str_params.` | `custom_keys_str.` | +| `custom_str_params.force_override`| `custom_keys_str.force_override` | + +```yaml +# Before +measurement_server: + ros__parameters: + custom_str_params_list: ["robot_name"] + custom_str_params: + robot_name: + name: robot_name + value: "C3PO" + +# After +measurement_server: + ros__parameters: + custom_key_str_list: ["robot_name"] + custom_keys_str: + robot_name: + name: robot_name + value: "C3PO" +``` + ## Migration checklist - [ ] `destination_server:` renamed to `dc_bridge:`, `destination_plugins:` to `destinations:` @@ -629,4 +661,5 @@ epoch seconds already spend 10 of them. `iso8601` is the other lossless option. - [ ] `files.metadata_destination` names a `receives: records` Destination - [ ] Un-blessed destinations are expressed as `custom_config_files` snippets consuming `dc.` routes - [ ] Destination tables exist in PostgreSQL, and object-storage buckets are created +- [ ] `custom_str_params_list:` / `custom_str_params:` under `measurement_server` are renamed to `custom_key_str_list:` / `custom_keys_str:` - [ ] Secrets moved out of the params file into `$VAR` environment references diff --git a/requirements/measurement_server.sdoc b/requirements/measurement_server.sdoc index 7244b94ef..750d5ea48 100644 --- a/requirements/measurement_server.sdoc +++ b/requirements/measurement_server.sdoc @@ -122,17 +122,17 @@ TITLE: Custom variables [REQUIREMENT] UID: MS-VAR-001 TITLE: Can load custom variables -STATEMENT: The custom_str_params parameter should allow the user to specify custom variables. Each variable should have a name subparameter and either a value or value_fromfile subparameter. If a required subparameter is missing or the file specified in value\_from\_file does not exist, the node should stop processing. +STATEMENT: The custom_keys_str parameter should allow the user to specify custom variables. Each variable should have a name subparameter and either a value or value_fromfile subparameter. If a required subparameter is missing or the file specified in value\_from\_file does not exist, the node should stop processing. [REQUIREMENT] UID: MS-VAR-002 TITLE: Can load custom variables from a file -STATEMENT: The custom_str_params parameter should allow the user to specify custom variables that are loaded from a file. If the file specified in value\_from\_file does not exist, the node should stop processing. +STATEMENT: The custom_keys_str parameter should allow the user to specify custom variables that are loaded from a file. If the file specified in value\_from\_file does not exist, the node should stop processing. [REQUIREMENT] UID: MS-VAR-03 TITLE: Can load custom variables from a fixed string -STATEMENT: The custom_str_params parameter should allow the user to specify custom variables that are loaded from a fixed string. If the value subparameter is empty, the node should stop processing. +STATEMENT: The custom_keys_str parameter should allow the user to specify custom variables that are loaded from a fixed string. If the value subparameter is empty, the node should stop processing. [/SECTION] From bb2d673e46aad9294e9abf62ca5938bb1fe831e3 Mon Sep 17 00:00:00 2001 From: David Bensoussan Date: Tue, 11 Aug 2026 09:48:01 +0200 Subject: [PATCH 2/2] docs(progress): log the #186 custom_params to custom_keys rename Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01DgSaCimN2ce7nborgttsPB Signed-off-by: David Bensoussan --- progress.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/progress.txt b/progress.txt index 1b0021a73..5abe9d54e 100644 --- a/progress.txt +++ b/progress.txt @@ -3329,3 +3329,61 @@ roughly 90 plugin-parameter call sites. dedicated unit test target (its helpers are exercised indirectly through every dc_measurements plugin test instead — no new gap introduced by this change, but a direct `dc_util` test target would be worth its own issue). + +### #186 - Rename custom_params to custom_keys + +What `custom_str_params`/`custom_params` add to a Record is custom **keys** in the +serialized JSON, not parameters of the `measurement_server` node — the old naming was +misleading. Renamed everywhere it appeared in the jazzy-line DC 2.0 port (the issue +confirmed the old naming was carried over unchanged from humble): + +- **Node parameters** (breaking config change): `custom_str_params_list` -> + `custom_key_str_list`, `custom_str_params` -> `custom_keys_str` (and its + `..name`/`.value`/`.value_from_file`/`.force_override` sub-keys, plus the + top-level `custom_str_params.force_override` parity declaration). +- **C++** (`dc_core/include/dc_core/measurement.hpp`, + `dc_measurements/include/dc_measurements/measurement.hpp`, + `dc_measurements/include/dc_measurements/measurement_server.hpp`, + `dc_measurements/src/measurement_server.cpp`): every `custom_params*`/ + `custom_str_params*` variable, member, and local (`custom_params_` -> + `custom_keys_`, `custom_str_params_list_` -> `custom_key_str_list_`, + `custom_str_params_map_` -> `custom_keys_str_map_`, + `custom_str_params_force_override_` -> `custom_keys_str_force_override_`, + `measurement_custom_str_params_` -> `measurement_custom_keys_str_`, loop locals + `custom_param`/`custom_param_ns` -> `custom_key`/`custom_key_ns`), and the two methods + named after the old concept (`setCustomParameters` -> `setCustomKeys`, + `addCustomParameters` -> `addCustomKeys`), including their doc comments and log + messages. +- **Demo configs**: `custom_str_params_list:`/`custom_str_params:` renamed to + `custom_key_str_list:`/`custom_keys_str:` in all 7 `dc_demos/params/*.yaml` files that + set them. +- **Docs**: `doc/src/dc/measurements.md`'s parameter table (realigned column widths + after the rename changed cell lengths), `doc/src/dc/demos/{tb3_stdout,uptime_stdout, + qrcodes_minio_pgsql}.md`. `doc/src/dc/demos/qrcodes_minio_pgsql.md`'s unrelated + "start … with custom parameters" prose (about Turtlebot launch args, not this + parameter) was deliberately left alone. +- **Requirements**: `requirements/measurement_server.sdoc`'s three `MS-VAR-*` + STATEMENTs updated to reference `custom_keys_str`; `custom variables` (the concept + name) left as-is since that wording was never about "parameters" in the first place. +- **`doc/src/dc/migration.md`**: added a `custom_str_params*` -> `custom_keys_str*` + section (before/after config snippet + rename table) and a migration-checklist entry, + since this is a breaking change for anyone upgrading from an earlier `jazzy` checkout. +- **Verified**: repo-wide case-insensitive grep for `custom_param` returns zero hits + outside the gitignored `doc/book/` build output. `pre-commit run --all-files`: the + hooks that touch this diff's files (`check-xml`, `pyupgrade`, `pycln`'s no-op here, + `clang-format` — reflowed one `for` line in `measurement_server.cpp` now that the + identifier is shorter, applied) ran clean; the failures in the same run + (`build-doc`/podman "boot ID differs from cached boot ID" after a host reboot, + `poetry-requirements`/no `poetry` module, `flake8` findings in + `dc_bringup/launch/dc_bringup.launch.py`, `dc_demos/dc_demos/streamlit_dashboard/`, + `tools/e2e/scripts/`) are pre-existing local-environment/lint issues in files this + change never touches, matching the pattern already logged for `poetry-requirements` in + earlier entries above. +- **Not verified**: the generated `doc/src/dc/requirements/html/` and `doc/book/` + artifacts (both gitignored, not part of this diff) — `strictdoc` isn't installed + locally and the `build-doc` pre-commit hook's Podman image build hit the stale + boot-ID cache error above; clearing `/run/user/1000/containers` to unblock it needs a + root/host-level action outside this diff's scope, so left for whoever next runs the + full docs pipeline (or CI, which builds a fresh runner each time and won't hit this). + The `.sdoc` edit itself is a pure text substitution inside existing `STATEMENT` + fields, not a structural change, so the regeneration risk is low.