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

chore(map_loader): rework parameters of map_loader #6199

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
44a21b0
Rework parameters of map_loader
anhnv3991 Jan 29, 2024
0735d19
style(pre-commit): autofix
pre-commit-ci[bot] Jan 29, 2024
ea945e1
Fixed typo in name of map_based_pediction.schema.json, which cause js…
anhnv3991 Jan 29, 2024
580e000
Merge branch 'chore/rework_param_map_loader' of https://github.com/an…
anhnv3991 Jan 29, 2024
3693fa8
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Jan 30, 2024
f593330
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Jan 30, 2024
3ab22e5
Move path variables back to launch files
anhnv3991 Jan 30, 2024
89d53f4
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Jan 30, 2024
40bdbbe
Update README.md
anhnv3991 Jan 30, 2024
da09238
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Jan 31, 2024
64a1c7c
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Feb 1, 2024
91b5ade
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Feb 1, 2024
e2a5f4a
Undo the change in perception
anhnv3991 Feb 1, 2024
ea09bb9
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Feb 7, 2024
6951afd
Remove default values of declare_parameter from map_loader
anhnv3991 Feb 7, 2024
77ffae6
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Feb 7, 2024
b6d631c
Merge branch 'autowarefoundation:main' into chore/rework_param_map_lo…
Feb 7, 2024
45529fb
Fixed lanelet2_map_loader_launch.test.py
anhnv3991 Feb 7, 2024
17f998e
Merge branch 'main' into chore/rework_param_map_loader
Feb 7, 2024
93e732f
style(pre-commit): autofix
pre-commit-ci[bot] Feb 7, 2024
c0f23f7
Merge branch 'main' into chore/rework_param_map_loader
Feb 7, 2024
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
15 changes: 2 additions & 13 deletions map/map_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,7 @@ Please see [the description of `GetSelectedPointCloudMap.srv`](https://github.co

### Parameters

| Name | Type | Description | Default value |
| :---------------------------- | :---------- | :-------------------------------------------------------------------------------- | :------------ |
| enable_whole_load | bool | A flag to enable raw pointcloud map publishing | true |
| enable_downsampled_whole_load | bool | A flag to enable downsampled pointcloud map publishing | false |
| enable_partial_load | bool | A flag to enable partial pointcloud map server | false |
| enable_selected_load | bool | A flag to enable selected pointcloud map server | false |
| leaf_size | float | Downsampling leaf size (only used when enable_downsampled_whole_load is set true) | 3.0 |
| pcd_paths_or_directory | std::string | Path(s) to pointcloud map file or directory | |
| pcd_metadata_path | std::string | Path to pointcloud metadata file | |
{{ json_to_markdown("map/map_loader/schema/pointcloud_map_loader.schema.json") }}

### Interfaces

Expand Down Expand Up @@ -156,10 +148,7 @@ Please see [tier4_autoware_msgs/msg/MapProjectorInfo.msg](https://github.com/tie

### Parameters

| Name | Type | Description | Default value |
| :--------------------- | :---------- | :----------------------------------------------- | :------------ |
| center_line_resolution | double | Define the resolution of the lanelet center line | 5.0 |
| lanelet2_map_path | std::string | The lanelet2 map path | None |
{{ json_to_markdown("map/map_loader/schema/lanelet2_map_loader.schema.json") }}

---

Expand Down
1 change: 1 addition & 0 deletions map/map_loader/config/lanelet2_map_loader.param.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**:
ros__parameters:
center_line_resolution: 5.0 # [m]
lanelet2_map_path: $(var lanelet2_map_path) # The lanelet2 map path
2 changes: 2 additions & 0 deletions map/map_loader/config/pointcloud_map_loader.param.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@

# only used when downsample_whole_load enabled
leaf_size: 3.0 # downsample leaf size [m]
pcd_paths_or_directory: [$(var pcd_paths_or_directory)] # Path to the pointcloud map file or directory
pcd_metadata_path: $(var pcd_metadata_path) # Path to pointcloud metadata file
5 changes: 2 additions & 3 deletions map/map_loader/launch/lanelet2_map_loader.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
<arg name="lanelet2_map_marker_topic" default="vector_map_marker"/>

<node pkg="map_loader" exec="map_hash_generator" name="map_hash_generator">
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
</node>

<node pkg="map_loader" exec="lanelet2_map_loader" name="lanelet2_map_loader">
<remap from="output/lanelet2_map" to="$(var lanelet2_map_topic)"/>
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<param from="$(var lanelet2_map_loader_param_path)"/>
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
</node>

<node pkg="map_loader" exec="lanelet2_map_visualization" name="lanelet2_map_visualization">
Expand Down
4 changes: 1 addition & 3 deletions map/map_loader/launch/pointcloud_map_loader.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<remap from="output/pointcloud_map" to="/map/pointcloud_map"/>
<remap from="service/get_partial_pcd_map" to="/map/get_partial_pointcloud_map"/>
<remap from="service/get_selected_pcd_map" to="/map/get_selected_pointcloud_map"/>
<param name="pcd_paths_or_directory" value="[$(var pointcloud_map_path)]"/>
<param name="pcd_metadata_path" value="$(var pcd_metadata_path)"/>
<param from="$(var pointcloud_map_loader_param_path)"/>
<param from="$(var pointcloud_map_loader_param_path)" allow_substs="true"/>
</node>
</launch>
38 changes: 38 additions & 0 deletions map/map_loader/schema/lanelet2_map_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 lanelet2 map loader Node",
"type": "object",
"definitions": {
"lanelet2_map_loader": {
"type": "object",
"properties": {
"center_line_resolution": {
"type": "number",
"description": "Resolution of the Lanelet center line [m]",
"default": "5.0"
},
"lanelet2_map_path": {
"type": "string",
"description": "The lanelet2 map path pointing to the .osm file",
"default": ""
}
},
"required": ["center_line_resolution", "lanelet2_map_path"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/lanelet2_map_loader"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
71 changes: 71 additions & 0 deletions map/map_loader/schema/pointcloud_map_loader.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for point cloud map loader Node",
"type": "object",
"definitions": {
"pointcloud_map_loader": {
"type": "object",
"properties": {
"enable_whole_load": {
"type": "boolean",
"description": "Enable raw pointcloud map publishing",
"default": true
},
"enable_downsampled_whole_load": {
"type": "boolean",
"description": "Enable downsampled pointcloud map publishing",
"default": false
},
"enable_partial_load": {
"type": "boolean",
"description": "Enable partial pointcloud map server",
"default": true
},
"enable_selected_load": {
"type": "boolean",
"description": "Enable selected pointcloud map server",
"default": false
},
"leaf_size": {
"type": "number",
"description": "Downsampling leaf size (only used when enable_downsampled_whole_load is set true)",
"default": 3.0
},
"pcd_paths_or_directory": {
"type": "array",
"description": "Path(s) to pointcloud map file or directory",
"default": []
},
"pcd_metadata_path": {
"type": "string",
"description": "Path to pointcloud metadata file",
"default": ""
}
},
"required": [
"enable_whole_load",
"enable_downsampled_whole_load",
"enable_partial_load",
"enable_selected_load",
"leaf_size",
"pcd_paths_or_directory",
"pcd_metadata_path"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/pointcloud_map_loader"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Lanelet2MapLoaderNode::Lanelet2MapLoaderNode(const rclcpp::NodeOptions & options
sub_map_projector_info_,
[this](const MapProjectorInfo::Message::ConstSharedPtr msg) { on_map_projector_info(msg); });

declare_parameter("lanelet2_map_path", "");
declare_parameter("center_line_resolution", 5.0);
declare_parameter<std::string>("lanelet2_map_path");
declare_parameter<double>("center_line_resolution");
}

void Lanelet2MapLoaderNode::on_map_projector_info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{
using std::placeholders::_1;

viz_lanelets_centerline_ = this->declare_parameter("viz_lanelets_centerline", true);
viz_lanelets_centerline_ = true;

Check warning on line 74 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L74

Added line #L74 was not covered by tests

sub_map_bin_ = this->create_subscription<autoware_auto_mapping_msgs::msg::HADMapBin>(
"input/lanelet2_map", rclcpp::QoS{1}.transient_local(),
Expand Down
2 changes: 1 addition & 1 deletion map/map_loader/test/lanelet2_map_loader_launch.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_test_description():
lanelet2_map_loader = Node(
package="map_loader",
executable="lanelet2_map_loader",
parameters=[{"lanelet2_map_path": lanelet2_map_path}],
parameters=[{"lanelet2_map_path": lanelet2_map_path, "center_line_resolution": 5.0}],
)

context = {}
Expand Down
Loading