Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(map_projection_loader): rework parameters #6253

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions launch/tier4_map_launch/launch/map.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<!-- Parameter files -->
<arg name="pointcloud_map_loader_param_path"/>
<arg name="lanelet2_map_loader_param_path"/>
<arg name="map_projection_loader_param_path"/>

<!-- whether use intra-process -->
<arg name="use_intra_process" default="false"/>
Expand Down Expand Up @@ -59,6 +60,7 @@
</node>

<include file="$(find-pkg-share map_projection_loader)/launch/map_projection_loader.launch.xml">
<arg name="param_path" value="$(var map_projection_loader_param_path)"/>
<arg name="map_projector_info_path" value="$(var map_projector_info_path)"/>
<arg name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
</include>
Expand Down
1 change: 1 addition & 0 deletions map/map_projection_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ endif()

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
9 changes: 4 additions & 5 deletions map/map_projection_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**:
ros__parameters:
map_projector_info_path: $(var map_projector_info_path)
lanelet2_map_path: $(var lanelet2_map_path)
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<launch>
<arg name="param_path" default="$(find-pkg-share map_projection_loader)/config/map_projection_loader.param.yaml"/>

<arg name="map_projector_info_path" description="Path to the yaml file"/>
<arg name="lanelet2_map_path" description="Path to the lanelet2 map file"/>

<node pkg="map_projection_loader" exec="map_projection_loader" name="map_projection_loader" output="screen">
<param name="map_projector_info_path" value="$(var map_projector_info_path)"/>
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<param from="$(var param_path)" allow_substs="true"/>
</node>
</launch>
38 changes: 38 additions & 0 deletions map/map_projection_loader/schema/map_projection_loader.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +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)"
}
},
"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
}
Loading