From 38eb393fc7a23237bb0ae8489845cc22e351a7a8 Mon Sep 17 00:00:00 2001 From: Eric Omielan <112828024+eomielan@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:39:40 -0800 Subject: [PATCH] Add configuration for data collection node (#222) * Add configuration for data collection node * Change default filename * Add boat simulator output directory to .gitignore * Update config README & remove comments from yaml file --------- Co-authored-by: Devon Friend --- .gitignore | 3 +++ src/global_launch/config/README.md | 39 +++++++++++++++++++++++++++ src/global_launch/config/globals.yaml | 8 ++++++ 3 files changed, 50 insertions(+) diff --git a/.gitignore b/.gitignore index bc17d4713..3db9751ff 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ __pycache__/ # exported plantuml diagrams /diagrams/out/ + +# data collection node output +/boat_simulator_output/ diff --git a/src/global_launch/config/README.md b/src/global_launch/config/README.md index 78d272505..b2daac721 100644 --- a/src/global_launch/config/README.md +++ b/src/global_launch/config/README.md @@ -239,3 +239,42 @@ specified within an array: one for the `x` component, and one for the `y` compon - _Description_: How often the sail action server requests a wingsail actuation. - _Datatype_: `double` - _Range_: `(0.0, MAX_DOUBLE)` + +### `data_collection_node` + +**`file_name`** + +- _Description_: The name of the file in which the data is saved, excluding the file extension. +- _Datatype_: `string` +- _Acceptable Values_: Any valid file name. + +**`qos_depth`** + +- _Description_: The maximum number of subscription messages to queue for further processing. +- _Datatype_: `int` +- _Range_: `[1, MAX_INT)` + +**`topics`** + +- _Description_: Specifies the topics to subscribe to. It should adhere to the format `['topic_name_1', 'topic_type_1', ...]`. +- _Datatype_: `string` array with an even length +- _Acceptable Values_: Each pair within the array must consist of a valid topic name as the first string and the +corresponding correct type as the second string. + +**`bag`** + +- _Description_: Determines whether to save recorded data as a ROS bag. +- _Datatype_: `boolean` +- _Acceptable Values_: `true`, `false` + +**`json`** + +- _Description_: Determines whether to save recorded data as a JSON file. +- _Datatype_: `boolean` +- _Acceptable Values_: `true`, `false` + +**`write_period_sec`** + +- _Description_: The interval (in seconds) for writing queued data to the JSON file. +- _Datatype_: `double` +- _Range_: `(0.0, MAX_DOUBLE)` diff --git a/src/global_launch/config/globals.yaml b/src/global_launch/config/globals.yaml index 91d3c056e..b385741dd 100644 --- a/src/global_launch/config/globals.yaml +++ b/src/global_launch/config/globals.yaml @@ -54,3 +54,11 @@ physics_engine_node: corr_xy: 0. constant_params: value: [1.0, 0.0] +data_collection_node: + ros__parameters: + file_name: 'ros_data_collection' + qos_depth: 10 + topics: ['/mock_gps', 'GPS', '/mock_wind_sensors', 'WindSensors'] + bag: false + json: true + write_period_sec: 0.5