Skip to content

Commit 899ddd1

Browse files
mkqudakarishma1911
authored andcommittedJun 3, 2024
refactor(route_handler): remove unused functions in route_handler (autowarefoundation#7012)
remove unused functions in route_handler
1 parent 86820d6 commit 899ddd1

File tree

2 files changed

+0
-435
lines changed

2 files changed

+0
-435
lines changed
 

‎planning/route_handler/include/route_handler/route_handler.hpp

-77
Original file line numberDiff line numberDiff line change
@@ -205,54 +205,6 @@ class RouteHandler
205205
const lanelet::ConstLanelet & lanelet, const bool enable_same_root = false,
206206
const bool get_shoulder_lane = false) const;
207207

208-
/**
209-
* @brief Searches the furthest linestring to the right side of the lanelet
210-
* Only lanelet with same direction is considered
211-
* @param the lanelet of interest
212-
* @return right most linestring of the lane with same direction
213-
*/
214-
lanelet::ConstLineString3d getRightMostSameDirectionLinestring(
215-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root = false) const noexcept;
216-
217-
/**
218-
* @brief Searches the furthest linestring to the right side of the lanelet
219-
* Used to search for road shoulders. Lane direction is ignored
220-
* @param the lanelet of interest
221-
* @return right most linestring
222-
*/
223-
lanelet::ConstLineString3d getRightMostLinestring(
224-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root = false) const noexcept;
225-
226-
/**
227-
* @brief Searches the furthest linestring to the left side of the lanelet
228-
* Only lanelet with same direction is considered
229-
* @param the lanelet of interest
230-
* @return left most linestring of the lane with same direction
231-
*/
232-
lanelet::ConstLineString3d getLeftMostSameDirectionLinestring(
233-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root = false) const noexcept;
234-
235-
/**
236-
* @brief Searches the furthest linestring to the left side of the lanelet
237-
* Used to search for road shoulders. Lane direction is ignored
238-
* @param the lanelet of interest
239-
* @return left most linestring
240-
*/
241-
lanelet::ConstLineString3d getLeftMostLinestring(
242-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root = false) const noexcept;
243-
244-
/**
245-
* @brief Return furthest linestring on both side of the lanelet
246-
* @param the lanelet of interest
247-
* @param (optional) search furthest right side
248-
* @param (optional) search furthest left side
249-
* @param (optional) include opposite lane as well
250-
* @return right and left linestrings
251-
*/
252-
lanelet::ConstLineStrings3d getFurthestLinestring(
253-
const lanelet::ConstLanelet & lanelet, bool is_right = true, bool is_left = true,
254-
bool is_opposite = true, bool enable_same_root = false) const noexcept;
255-
256208
/**
257209
* Retrieves a sequence of lanelets before the given lanelet.
258210
* The total length of retrieved lanelet sequence at least given length. Returned lanelet sequence
@@ -276,18 +228,6 @@ class RouteHandler
276228
int getNumLaneToPreferredLane(
277229
const lanelet::ConstLanelet & lanelet, const Direction direction = Direction::NONE) const;
278230

279-
/**
280-
* Query input lanelet to see whether it exist in the preferred lane. If it doesn't exist, return
281-
* the distance to the preferred lane from the give lane.
282-
* The total distance is computed from the front point of the centerline of the given lane to
283-
* the front point of the preferred lane.
284-
* @param lanelet lanelet to query
285-
* @param direction change direction
286-
* @return number of lanes from input to the preferred lane
287-
*/
288-
double getTotalLateralDistanceToPreferredLane(
289-
const lanelet::ConstLanelet & lanelet, const Direction direction = Direction::NONE) const;
290-
291231
/**
292232
* Query input lanelet to see whether it exist in the preferred lane. If it doesn't exist, return
293233
* the distance to the preferred lane from the give lane.
@@ -321,11 +261,6 @@ class RouteHandler
321261
const lanelet::ConstLanelet & lanelet, const Pose & pose,
322262
const double backward_distance = std::numeric_limits<double>::max(),
323263
const double forward_distance = std::numeric_limits<double>::max()) const;
324-
lanelet::ConstLanelets getCheckTargetLanesFromPath(
325-
const PathWithLaneId & path, const lanelet::ConstLanelets & target_lanes,
326-
const double check_length) const;
327-
lanelet::routing::RelationType getRelation(
328-
const lanelet::ConstLanelet & prev_lane, const lanelet::ConstLanelet & next_lane) const;
329264
bool isShoulderLanelet(const lanelet::ConstLanelet & lanelet) const;
330265
bool isRouteLanelet(const lanelet::ConstLanelet & lanelet) const;
331266
bool isRoadLanelet(const lanelet::ConstLanelet & lanelet) const;
@@ -339,22 +274,16 @@ class RouteHandler
339274
const lanelet::ConstLanelets & lanelets, const Direction direction = Direction::NONE) const;
340275
std::optional<lanelet::ConstLanelet> getLaneChangeTargetExceptPreferredLane(
341276
const lanelet::ConstLanelets & lanelets, const Direction direction) const;
342-
bool getRightLaneChangeTargetExceptPreferredLane(
343-
const lanelet::ConstLanelets & lanelets, lanelet::ConstLanelet * target_lanelet) const;
344-
bool getLeftLaneChangeTargetExceptPreferredLane(
345-
const lanelet::ConstLanelets & lanelets, lanelet::ConstLanelet * target_lanelet) const;
346277
std::optional<lanelet::ConstLanelet> getPullOverTarget(const Pose & goal_pose) const;
347278
std::optional<lanelet::ConstLanelet> getPullOutStartLane(
348279
const Pose & pose, const double vehicle_width) const;
349-
double getLaneChangeableDistance(const Pose & current_pose, const Direction & direction) const;
350280
lanelet::ConstLanelets getRoadLaneletsAtPose(const Pose & pose) const;
351281
std::optional<lanelet::ConstLanelet> getLeftShoulderLanelet(
352282
const lanelet::ConstLanelet & lanelet) const;
353283
std::optional<lanelet::ConstLanelet> getRightShoulderLanelet(
354284
const lanelet::ConstLanelet & lanelet) const;
355285
lanelet::ConstLanelets getShoulderLaneletsAtPose(const Pose & pose) const;
356286
lanelet::ConstPolygon3d getIntersectionAreaById(const lanelet::Id id) const;
357-
bool isPreferredLane(const lanelet::ConstLanelet & lanelet) const;
358287

359288
private:
360289
// MUST
@@ -385,8 +314,6 @@ class RouteHandler
385314
lanelet::ConstLanelets getMainLanelets(const lanelet::ConstLanelets & path_lanelets) const;
386315

387316
// for lanelet
388-
bool isInTargetLane(const PoseStamped & pose, const lanelet::ConstLanelets & target) const;
389-
bool isInPreferredLane(const PoseStamped & pose) const;
390317
bool isBijectiveConnection(
391318
const lanelet::ConstLanelets & lanelet_section1,
392319
const lanelet::ConstLanelets & lanelet_section2) const;
@@ -419,17 +346,13 @@ class RouteHandler
419346
const double min_length = std::numeric_limits<double>::max()) const;
420347
lanelet::ConstLanelets getPreviousLaneletSequence(
421348
const lanelet::ConstLanelets & lanelet_sequence) const;
422-
lanelet::ConstLanelets getLaneChangeTargetLanes(const Pose & pose) const;
423349
lanelet::ConstLanelets getLaneSequenceUpTo(const lanelet::ConstLanelet & lanelet) const;
424350
lanelet::ConstLanelets getLaneSequenceAfter(const lanelet::ConstLanelet & lanelet) const;
425351
lanelet::ConstLanelets getLaneSequence(const lanelet::ConstLanelet & lanelet) const;
426352
lanelet::ConstLanelets getNeighborsWithinRoute(const lanelet::ConstLanelet & lanelet) const;
427-
std::vector<lanelet::ConstLanelets> getLaneSection(const lanelet::ConstLanelet & lanelet) const;
428-
lanelet::ConstLanelets getNextLaneSequence(const lanelet::ConstLanelets & lane_sequence) const;
429353

430354
// for path
431355

432-
PathWithLaneId updatePathTwist(const PathWithLaneId & path) const;
433356
/**
434357
* @brief Checks if a path has a no_drivable_lane or not
435358
* @param path lanelet path

‎planning/route_handler/src/route_handler.cpp

-358
Original file line numberDiff line numberDiff line change
@@ -1324,98 +1324,6 @@ lanelet::ConstLanelet RouteHandler::getMostLeftLanelet(
13241324
return lanelet;
13251325
}
13261326

1327-
lanelet::ConstLineString3d RouteHandler::getRightMostSameDirectionLinestring(
1328-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root) const noexcept
1329-
{
1330-
// recursively compute the width of the lanes
1331-
const auto & same = getRightLanelet(lanelet, enable_same_root);
1332-
1333-
if (same) {
1334-
return getRightMostSameDirectionLinestring(same.value(), enable_same_root);
1335-
}
1336-
1337-
return lanelet.rightBound();
1338-
}
1339-
1340-
lanelet::ConstLineString3d RouteHandler::getRightMostLinestring(
1341-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root) const noexcept
1342-
{
1343-
const auto & same = getRightLanelet(lanelet, enable_same_root);
1344-
const auto & opposite = getRightOppositeLanelets(lanelet);
1345-
if (!same && opposite.empty()) {
1346-
return lanelet.rightBound();
1347-
}
1348-
1349-
if (same) {
1350-
return getRightMostLinestring(same.value(), enable_same_root);
1351-
}
1352-
1353-
if (!opposite.empty()) {
1354-
return getLeftMostLinestring(lanelet::ConstLanelet(opposite.front()), false);
1355-
}
1356-
1357-
return lanelet.rightBound();
1358-
}
1359-
1360-
lanelet::ConstLineString3d RouteHandler::getLeftMostSameDirectionLinestring(
1361-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root) const noexcept
1362-
{
1363-
// recursively compute the width of the lanes
1364-
const auto & same = getLeftLanelet(lanelet, enable_same_root);
1365-
1366-
if (same) {
1367-
return getLeftMostSameDirectionLinestring(same.value(), enable_same_root);
1368-
}
1369-
1370-
return lanelet.leftBound();
1371-
}
1372-
1373-
lanelet::ConstLineString3d RouteHandler::getLeftMostLinestring(
1374-
const lanelet::ConstLanelet & lanelet, const bool enable_same_root) const noexcept
1375-
{
1376-
// recursively compute the width of the lanes
1377-
const auto & same = getLeftLanelet(lanelet, enable_same_root);
1378-
const auto & opposite = getLeftOppositeLanelets(lanelet);
1379-
if (!same && opposite.empty()) {
1380-
return lanelet.leftBound();
1381-
}
1382-
1383-
if (same) {
1384-
return getLeftMostLinestring(same.value(), enable_same_root);
1385-
}
1386-
1387-
if (!opposite.empty()) {
1388-
return getRightMostLinestring(lanelet::ConstLanelet(opposite.front()), false);
1389-
}
1390-
1391-
return lanelet.leftBound();
1392-
}
1393-
1394-
lanelet::ConstLineStrings3d RouteHandler::getFurthestLinestring(
1395-
const lanelet::ConstLanelet & lanelet, bool is_right, bool is_left, bool is_opposite,
1396-
bool enable_same_root) const noexcept
1397-
{
1398-
lanelet::ConstLineStrings3d linestrings;
1399-
linestrings.reserve(2);
1400-
1401-
if (is_right && is_opposite) {
1402-
linestrings.emplace_back(getRightMostLinestring(lanelet, enable_same_root));
1403-
} else if (is_right && !is_opposite) {
1404-
linestrings.emplace_back(getRightMostSameDirectionLinestring(lanelet, enable_same_root));
1405-
} else {
1406-
linestrings.emplace_back(lanelet.rightBound());
1407-
}
1408-
1409-
if (is_left && is_opposite) {
1410-
linestrings.emplace_back(getLeftMostLinestring(lanelet, enable_same_root));
1411-
} else if (is_left && !is_opposite) {
1412-
linestrings.emplace_back(getLeftMostSameDirectionLinestring(lanelet, enable_same_root));
1413-
} else {
1414-
linestrings.emplace_back(lanelet.leftBound());
1415-
}
1416-
return linestrings;
1417-
}
1418-
14191327
std::vector<lanelet::ConstLanelets> RouteHandler::getPrecedingLaneletSequence(
14201328
const lanelet::ConstLanelet & lanelet, const double length,
14211329
const lanelet::ConstLanelets & exclude_lanelets) const
@@ -1486,46 +1394,6 @@ std::optional<lanelet::ConstLanelet> RouteHandler::getLaneChangeTargetExceptPref
14861394
return std::nullopt;
14871395
}
14881396

1489-
bool RouteHandler::getRightLaneChangeTargetExceptPreferredLane(
1490-
const lanelet::ConstLanelets & lanelets, lanelet::ConstLanelet * target_lanelet) const
1491-
{
1492-
for (const auto & lanelet : lanelets) {
1493-
const int num = getNumLaneToPreferredLane(lanelet);
1494-
1495-
// Get right lanelet if preferred lane is on the left
1496-
if (num >= 0) {
1497-
if (!!routing_graph_ptr_->right(lanelet)) {
1498-
const auto right_lanelet = routing_graph_ptr_->right(lanelet);
1499-
*target_lanelet = right_lanelet.value();
1500-
return true;
1501-
}
1502-
}
1503-
}
1504-
1505-
*target_lanelet = lanelets.front();
1506-
return false;
1507-
}
1508-
1509-
bool RouteHandler::getLeftLaneChangeTargetExceptPreferredLane(
1510-
const lanelet::ConstLanelets & lanelets, lanelet::ConstLanelet * target_lanelet) const
1511-
{
1512-
for (const auto & lanelet : lanelets) {
1513-
const int num = getNumLaneToPreferredLane(lanelet);
1514-
1515-
// Get left lanelet if preferred lane is on the right
1516-
if (num <= 0) {
1517-
if (!!routing_graph_ptr_->left(lanelet)) {
1518-
const auto left_lanelet = routing_graph_ptr_->left(lanelet);
1519-
*target_lanelet = left_lanelet.value();
1520-
return true;
1521-
}
1522-
}
1523-
}
1524-
1525-
*target_lanelet = lanelets.front();
1526-
return false;
1527-
}
1528-
15291397
std::optional<lanelet::ConstLanelet> RouteHandler::getPullOverTarget(const Pose & goal_pose) const
15301398
{
15311399
const lanelet::BasicPoint2d p(goal_pose.position.x, goal_pose.position.y);
@@ -1589,13 +1457,6 @@ int RouteHandler::getNumLaneToPreferredLane(
15891457
return 0; // TODO(Horibe) check if return 0 is appropriate.
15901458
}
15911459

1592-
double RouteHandler::getTotalLateralDistanceToPreferredLane(
1593-
const lanelet::ConstLanelet & lanelet, const Direction direction) const
1594-
{
1595-
const auto intervals = getLateralIntervalsToPreferredLane(lanelet, direction);
1596-
return std::accumulate(intervals.begin(), intervals.end(), 0);
1597-
}
1598-
15991460
std::vector<double> RouteHandler::getLateralIntervalsToPreferredLane(
16001461
const lanelet::ConstLanelet & lanelet, const Direction direction) const
16011462
{
@@ -1650,30 +1511,6 @@ std::vector<double> RouteHandler::getLateralIntervalsToPreferredLane(
16501511
return {};
16511512
}
16521513

1653-
bool RouteHandler::isPreferredLane(const lanelet::ConstLanelet & lanelet) const
1654-
{
1655-
return exists(preferred_lanelets_, lanelet);
1656-
}
1657-
1658-
bool RouteHandler::isInPreferredLane(const PoseStamped & pose) const
1659-
{
1660-
lanelet::ConstLanelet lanelet;
1661-
if (!getClosestLaneletWithinRoute(pose.pose, &lanelet)) {
1662-
return false;
1663-
}
1664-
return exists(preferred_lanelets_, lanelet);
1665-
}
1666-
1667-
bool RouteHandler::isInTargetLane(
1668-
const PoseStamped & pose, const lanelet::ConstLanelets & target) const
1669-
{
1670-
lanelet::ConstLanelet lanelet;
1671-
if (!getClosestLaneletWithinRoute(pose.pose, &lanelet)) {
1672-
return false;
1673-
}
1674-
return exists(target, lanelet);
1675-
}
1676-
16771514
PathWithLaneId RouteHandler::getCenterLinePath(
16781515
const lanelet::ConstLanelets & lanelet_sequence, const double s_start, const double s_end,
16791516
bool use_exact) const
@@ -1749,139 +1586,6 @@ PathWithLaneId RouteHandler::getCenterLinePath(
17491586
return reference_path;
17501587
}
17511588

1752-
PathWithLaneId RouteHandler::updatePathTwist(const PathWithLaneId & path) const
1753-
{
1754-
PathWithLaneId updated_path = path;
1755-
for (auto & point : updated_path.points) {
1756-
const auto id = point.lane_ids.at(0);
1757-
const auto llt = lanelet_map_ptr_->laneletLayer.get(id);
1758-
const auto limit = traffic_rules_ptr_->speedLimit(llt);
1759-
point.point.longitudinal_velocity_mps = static_cast<float>(limit.speedLimit.value());
1760-
}
1761-
return updated_path;
1762-
}
1763-
1764-
lanelet::ConstLanelets RouteHandler::getLaneChangeTargetLanes(const Pose & pose) const
1765-
{
1766-
lanelet::ConstLanelet lanelet;
1767-
lanelet::ConstLanelets target_lanelets;
1768-
if (!getClosestLaneletWithinRoute(pose, &lanelet)) {
1769-
return target_lanelets;
1770-
}
1771-
1772-
const int num = getNumLaneToPreferredLane(lanelet);
1773-
if (num < 0) {
1774-
const auto right_lanelet = (!!routing_graph_ptr_->right(lanelet))
1775-
? routing_graph_ptr_->right(lanelet)
1776-
: routing_graph_ptr_->adjacentRight(lanelet);
1777-
target_lanelets = getLaneletSequence(right_lanelet.value());
1778-
}
1779-
if (num > 0) {
1780-
const auto left_lanelet = (!!routing_graph_ptr_->left(lanelet))
1781-
? routing_graph_ptr_->left(lanelet)
1782-
: routing_graph_ptr_->adjacentLeft(lanelet);
1783-
target_lanelets = getLaneletSequence(left_lanelet.value());
1784-
}
1785-
return target_lanelets;
1786-
}
1787-
1788-
double RouteHandler::getLaneChangeableDistance(
1789-
const Pose & current_pose, const Direction & direction) const
1790-
{
1791-
lanelet::ConstLanelet current_lane;
1792-
if (!getClosestLaneletWithinRoute(current_pose, &current_lane)) {
1793-
return 0;
1794-
}
1795-
1796-
// get lanelets after current lane
1797-
auto lanelet_sequence = getLaneletSequenceAfter(current_lane);
1798-
lanelet_sequence.insert(lanelet_sequence.begin(), current_lane);
1799-
1800-
double accumulated_distance = 0;
1801-
for (const auto & lane : lanelet_sequence) {
1802-
lanelet::ConstLanelet target_lane;
1803-
if (direction == Direction::RIGHT) {
1804-
if (!getRightLaneletWithinRoute(lane, &target_lane)) {
1805-
break;
1806-
}
1807-
}
1808-
if (direction == Direction::LEFT) {
1809-
if (!getLeftLaneletWithinRoute(lane, &target_lane)) {
1810-
break;
1811-
}
1812-
}
1813-
double lane_length = lanelet::utils::getLaneletLength3d(lane);
1814-
1815-
// overwrite goal because lane change must be finished before reaching goal
1816-
if (isInGoalRouteSection(lane)) {
1817-
const auto goal_position = lanelet::utils::conversion::toLaneletPoint(getGoalPose().position);
1818-
const auto goal_arc_coordinates = lanelet::geometry::toArcCoordinates(
1819-
lanelet::utils::to2D(lane.centerline()), lanelet::utils::to2D(goal_position).basicPoint());
1820-
lane_length = std::min(goal_arc_coordinates.length, lane_length);
1821-
}
1822-
1823-
// subtract distance up to current position for first lane
1824-
if (lane == current_lane) {
1825-
const auto current_position =
1826-
lanelet::utils::conversion::toLaneletPoint(current_pose.position);
1827-
const auto arc_coordinate = lanelet::geometry::toArcCoordinates(
1828-
lanelet::utils::to2D(lane.centerline()),
1829-
lanelet::utils::to2D(current_position).basicPoint());
1830-
lane_length = std::max(lane_length - arc_coordinate.length, 0.0);
1831-
}
1832-
accumulated_distance += lane_length;
1833-
}
1834-
return accumulated_distance;
1835-
}
1836-
1837-
lanelet::ConstLanelets RouteHandler::getCheckTargetLanesFromPath(
1838-
const PathWithLaneId & path, const lanelet::ConstLanelets & target_lanes,
1839-
const double check_length) const
1840-
{
1841-
std::vector<int64_t> target_lane_ids;
1842-
target_lane_ids.reserve(target_lanes.size());
1843-
for (const auto & llt : target_lanes) {
1844-
target_lane_ids.push_back(llt.id());
1845-
}
1846-
1847-
// find first lanelet in target lanes along path
1848-
int64_t root_lane_id = lanelet::InvalId;
1849-
for (const auto & point : path.points) {
1850-
for (const auto & lane_id : point.lane_ids) {
1851-
if (exists(target_lane_ids, lane_id)) {
1852-
root_lane_id = lane_id;
1853-
}
1854-
}
1855-
}
1856-
// return emtpy lane if failed to find root lane_id
1857-
if (root_lane_id == lanelet::InvalId) {
1858-
return target_lanes;
1859-
}
1860-
lanelet::ConstLanelet root_lanelet;
1861-
for (const auto & llt : target_lanes) {
1862-
if (llt.id() == root_lane_id) {
1863-
root_lanelet = llt;
1864-
}
1865-
}
1866-
1867-
const auto sequences = lanelet::utils::query::getPrecedingLaneletSequences(
1868-
routing_graph_ptr_, root_lanelet, check_length);
1869-
lanelet::ConstLanelets check_lanelets;
1870-
for (const auto & sequence : sequences) {
1871-
for (const auto & llt : sequence) {
1872-
if (!lanelet::utils::contains(check_lanelets, llt)) {
1873-
check_lanelets.push_back(llt);
1874-
}
1875-
}
1876-
}
1877-
for (const auto & llt : target_lanes) {
1878-
if (!lanelet::utils::contains(check_lanelets, llt)) {
1879-
check_lanelets.push_back(llt);
1880-
}
1881-
}
1882-
return check_lanelets;
1883-
}
1884-
18851589
bool RouteHandler::isMapMsgReady() const
18861590
{
18871591
return is_map_msg_ready_;
@@ -1908,41 +1612,6 @@ lanelet::LaneletMapPtr RouteHandler::getLaneletMapPtr() const
19081612
return lanelet_map_ptr_;
19091613
}
19101614

1911-
lanelet::routing::RelationType RouteHandler::getRelation(
1912-
const lanelet::ConstLanelet & prev_lane, const lanelet::ConstLanelet & next_lane) const
1913-
{
1914-
if (prev_lane == next_lane) {
1915-
return lanelet::routing::RelationType::None;
1916-
}
1917-
const auto & relation = routing_graph_ptr_->routingRelation(prev_lane, next_lane);
1918-
if (relation) {
1919-
return relation.value();
1920-
}
1921-
1922-
// check if lane change extends across multiple lanes
1923-
const auto shortest_path = routing_graph_ptr_->shortestPath(prev_lane, next_lane);
1924-
if (shortest_path) {
1925-
auto prev_llt = shortest_path->front();
1926-
for (const auto & llt : shortest_path.value()) {
1927-
if (prev_llt == llt) {
1928-
continue;
1929-
}
1930-
const auto & relation = routing_graph_ptr_->routingRelation(prev_llt, llt);
1931-
if (!relation) {
1932-
continue;
1933-
}
1934-
if (
1935-
relation.value() == lanelet::routing::RelationType::Left ||
1936-
relation.value() == lanelet::routing::RelationType::Right) {
1937-
return relation.value();
1938-
}
1939-
prev_llt = llt;
1940-
}
1941-
}
1942-
1943-
return lanelet::routing::RelationType::None;
1944-
}
1945-
19461615
bool RouteHandler::isShoulderLanelet(const lanelet::ConstLanelet & lanelet) const
19471616
{
19481617
return lanelet.hasAttribute(lanelet::AttributeName::Subtype) &&
@@ -2100,33 +1769,6 @@ lanelet::ConstLanelets RouteHandler::getNeighborsWithinRoute(
21001769
return neighbors_within_route;
21011770
}
21021771

2103-
std::vector<lanelet::ConstLanelets> RouteHandler::getLaneSection(
2104-
const lanelet::ConstLanelet & lanelet) const
2105-
{
2106-
const lanelet::ConstLanelets neighbors = getNeighborsWithinRoute(lanelet);
2107-
std::vector<lanelet::ConstLanelets> lane_section;
2108-
lane_section.reserve(neighbors.size());
2109-
for (const auto & llt : neighbors) {
2110-
lane_section.push_back(getLaneSequence(llt));
2111-
}
2112-
return lane_section;
2113-
}
2114-
2115-
lanelet::ConstLanelets RouteHandler::getNextLaneSequence(
2116-
const lanelet::ConstLanelets & lane_sequence) const
2117-
{
2118-
lanelet::ConstLanelets next_lane_sequence;
2119-
if (lane_sequence.empty()) {
2120-
return next_lane_sequence;
2121-
}
2122-
const auto & final_lanelet = lane_sequence.back();
2123-
lanelet::ConstLanelet next_lanelet;
2124-
if (!getNextLaneletWithinRoute(final_lanelet, &next_lanelet)) {
2125-
return next_lane_sequence;
2126-
}
2127-
return getLaneSequence(next_lanelet);
2128-
}
2129-
21301772
bool RouteHandler::planPathLaneletsBetweenCheckpoints(
21311773
const Pose & start_checkpoint, const Pose & goal_checkpoint,
21321774
lanelet::ConstLanelets * path_lanelets, const bool consider_no_drivable_lanes) const

0 commit comments

Comments
 (0)
Please sign in to comment.