You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use a vector map to filter the point cloud. Since the map is divided into many segments, the efficiency is a bit low. I want to merge all the small segments into a boost::geometry polygon. However, I've searched through the code but couldn't find any relevant examples, which is really frustrating. My code is as follows. I'm asking for your help. Mainly, please tell me how to obtain the coordinates x and y from road_lanelets[0].polygon2d().basicPolygon() so that I can convert them into the boost::geometry polygon format. Thank you in advance.
Polygon Lanelet2MapFilterComponent::getPolygons(lanelet::ConstLanelets & road_lanelets) { Polygon resultPolygon; lanelet::BasicPolygon2d temp_polygon = road_lanelets[0].polygon2d().basicPolygon(); // TODO: change to boost::geometry::polygon // int size = road_lanelets.size(); // for (int i = 1; i < size; ++i) { // boost::geometry::union_(temp_polygon, road_lanelets[i].polygon2d().basicPolygon(), resultPolygon); // } return resultPolygon; }
The text was updated successfully, but these errors were encountered:
A lanelet basic polygon is in essence a std::vector of Eigen vectors that is also already registered with boost geometry as a ring. That may already work with boost::geometry::_union, but I am not too sure as that is more related to boost and less to Lanelet2.
I'm really grateful for your reply. Mainly, I want to know how to obtain the x and y coordinates of each point of the lanelet::BasicPolygon2d type. In this way, I can get the coordinates of each point and convert them into boost::geometry::polygon. Could you please help me test how to obtain the coordinates of the points in an object of the lanelet::BasicPolygon2d type? I've actually tried it myself, but I don't know how to operate it, so I'm coming here to ask for help.
I need to use a vector map to filter the point cloud. Since the map is divided into many segments, the efficiency is a bit low. I want to merge all the small segments into a boost::geometry polygon. However, I've searched through the code but couldn't find any relevant examples, which is really frustrating. My code is as follows. I'm asking for your help. Mainly, please tell me how to obtain the coordinates x and y from road_lanelets[0].polygon2d().basicPolygon() so that I can convert them into the boost::geometry polygon format. Thank you in advance.
Polygon Lanelet2MapFilterComponent::getPolygons(lanelet::ConstLanelets & road_lanelets) { Polygon resultPolygon; lanelet::BasicPolygon2d temp_polygon = road_lanelets[0].polygon2d().basicPolygon(); // TODO: change to boost::geometry::polygon // int size = road_lanelets.size(); // for (int i = 1; i < size; ++i) { // boost::geometry::union_(temp_polygon, road_lanelets[i].polygon2d().basicPolygon(), resultPolygon); // } return resultPolygon; }
The text was updated successfully, but these errors were encountered: