From 9481df95428d6cb78b038b98275152eaf4747a43 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Wed, 31 Jan 2024 17:19:01 +0900 Subject: [PATCH 1/4] Extract all params in map_projection_loader to map_projection_loader.param.yaml Added launch argument map_projection_loader_param_path to map.launch.xml Signed-off-by: TaikiYamada4 --- launch/tier4_map_launch/launch/map.launch.xml | 2 ++ map/map_projection_loader/CMakeLists.txt | 1 + .../config/map_projection_loader.param.yaml | 4 ++++ .../launch/map_projection_loader.launch.xml | 5 +++-- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 map/map_projection_loader/config/map_projection_loader.param.yaml diff --git a/launch/tier4_map_launch/launch/map.launch.xml b/launch/tier4_map_launch/launch/map.launch.xml index 56ad5b01c5024..8efc1a7b985aa 100644 --- a/launch/tier4_map_launch/launch/map.launch.xml +++ b/launch/tier4_map_launch/launch/map.launch.xml @@ -8,6 +8,7 @@ + @@ -59,6 +60,7 @@ + diff --git a/map/map_projection_loader/CMakeLists.txt b/map/map_projection_loader/CMakeLists.txt index 700d468ed4431..f6102a1efa795 100644 --- a/map/map_projection_loader/CMakeLists.txt +++ b/map/map_projection_loader/CMakeLists.txt @@ -59,4 +59,5 @@ endif() ament_auto_package(INSTALL_TO_SHARE launch + config ) diff --git a/map/map_projection_loader/config/map_projection_loader.param.yaml b/map/map_projection_loader/config/map_projection_loader.param.yaml new file mode 100644 index 0000000000000..74519cbdcfc31 --- /dev/null +++ b/map/map_projection_loader/config/map_projection_loader.param.yaml @@ -0,0 +1,4 @@ +/**: + ros__parameters: + map_projector_info_path: $(var map_projector_info_path) + lanelet2_map_path: $(var lanelet2_map_path) \ No newline at end of file diff --git a/map/map_projection_loader/launch/map_projection_loader.launch.xml b/map/map_projection_loader/launch/map_projection_loader.launch.xml index fc625e3162911..a6570b69d3498 100644 --- a/map/map_projection_loader/launch/map_projection_loader.launch.xml +++ b/map/map_projection_loader/launch/map_projection_loader.launch.xml @@ -1,9 +1,10 @@ + + - - + From 3d754f2bdad1efd43c89566ec6836b3a7aed9c0e Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Wed, 31 Jan 2024 18:02:44 +0900 Subject: [PATCH 2/4] Added map_projection_loader.schema.json. Modified README.md of map_projection_loader to read the schema.json file to construct the table of parameters Signed-off-by: TaikiYamada4 --- map/map_projection_loader/README.md | 9 ++-- .../schema/map_projection_loader.schema.json | 42 +++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 map/map_projection_loader/schema/map_projection_loader.schema.json diff --git a/map/map_projection_loader/README.md b/map/map_projection_loader/README.md index 1887a1cd8934f..4118a494f83c8 100644 --- a/map/map_projection_loader/README.md +++ b/map/map_projection_loader/README.md @@ -82,11 +82,10 @@ map_origin: ## Published Topics -- ~/map_projector_info (tier4_map_msgs/MapProjectorInfo) : Topic for defining map projector information +- `~/map_projector_info` (tier4_map_msgs/MapProjectorInfo) : This topic shows the definition of map projector information ## Parameters -| Name | Type | Description | -| :---------------------- | :---------- | :------------------------------------------------------------------------------- | -| map_projector_info_path | std::string | A path to map_projector_info.yaml (used by default) | -| lanelet2_map_path | std::string | A path to lanelet2 map (used only when `map_projector_info_path` does not exist) | +Note that these paramters are assumed to be passed from launch arguments, and it is not recommended to directly write them in `map_projection_loader.param.yaml`. + +{{ json_to_markdown("map/map_projection_loader/schema/map_projection_loader.schema.json") }} diff --git a/map/map_projection_loader/schema/map_projection_loader.schema.json b/map/map_projection_loader/schema/map_projection_loader.schema.json new file mode 100644 index 0000000000000..2ada465f9de16 --- /dev/null +++ b/map/map_projection_loader/schema/map_projection_loader.schema.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for map_projection_loader", + "type": "object", + "definitions": { + "map_projection_loader": { + "type": "object", + "properties": { + "map_projector_info_path": { + "type": "string", + "description": "The path where map_projector_info.yaml is located", + "default": "$(var map_projector_info_path)" + }, + "lanelet2_map_path": { + "type": "string", + "description": "The path where the lanelet2 map file (.osm) is located", + "default": "$(var lanelet2_map_path)" + } + }, + "required": [ + "map_projector_info_path", + "lanelet2_map_path" + ], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/map_projection_loader" + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false + } + \ No newline at end of file From 8ade5df7f922bf80d38eb27a1b180945b157afbb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:37:14 +0000 Subject: [PATCH 3/4] style(pre-commit): autofix --- .../config/map_projection_loader.param.yaml | 2 +- .../schema/map_projection_loader.schema.json | 76 +++++++++---------- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/map/map_projection_loader/config/map_projection_loader.param.yaml b/map/map_projection_loader/config/map_projection_loader.param.yaml index 74519cbdcfc31..6ec300309a308 100644 --- a/map/map_projection_loader/config/map_projection_loader.param.yaml +++ b/map/map_projection_loader/config/map_projection_loader.param.yaml @@ -1,4 +1,4 @@ /**: ros__parameters: map_projector_info_path: $(var map_projector_info_path) - lanelet2_map_path: $(var lanelet2_map_path) \ No newline at end of file + lanelet2_map_path: $(var lanelet2_map_path) diff --git a/map/map_projection_loader/schema/map_projection_loader.schema.json b/map/map_projection_loader/schema/map_projection_loader.schema.json index 2ada465f9de16..bb7fe5d2910ad 100644 --- a/map/map_projection_loader/schema/map_projection_loader.schema.json +++ b/map/map_projection_loader/schema/map_projection_loader.schema.json @@ -1,42 +1,38 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Parameters for map_projection_loader", - "type": "object", - "definitions": { - "map_projection_loader": { - "type": "object", - "properties": { - "map_projector_info_path": { - "type": "string", - "description": "The path where map_projector_info.yaml is located", - "default": "$(var map_projector_info_path)" - }, - "lanelet2_map_path": { - "type": "string", - "description": "The path where the lanelet2 map file (.osm) is located", - "default": "$(var lanelet2_map_path)" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for map_projection_loader", + "type": "object", + "definitions": { + "map_projection_loader": { + "type": "object", + "properties": { + "map_projector_info_path": { + "type": "string", + "description": "The path where map_projector_info.yaml is located", + "default": "$(var map_projector_info_path)" }, - "required": [ - "map_projector_info_path", - "lanelet2_map_path" - ], - "additionalProperties": false - } - }, - "properties": { - "/**": { - "type": "object", - "properties": { - "ros__parameters": { - "$ref": "#/definitions/map_projection_loader" - } - }, - "required": ["ros__parameters"], - "additionalProperties": false - } - }, - "required": ["/**"], - "additionalProperties": false - } - \ No newline at end of file + "lanelet2_map_path": { + "type": "string", + "description": "The path where the lanelet2 map file (.osm) is located", + "default": "$(var lanelet2_map_path)" + } + }, + "required": ["map_projector_info_path", "lanelet2_map_path"], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/map_projection_loader" + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false +} From 5ab636c5523c9fa20094b54f850d09409807fde2 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Thu, 1 Feb 2024 09:45:14 +0900 Subject: [PATCH 4/4] Fixed typo Signed-off-by: TaikiYamada4 --- map/map_projection_loader/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map/map_projection_loader/README.md b/map/map_projection_loader/README.md index 4118a494f83c8..848fcfba95f14 100644 --- a/map/map_projection_loader/README.md +++ b/map/map_projection_loader/README.md @@ -86,6 +86,6 @@ map_origin: ## Parameters -Note that these paramters are assumed to be passed from launch arguments, and it is not recommended to directly write them in `map_projection_loader.param.yaml`. +Note that these parameters are assumed to be passed from launch arguments, and it is not recommended to directly write them in `map_projection_loader.param.yaml`. {{ json_to_markdown("map/map_projection_loader/schema/map_projection_loader.schema.json") }}