Skip to content

Commit db575e3

Browse files
Merge remote-tracking branch 'origin' into feat/z_fitting_by_vectormap
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
2 parents 0cc5cae + 7cb77dd commit db575e3

File tree

32 files changed

+739
-443
lines changed

32 files changed

+739
-443
lines changed

launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<!-- pointcloud_downsampling -->
109109
<let name="override_input_pointcloud" value="$(var input_pointcloud)"/>
110110
<let name="override_input_pointcloud" value="$(var input_pointcloud)/relay" if="$(var multi_localizer_mode)"/>
111-
<include file="$(find-pkg-share tier4_localization_launch)/launch/util/util.launch.py" if="$(var use_ndt_pose)">
111+
<include file="$(find-pkg-share tier4_localization_launch)/launch/util/util.launch.xml" if="$(var use_ndt_pose)">
112112
<arg name="lidar_container_name" value="$(var lidar_container_name)"/>
113113
<arg name="input_pointcloud" value="$(var override_input_pointcloud)"/>
114114
</include>

launch/tier4_localization_launch/launch/util/util.launch.py

-136
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<launch>
2+
<!-- topic -->
3+
<arg name="output/pointcloud" default="downsample/pointcloud" description="final output topic name"/>
4+
5+
<!-- container -->
6+
<arg name="lidar_container_name" default="/sensing/lidar/top/pointcloud_preprocessor/pointcloud_container" description="container name of main lidar used for localization"/>
7+
8+
<!-- whether use intra-process -->
9+
<arg name="use_intra_process" default="true" description="use ROS 2 component container communication"/>
10+
11+
<load_composable_node target="$(var lidar_container_name)">
12+
<composable_node pkg="pointcloud_preprocessor" plugin="pointcloud_preprocessor::CropBoxFilterComponent" name="crop_box_filter_measurement_range">
13+
<param from="$(var crop_box_filter_measurement_range_param_path)"/>
14+
<remap from="input" to="$(var input_pointcloud)"/>
15+
<remap from="output" to="measurement_range/pointcloud"/>
16+
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/>
17+
</composable_node>
18+
19+
<composable_node pkg="pointcloud_preprocessor" plugin="pointcloud_preprocessor::VoxelGridDownsampleFilterComponent" name="voxel_grid_downsample_filter">
20+
<param from="$(var voxel_grid_downsample_filter_param_path)"/>
21+
<remap from="input" to="measurement_range/pointcloud"/>
22+
<remap from="output" to="voxel_grid_downsample/pointcloud"/>
23+
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/>
24+
</composable_node>
25+
26+
<composable_node pkg="pointcloud_preprocessor" plugin="pointcloud_preprocessor::RandomDownsampleFilterComponent" name="random_downsample_filter">
27+
<param from="$(var random_downsample_filter_param_path)"/>
28+
<remap from="input" to="voxel_grid_downsample/pointcloud"/>
29+
<remap from="output" to="$(var output/pointcloud)"/>
30+
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/>
31+
</composable_node>
32+
</load_composable_node>
33+
</launch>

map/map_height_fitter/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ ament_auto_add_executable(node
1515
src/node.cpp
1616
)
1717

18-
ament_auto_package(INSTALL_TO_SHARE launch)
18+
ament_auto_package(
19+
INSTALL_TO_SHARE
20+
launch
21+
config)

map/map_height_fitter/README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ This library fits the given point with the ground of the point cloud map.
44
The map loading operation is switched by the parameter `enable_partial_load` of the node specified by `map_loader_name`.
55
The node using this library must use multi thread executor.
66

7-
| Interface | Local Name | Description |
8-
| ------------ | ------------------ | ---------------------------------------- |
9-
| Parameter | map_loader_name | The point cloud map loader name. |
10-
| Subscription | ~/pointcloud_map | The topic name to load the whole map |
11-
| Client | ~/partial_map_load | The service name to load the partial map |
7+
## Parameters
8+
9+
{{ json_to_markdown("map/map_height_fitter/schema/map_height_fitter.schema.json") }}
10+
11+
## Topic subscription
12+
13+
| Topic Name | Description |
14+
| ---------------- | -------------------------------------------------------------------------------------------- |
15+
| ~/pointcloud_map | The topic containing the whole pointcloud map (only used when `enable_partial_load = false`) |
16+
17+
## Service client
18+
19+
| Service Name | Description |
20+
| ------------------ | ----------------------------------- |
21+
| ~/partial_map_load | The service to load the partial map |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**:
2+
ros__parameters:
3+
map_loader_name: "/map/pointcloud_map_loader"
4+
fit_target: "pointcloud_map"

map/map_height_fitter/launch/map_height_fitter.launch.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<launch>
2+
<arg name="param_path" default="$(find-pkg-share map_height_fitter)/config/map_height_fitter.param.yaml"/>
3+
24
<group>
35
<push-ros-namespace namespace="map"/>
46
<node pkg="map_height_fitter" exec="node" name="map_height_fitter">
5-
<param name="map_loader_name" value="/map/pointcloud_map_loader"/>
6-
<param name="fit_target" value="pointcloud_map"/>
7+
<param from="$(var param_path)"/>
78
<remap from="~/pointcloud_map" to="/map/pointcloud_map"/>
89
<remap from="~/partial_map_load" to="/map/get_partial_pointcloud_map"/>
910
<remap from="~/vector_map" to="/map/vector_map"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for map_height_fitter",
4+
"type": "object",
5+
"definitions": {
6+
"map_height_fitter": {
7+
"type": "object",
8+
"properties": {
9+
"map_loader_name": {
10+
"type": "string",
11+
"description": "Node name of the map loader from which this map_height_fitter will retrieve its parameters",
12+
"default": "/map/pointcloud_map_loader"
13+
}
14+
},
15+
"required": ["map_loader_name"],
16+
"additionalProperties": false
17+
}
18+
},
19+
"properties": {
20+
"/**": {
21+
"type": "object",
22+
"properties": {
23+
"ros__parameters": {
24+
"$ref": "#/definitions/map_height_fitter"
25+
}
26+
},
27+
"required": ["ros__parameters"],
28+
"additionalProperties": false
29+
}
30+
},
31+
"required": ["/**"],
32+
"additionalProperties": false
33+
}

perception/image_projection_based_fusion/config/segmentation_pointcloud_fusion.param.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131

3232
# debug
3333
debug_mode: false
34-
filter_scope_minx: -100
35-
filter_scope_maxx: 100
36-
filter_scope_miny: -100
37-
filter_scope_maxy: 100
38-
filter_scope_minz: -100
39-
filter_scope_maxz: 100
34+
filter_scope_min_x: -100
35+
filter_scope_max_x: 100
36+
filter_scope_min_y: -100
37+
filter_scope_max_y: 100
38+
filter_scope_min_z: -100
39+
filter_scope_max_z: 100
4040
image_buffer_size: 15

perception/image_projection_based_fusion/include/image_projection_based_fusion/fusion_node.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
#include <utility>
4545
#include <vector>
4646

47-
// cspell: ignore minx, maxx, miny, maxy, minz, maxz
48-
4947
namespace image_projection_based_fusion
5048
{
5149
using autoware_auto_perception_msgs::msg::DetectedObject;
@@ -131,13 +129,12 @@ class FusionNode : public rclcpp::Node
131129
// debugger
132130
std::shared_ptr<Debugger> debugger_;
133131
virtual bool out_of_scope(const ObjType & obj) = 0;
134-
// cspell: ignore minx, maxx, miny, maxy, minz, maxz
135-
float filter_scope_minx_;
136-
float filter_scope_maxx_;
137-
float filter_scope_miny_;
138-
float filter_scope_maxy_;
139-
float filter_scope_minz_;
140-
float filter_scope_maxz_;
132+
float filter_scope_min_x_;
133+
float filter_scope_max_x_;
134+
float filter_scope_min_y_;
135+
float filter_scope_max_y_;
136+
float filter_scope_min_z_;
137+
float filter_scope_max_z_;
141138

142139
/** \brief processing time publisher. **/
143140
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;

perception/image_projection_based_fusion/launch/roi_cluster_fusion.launch.xml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<arg name="sync_param_path" default="$(find-pkg-share image_projection_based_fusion)/config/roi_sync.param.yaml"/>
2323

2424
<!-- debug -->
25-
<!-- cspell: ignore minx, maxx, miny, maxy, minz, maxz -->
2625
<arg name="input/image0" default="/image_raw0"/>
2726
<arg name="input/image1" default="/image_raw1"/>
2827
<arg name="input/image2" default="/image_raw2"/>

perception/image_projection_based_fusion/src/fusion_node.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,12 @@ FusionNode<Msg, ObjType, Msg2D>::FusionNode(
137137
stop_watch_ptr_->tic("processing_time");
138138
}
139139

140-
// cspell: ignore minx, maxx, miny, maxy, minz, maxz
141-
// FIXME: use min_x instead of minx
142-
filter_scope_minx_ = declare_parameter<double>("filter_scope_min_x");
143-
filter_scope_maxx_ = declare_parameter<double>("filter_scope_max_x");
144-
filter_scope_miny_ = declare_parameter<double>("filter_scope_min_y");
145-
filter_scope_maxy_ = declare_parameter<double>("filter_scope_max_y");
146-
filter_scope_minz_ = declare_parameter<double>("filter_scope_min_z");
147-
filter_scope_maxz_ = declare_parameter<double>("filter_scope_max_z");
140+
filter_scope_min_x_ = declare_parameter<double>("filter_scope_min_x");
141+
filter_scope_max_x_ = declare_parameter<double>("filter_scope_max_x");
142+
filter_scope_min_y_ = declare_parameter<double>("filter_scope_min_y");
143+
filter_scope_max_y_ = declare_parameter<double>("filter_scope_max_y");
144+
filter_scope_min_z_ = declare_parameter<double>("filter_scope_min_z");
145+
filter_scope_max_z_ = declare_parameter<double>("filter_scope_max_z");
148146
}
149147

150148
template <class Msg, class Obj, class Msg2D>

perception/image_projection_based_fusion/src/roi_cluster_fusion/node.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <tf2_sensor_msgs/tf2_sensor_msgs.hpp>
2929
#endif
3030

31-
// cspell: ignore minx, maxx, miny, maxy, minz, maxz
32-
3331
namespace image_projection_based_fusion
3432
{
3533

@@ -253,17 +251,17 @@ bool RoiClusterFusionNode::out_of_scope(const DetectedObjectWithFeature & obj)
253251
for (sensor_msgs::PointCloud2ConstIterator<float> iter_x(cluster, "x"), iter_y(cluster, "y"),
254252
iter_z(cluster, "z");
255253
iter_x != iter_x.end(); ++iter_x, ++iter_y, ++iter_z) {
256-
if (!valid_point(*iter_x, filter_scope_minx_, filter_scope_maxx_)) {
254+
if (!valid_point(*iter_x, filter_scope_min_x_, filter_scope_max_x_)) {
257255
is_out = true;
258256
break;
259257
}
260258

261-
if (!valid_point(*iter_y, filter_scope_miny_, filter_scope_maxy_)) {
259+
if (!valid_point(*iter_y, filter_scope_min_y_, filter_scope_max_y_)) {
262260
is_out = true;
263261
break;
264262
}
265263

266-
if (!valid_point(*iter_z, filter_scope_minz_, filter_scope_maxz_)) {
264+
if (!valid_point(*iter_z, filter_scope_min_z_, filter_scope_max_z_)) {
267265
is_out = true;
268266
break;
269267
}

perception/image_projection_based_fusion/src/roi_detected_object_fusion/node.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <image_projection_based_fusion/utils/geometry.hpp>
2020
#include <image_projection_based_fusion/utils/utils.hpp>
2121

22-
// cspell: ignore minx, maxx, miny, maxy, minz, maxz
23-
2422
namespace image_projection_based_fusion
2523
{
2624

@@ -268,13 +266,13 @@ bool RoiDetectedObjectFusionNode::out_of_scope(const DetectedObject & obj)
268266
return (p > min_num) && (p < max_num);
269267
};
270268

271-
if (!valid_point(pose.position.x, filter_scope_minx_, filter_scope_maxx_)) {
269+
if (!valid_point(pose.position.x, filter_scope_min_x_, filter_scope_max_x_)) {
272270
return is_out;
273271
}
274-
if (!valid_point(pose.position.y, filter_scope_miny_, filter_scope_maxy_)) {
272+
if (!valid_point(pose.position.y, filter_scope_min_y_, filter_scope_max_y_)) {
275273
return is_out;
276274
}
277-
if (!valid_point(pose.position.z, filter_scope_minz_, filter_scope_maxz_)) {
275+
if (!valid_point(pose.position.z, filter_scope_min_z_, filter_scope_max_z_)) {
278276
return is_out;
279277
}
280278

0 commit comments

Comments
 (0)