|
17 | 17 | #include <behavior_velocity_planner_common/utilization/util.hpp>
|
18 | 18 | #include <tier4_autoware_utils/ros/parameter.hpp>
|
19 | 19 |
|
| 20 | +#include <algorithm> |
20 | 21 | #include <limits>
|
21 | 22 | #include <memory>
|
22 | 23 | #include <set>
|
@@ -140,10 +141,29 @@ CrosswalkModuleManager::CrosswalkModuleManager(rclcpp::Node & node)
|
140 | 141 | getOrDeclareParameter<bool>(node, ns + ".occlusion.ignore_with_traffic_light");
|
141 | 142 | cp.occlusion_ignore_behind_predicted_objects =
|
142 | 143 | getOrDeclareParameter<bool>(node, ns + ".occlusion.ignore_behind_predicted_objects");
|
143 |
| - cp.occlusion_do_not_ignore_behind_pedestrians = |
144 |
| - getOrDeclareParameter<bool>(node, ns + ".occlusion.do_not_ignore_behind_pedestrians"); |
145 |
| - cp.occlusion_ignore_velocity_threshold = |
146 |
| - getOrDeclareParameter<double>(node, ns + ".occlusion.ignore_velocity_threshold"); |
| 144 | + |
| 145 | + cp.occlusion_ignore_velocity_thresholds.resize( |
| 146 | + autoware_auto_perception_msgs::msg::ObjectClassification::PEDESTRIAN + 1, |
| 147 | + getOrDeclareParameter<double>(node, ns + ".occlusion.ignore_velocity_thresholds.default")); |
| 148 | + const auto get_label = [](const std::string & s) { |
| 149 | + if (s == "CAR") return autoware_auto_perception_msgs::msg::ObjectClassification::CAR; |
| 150 | + if (s == "TRUCK") return autoware_auto_perception_msgs::msg::ObjectClassification::TRUCK; |
| 151 | + if (s == "BUS") return autoware_auto_perception_msgs::msg::ObjectClassification::BUS; |
| 152 | + if (s == "TRAILER") return autoware_auto_perception_msgs::msg::ObjectClassification::TRAILER; |
| 153 | + if (s == "MOTORCYCLE") |
| 154 | + return autoware_auto_perception_msgs::msg::ObjectClassification::MOTORCYCLE; |
| 155 | + if (s == "BICYCLE") return autoware_auto_perception_msgs::msg::ObjectClassification::BICYCLE; |
| 156 | + if (s == "PEDESTRIAN") |
| 157 | + return autoware_auto_perception_msgs::msg::ObjectClassification::PEDESTRIAN; |
| 158 | + return autoware_auto_perception_msgs::msg::ObjectClassification::UNKNOWN; |
| 159 | + }; |
| 160 | + const auto custom_labels = getOrDeclareParameter<std::vector<std::string>>( |
| 161 | + node, ns + ".occlusion.ignore_velocity_thresholds.custom_labels"); |
| 162 | + const auto custom_velocities = getOrDeclareParameter<std::vector<double>>( |
| 163 | + node, ns + ".occlusion.ignore_velocity_thresholds.custom_thresholds"); |
| 164 | + for (auto idx = 0UL; idx < std::min(custom_labels.size(), custom_velocities.size()); ++idx) { |
| 165 | + cp.occlusion_ignore_velocity_thresholds[get_label(custom_labels[idx])] = custom_velocities[idx]; |
| 166 | + } |
147 | 167 | cp.occlusion_extra_objects_size =
|
148 | 168 | getOrDeclareParameter<double>(node, ns + ".occlusion.extra_predicted_objects_size");
|
149 | 169 | }
|
|
0 commit comments