Skip to content

Commit 1a61d7a

Browse files
authored
Merge branch 'autowarefoundation:main' into feat/add_perception_objects_pointcloud_publisher
2 parents 6303e1b + 8b95d2a commit 1a61d7a

File tree

10 files changed

+38
-23
lines changed

10 files changed

+38
-23
lines changed

common/autoware_testing/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
<build_depend>autoware_cmake</build_depend>
1414

15+
<buildtool_export_depend>ros_testing</buildtool_export_depend>
16+
1517
<test_depend>ament_cmake_core</test_depend>
1618
<test_depend>ament_copyright</test_depend>
1719
<test_depend>ament_flake8</test_depend>

common/motion_utils/include/motion_utils/trajectory/trajectory.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ boost::optional<size_t> findNearestIndex(
273273

274274
for (size_t i = 0; i < points.size(); ++i) {
275275
const auto squared_dist = tier4_autoware_utils::calcSquaredDistance2d(points.at(i), pose);
276-
if (squared_dist > max_squared_dist) {
276+
if (squared_dist > max_squared_dist || squared_dist >= min_squared_dist) {
277277
continue;
278278
}
279279

@@ -283,10 +283,6 @@ boost::optional<size_t> findNearestIndex(
283283
continue;
284284
}
285285

286-
if (squared_dist >= min_squared_dist) {
287-
continue;
288-
}
289-
290286
min_squared_dist = squared_dist;
291287
min_idx = i;
292288
is_nearest_found = true;

perception/ground_segmentation/docs/scan-ground-filter.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This implementation inherits `pointcloud_preprocessor::Filter` class, please ref
4747
| `gnd_grid_buffer_size` | uint16 | 4 | Number of grids using to estimate local ground slope,<br /> applied only for elevation_grid_mode |
4848
| `low_priority_region_x` | float | -20.0 | The non-zero x threshold in back side from which small objects detection is low priority [m] |
4949
| `elevation_grid_mode` | bool | true | Elevation grid scan mode option |
50+
| `use_recheck_ground_cluster` | bool | true | Enable recheck ground cluster |
5051

5152
## Assumptions / Known limits
5253

perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ class ScanGroundFilterComponent : public pointcloud_preprocessor::Filter
170170
double // minimum height threshold regardless the slope,
171171
split_height_distance_; // useful for close points
172172
bool use_virtual_ground_point_;
173+
bool use_recheck_ground_cluster_; // to enable recheck ground cluster
173174
size_t radial_dividers_num_;
174175
VehicleInfo vehicle_info_;
175176

perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ScanGroundFilterComponent::ScanGroundFilterComponent(const rclcpp::NodeOptions &
5454
split_points_distance_tolerance_ = declare_parameter("split_points_distance_tolerance", 0.2);
5555
split_height_distance_ = declare_parameter("split_height_distance", 0.2);
5656
use_virtual_ground_point_ = declare_parameter("use_virtual_ground_point", true);
57+
use_recheck_ground_cluster_ = declare_parameter("use_recheck_ground_cluster", true);
5758
radial_dividers_num_ = std::ceil(2.0 * M_PI / radial_divider_angle_rad_);
5859
vehicle_info_ = VehicleInfoUtil(*this).getVehicleInfo();
5960

@@ -356,7 +357,9 @@ void ScanGroundFilterComponent::classifyPointCloudGridScan(
356357
// move to new grid
357358
if (p->grid_id > prev_p->grid_id && ground_cluster.getAverageRadius() > 0.0) {
358359
// check if the prev grid have ground point cloud
359-
recheckGroundCluster(ground_cluster, non_ground_height_threshold_, out_no_ground_indices);
360+
if (use_recheck_ground_cluster_) {
361+
recheckGroundCluster(ground_cluster, non_ground_height_threshold_, out_no_ground_indices);
362+
}
360363
curr_gnd_grid.radius = ground_cluster.getAverageRadius();
361364
curr_gnd_grid.avg_height = ground_cluster.getAverageHeight();
362365
curr_gnd_grid.max_height = ground_cluster.getMaxHeight();
@@ -611,7 +614,11 @@ rcl_interfaces::msg::SetParametersResult ScanGroundFilterComponent::onParameter(
611614
get_logger(),
612615
"Setting use_virtual_ground_point to: " << std::boolalpha << use_virtual_ground_point_);
613616
}
614-
617+
if (get_param(p, "use_recheck_ground_cluster", use_recheck_ground_cluster_)) {
618+
RCLCPP_DEBUG_STREAM(
619+
get_logger(),
620+
"Setting use_recheck_ground_cluster to: " << std::boolalpha << use_recheck_ground_cluster_);
621+
}
615622
rcl_interfaces::msg::SetParametersResult result;
616623
result.successful = true;
617624
result.reason = "success";

perception/traffic_light_classifier/README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,19 @@ These colors and shapes are assigned to the message as follows:
5454

5555
#### cnn_classifier
5656

57-
| Name | Type | Description |
58-
| ----------------- | ---- | ------------------------------------------------- |
59-
| `model_file_path` | str | path to the model file |
60-
| `label_file_path` | str | path to the label file |
61-
| `precision` | str | TensorRT precision, `fp16` or `int8` |
62-
| `input_c` | str | the channel size of an input image |
63-
| `input_h` | str | the height of an input image |
64-
| `input_w` | str | the width of an input image |
65-
| `build_only` | bool | shutdown node after TensorRT engine file is built |
57+
| Name | Type | Description |
58+
| ----------------- | ------ | ------------------------------------------------- |
59+
| `model_file_path` | str | path to the model file |
60+
| `label_file_path` | str | path to the label file |
61+
| `precision` | str | TensorRT precision, `fp16` or `int8` |
62+
| `input_c` | str | the channel size of an input image |
63+
| `input_h` | str | the height of an input image |
64+
| `input_w` | str | the width of an input image |
65+
| `input_name` | str | the name of neural network's input layer |
66+
| `output_name` | str | the name of neural network's output name |
67+
| `mean` | double | mean values for image normalization |
68+
| `std` | double | std values for image normalization |
69+
| `build_only` | bool | shutdown node after TensorRT engine file is built |
6670

6771
#### hsv_classifier
6872

perception/traffic_light_classifier/include/traffic_light_classifier/cnn_classifier.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class CNNClassifier : public ClassifierInterface
101101
std::shared_ptr<Tn::TrtCommon> trt_;
102102
image_transport::Publisher image_pub_;
103103
std::vector<std::string> labels_;
104-
std::vector<float> mean_{0.242, 0.193, 0.201};
105-
std::vector<float> std_{1.0, 1.0, 1.0};
104+
std::vector<double> mean_;
105+
std::vector<double> std_;
106106
int input_c_;
107107
int input_h_;
108108
int input_w_;

perception/traffic_light_classifier/launch/traffic_light_classifier.launch.xml

+5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
<param name="classifier_type" value="$(var classifier_type)"/>
2020
<param name="model_file_path" value="$(find-pkg-share traffic_light_classifier)/data/traffic_light_classifier_mobilenetv2.onnx"/>
2121
<param name="label_file_path" value="$(find-pkg-share traffic_light_classifier)/data/lamp_labels.txt"/>
22+
<param name="mean" value="[0.242, 0.193, 0.201]"/>
23+
<param name="std" value="[1.0, 1.0, 1.0]"/>
2224
<param name="precision" value="fp16"/>
25+
<param name="input_name" value="input_0"/>
26+
<param name="output_name" value="output_0"/>
27+
<param name="apply_softmax" value="true"/>
2328
<param name="input_c" value="3"/>
2429
<param name="input_h" value="224"/>
2530
<param name="input_w" value="224"/>

perception/traffic_light_classifier/src/cnn_classifier.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ CNNClassifier::CNNClassifier(rclcpp::Node * node_ptr) : node_ptr_(node_ptr)
3939
input_c_ = node_ptr_->declare_parameter("input_c", 3);
4040
input_h_ = node_ptr_->declare_parameter("input_h", 224);
4141
input_w_ = node_ptr_->declare_parameter("input_w", 224);
42-
auto input_name = node_ptr_->declare_parameter("input_name", "input_0");
43-
auto output_name = node_ptr_->declare_parameter("output_name", "output_0");
42+
mean_ = node_ptr_->declare_parameter("mean", std::vector<double>({0.242, 0.193, 0.201}));
43+
std_ = node_ptr_->declare_parameter("std", std::vector<double>({1.0, 1.0, 1.0}));
44+
std::string input_name = node_ptr_->declare_parameter("input_name", std::string("input_0"));
45+
std::string output_name = node_ptr_->declare_parameter("output_name", std::string("output_0"));
4446
apply_softmax_ = node_ptr_->declare_parameter("apply_softmax", true);
4547

4648
readLabelfile(label_file_path, labels_);

planning/surround_obstacle_checker/include/surround_obstacle_checker/node.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <vehicle_info_util/vehicle_info_util.hpp>
2424

2525
#include <autoware_auto_perception_msgs/msg/predicted_objects.hpp>
26-
#include <autoware_auto_planning_msgs/msg/trajectory.hpp>
2726
#include <diagnostic_msgs/msg/diagnostic_status.hpp>
2827
#include <diagnostic_msgs/msg/key_value.hpp>
2928
#include <nav_msgs/msg/odometry.hpp>
@@ -46,8 +45,6 @@ namespace surround_obstacle_checker
4645

4746
using autoware_auto_perception_msgs::msg::PredictedObjects;
4847
using autoware_auto_perception_msgs::msg::Shape;
49-
using autoware_auto_planning_msgs::msg::Trajectory;
50-
using autoware_auto_planning_msgs::msg::TrajectoryPoint;
5148
using motion_utils::VehicleStopChecker;
5249
using tier4_planning_msgs::msg::VelocityLimit;
5350
using tier4_planning_msgs::msg::VelocityLimitClearCommand;

0 commit comments

Comments
 (0)