daohu527 / dig-into-apollo

Apollo notes (Apollo学习笔记) - Apollo learning notes for beginners.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

我想问一下,lidar在分割之前如何构造ROI区域?

markofan opened this issue · comments

Apollo5.0 在/perception/map/hdmap/hamap_input.cc中,有GetRoiHDMapStruct函数,中间调用了MergeBoundaryJunction和GetRoadBoundaryFilteredByJunctions函数,我有点看不太懂,这个ROI是如何Get的,您了解过吗?

bool HDMapInput::GetRoiHDMapStruct(
const base::PointD& pointd, const double distance,
std::shared_ptrbase::HdmapStruct hdmap_struct_ptr) {
lib::MutexLock lock(&mutex_);
if (hdmap_.get() == nullptr) {
AERROR << "hdmap is not available";
return false;
}
// Get original road boundary and junction
std::vector road_boundary_vec;
std::vector junctions_vec;
apollo::common::PointENU point;
point.set_x(pointd.x);
point.set_y(pointd.y);
point.set_z(pointd.z);
if (hdmap_->GetRoadBoundaries(point, distance, &road_boundary_vec,
&junctions_vec) != 0) {
AERROR << "Failed to get road boundary, point: " << point.DebugString();
return false;
}
if (hdmap_struct_ptr == nullptr) {
return false;
}
hdmap_struct_ptr->hole_polygons.clear();
hdmap_struct_ptr->junction_polygons.clear();
hdmap_struct_ptr->road_boundary.clear();
hdmap_struct_ptr->road_polygons.clear();

// Merge boundary and junction
std::vector road_boundaries;
MergeBoundaryJunction(road_boundary_vec, junctions_vec, &road_boundaries,
&(hdmap_struct_ptr->road_polygons),
&(hdmap_struct_ptr->junction_polygons));
// Filter road boundary by junction
GetRoadBoundaryFilteredByJunctions(road_boundaries,
hdmap_struct_ptr->junction_polygons,
&(hdmap_struct_ptr->road_boundary));
return true;
}

commented
  1. 我的理解是以"pointd"为圆心,"distance"为半径查找对应的高精度地图,获取感兴趣区域。返回的结果在"hdmap_struct_ptr"中。
  2. MergeBoundaryJunction和GetRoadBoundaryFilteredByJunctions 这2个函数功能具体的实现我还没有仔细看,大概的理解就是合并十字路口的边界,然后通过十字路口的边界进行过滤

非常感谢您的回复,我还有一个问题想问一下,对于camera来说,分别有“Traffic light detection”, "Lane/Flow Detection" 和“Objection Detection”三个部分。我的理解是分别对应/perception/onboard/component/下的“trafficlights_perception_component.cc”,“lane_detection_component.cc”和“fusion_camera_detection_component.cc”这三个文件,打算分别从三个文件中的Init()函数看具体的操作,不知道这样的思路是否正确?还有前面还有一步“Image Processing”,这一步具体的操作定义在哪儿?谢谢!

commented

如果是新的问题,我建议重新开一个issue讨论,这样方便查找问题。

实际上每个传感器都包含“感知”和“追踪”功能,摄像头的功能更多,包括红绿灯识别,车道线识别和障碍物识别,这几个功能的实现都在camera目录中,你可以按照传感器来阅读代码,也可以按照具体的功能来阅读代码,都没有问题。参考