Skip to content

Commit 19cc86d

Browse files
committed
feat: check pointcloud within detection area
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 838fcf7 commit 19cc86d

File tree

5 files changed

+239
-117
lines changed

5 files changed

+239
-117
lines changed

planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/object_manager.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,27 @@ void ObjectInfo::initialize(
7979
std::optional<lanelet::ConstLanelet> attention_lanelet_opt,
8080
std::optional<lanelet::ConstLineString3d> stopline_opt)
8181
{
82+
type = ObstacleType::OBJECT;
8283
predicted_object_ = object;
8384
attention_lanelet_opt_ = attention_lanelet_opt;
8485
stopline_opt_ = stopline_opt;
8586
unsafe_interval_ = std::nullopt;
8687
calc_dist_to_stopline();
8788
}
8889

90+
void ObjectInfo::initialize(
91+
const geometry_msgs::msg::Point & point,
92+
std::optional<lanelet::ConstLanelet> attention_lanelet_opt,
93+
std::optional<lanelet::ConstLineString3d> stopline_opt)
94+
{
95+
type = ObstacleType::POINTCLOUD;
96+
point_ = point;
97+
attention_lanelet_opt_ = attention_lanelet_opt;
98+
stopline_opt_ = stopline_opt;
99+
unsafe_interval_ = std::nullopt;
100+
calc_dist_to_stopline();
101+
}
102+
89103
void ObjectInfo::update_safety(
90104
const std::optional<CollisionInterval> & unsafe_interval,
91105
const std::optional<CollisionInterval> & safe_interval, const bool safe_under_traffic_control)

planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/object_manager.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ class ObjectInfo
130130
std::optional<lanelet::ConstLanelet> attention_lanelet_opt,
131131
std::optional<lanelet::ConstLineString3d> stopline_opt);
132132

133+
void initialize(
134+
const geometry_msgs::msg::Point & point,
135+
std::optional<lanelet::ConstLanelet> attention_lanelet_opt,
136+
std::optional<lanelet::ConstLineString3d> stopline_opt);
137+
133138
/**
134139
* @brief update unsafe_knowledge
135140
*/
@@ -191,9 +196,17 @@ class ObjectInfo
191196

192197
const std::string uuid_str;
193198

199+
enum ObstacleType {
200+
OBJECT,
201+
POINTCLOUD,
202+
};
203+
ObstacleType type;
204+
194205
private:
195206
autoware_perception_msgs::msg::PredictedObject predicted_object_;
196207

208+
geometry_msgs::msg::Point point_;
209+
197210
//! null if the object in intersection_area but not in attention_area
198211
std::optional<lanelet::ConstLanelet> attention_lanelet_opt_{std::nullopt};
199212

@@ -265,6 +278,8 @@ class ObjectInfoManager
265278
private:
266279
std::unordered_map<unique_identifier_msgs::msg::UUID, std::shared_ptr<ObjectInfo>> objects_info_;
267280

281+
std::vector<std::shared_ptr<geometry_msgs::msg::Point>> obstacle_pointcloud_info_;
282+
268283
//! belong to attention area
269284
std::vector<std::shared_ptr<ObjectInfo>> attention_area_objects_;
270285

planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,9 @@ class IntersectionModule : public SceneModuleInterfaceWithRTC
806806
const bool is_over_1st_pass_judge_line,
807807
const std::optional<bool> is_over_2nd_pass_judge_line) const;
808808

809+
std::optional<size_t> isWithinTargetLanelets(
810+
const geometry_msgs::msg::Point & point, const lanelet::ConstLanelets & target_lanelets) const;
811+
809812
std::optional<size_t> checkAngleForTargetLanelets(
810813
const geometry_msgs::msg::Pose & pose, const lanelet::ConstLanelets & target_lanelets,
811814
const bool is_parked_vehicle) const;

0 commit comments

Comments
 (0)