remove usage of use-lane completely
This commit is contained in:
parent
7b755d6f8b
commit
f2f00b99e0
@ -174,15 +174,17 @@ module.exports = function () {
|
|||||||
this.lanesList = (instructions) => {
|
this.lanesList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => {
|
return this.extractInstructionList(instructions, s => {
|
||||||
return s.intersections.map( i => {
|
return s.intersections.map( i => {
|
||||||
if(i.lanes == undefined )
|
if(i.lanes)
|
||||||
return '';
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return i.lanes.map( l => {
|
return i.lanes.map( l => {
|
||||||
let indications = l.indications.join(';');
|
let indications = l.indications.join(';');
|
||||||
return indications + ':' + (l.valid ? 'true' : 'false');
|
return indications + ':' + (l.valid ? 'true' : 'false');
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}).join(';');
|
}).join(';');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,7 @@ const constexpr Enum EnterRotary = 12; // Enter a rotary
|
|||||||
const constexpr Enum EnterAndExitRotary = 13; // Touching a rotary
|
const constexpr Enum EnterAndExitRotary = 13; // Touching a rotary
|
||||||
const constexpr Enum EnterRoundaboutIntersection = 14; // Entering a small Roundabout
|
const constexpr Enum EnterRoundaboutIntersection = 14; // Entering a small Roundabout
|
||||||
const constexpr Enum EnterAndExitRoundaboutIntersection = 15; // Touching a roundabout
|
const constexpr Enum EnterAndExitRoundaboutIntersection = 15; // Touching a roundabout
|
||||||
const constexpr Enum UseLane = 16; // No Turn, but you need to stay on a given lane!
|
// depreacted: const constexpr Enum UseLane = 16; // No Turn, but you need to stay on a given lane!
|
||||||
|
|
||||||
// Values below here are silent instructions
|
// Values below here are silent instructions
|
||||||
const constexpr Enum NoTurn = 17; // end of segment without turn/middle of a segment
|
const constexpr Enum NoTurn = 17; // end of segment without turn/middle of a segment
|
||||||
@ -207,9 +207,7 @@ inline bool isSilent(const extractor::guidance::TurnInstruction instruction)
|
|||||||
{
|
{
|
||||||
return instruction.type == extractor::guidance::TurnType::NoTurn ||
|
return instruction.type == extractor::guidance::TurnType::NoTurn ||
|
||||||
instruction.type == extractor::guidance::TurnType::Suppressed ||
|
instruction.type == extractor::guidance::TurnType::Suppressed ||
|
||||||
instruction.type == extractor::guidance::TurnType::StayOnRoundabout ||
|
instruction.type == extractor::guidance::TurnType::StayOnRoundabout;
|
||||||
// it is enough to output them within the intersections array
|
|
||||||
instruction.type == extractor::guidance::TurnType::UseLane;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool hasRampType(const extractor::guidance::TurnInstruction instruction)
|
inline bool hasRampType(const extractor::guidance::TurnInstruction instruction)
|
||||||
|
@ -24,7 +24,6 @@ struct TurnLaneData
|
|||||||
// a temporary data entry that does not need to be assigned to an entry.
|
// a temporary data entry that does not need to be assigned to an entry.
|
||||||
// This is the case in situations that use partition and require the entry to perform the
|
// This is the case in situations that use partition and require the entry to perform the
|
||||||
// one-to-one mapping.
|
// one-to-one mapping.
|
||||||
bool suppress_assignment;
|
|
||||||
bool operator<(const TurnLaneData &other) const;
|
bool operator<(const TurnLaneData &other) const;
|
||||||
};
|
};
|
||||||
typedef std::vector<TurnLaneData> LaneDataVector;
|
typedef std::vector<TurnLaneData> LaneDataVector;
|
||||||
|
@ -90,9 +90,7 @@ inline void print(const extractor::guidance::lanes::LaneDataVector &turn_lane_da
|
|||||||
std::cout << "\t" << entry.tag << "("
|
std::cout << "\t" << entry.tag << "("
|
||||||
<< extractor::guidance::TurnLaneType::toString(entry.tag)
|
<< extractor::guidance::TurnLaneType::toString(entry.tag)
|
||||||
<< ") from: " << static_cast<int>(entry.from)
|
<< ") from: " << static_cast<int>(entry.from)
|
||||||
<< " to: " << static_cast<int>(entry.to)
|
<< " to: " << static_cast<int>(entry.to) << "\n";
|
||||||
<< " Can Be Suppresssed: " << (entry.suppress_assignment ? "true" : "false")
|
|
||||||
<< "\n";
|
|
||||||
std::cout << std::flush;
|
std::cout << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
|||||||
|
|
||||||
// only prevent use lanes due to making all turns. don't make turns during curvy
|
// only prevent use lanes due to making all turns. don't make turns during curvy
|
||||||
// segments
|
// segments
|
||||||
if (previous_inst.type == TurnType::UseLane)
|
if (previous_inst.type == TurnType::Suppressed)
|
||||||
time_to_constrained += previous.duration;
|
time_to_constrained += previous.duration;
|
||||||
else
|
else
|
||||||
time_to_constrained = 0;
|
time_to_constrained = 0;
|
||||||
@ -193,8 +193,9 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
|||||||
anticipate_for_right_turn();
|
anticipate_for_right_turn();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previous_inst.type == TurnType::UseLane && current_inst.type == TurnType::UseLane &&
|
if (previous_inst.type == TurnType::Suppressed &&
|
||||||
previous.mode == current.mode && previous_lanes == current_lanes)
|
current_inst.type == TurnType::Suppressed && previous.mode == current.mode &&
|
||||||
|
previous_lanes == current_lanes)
|
||||||
{
|
{
|
||||||
previous.ElongateBy(current);
|
previous.ElongateBy(current);
|
||||||
current.Invalidate();
|
current.Invalidate();
|
||||||
|
@ -133,8 +133,7 @@ void closeOffRoundabout(const bool on_roundabout,
|
|||||||
BOOST_ASSERT(leavesRoundabout(steps[1].maneuver.instruction) ||
|
BOOST_ASSERT(leavesRoundabout(steps[1].maneuver.instruction) ||
|
||||||
steps[1].maneuver.instruction.type == TurnType::StayOnRoundabout ||
|
steps[1].maneuver.instruction.type == TurnType::StayOnRoundabout ||
|
||||||
steps[1].maneuver.instruction.type == TurnType::Suppressed ||
|
steps[1].maneuver.instruction.type == TurnType::Suppressed ||
|
||||||
steps[1].maneuver.instruction.type == TurnType::NoTurn ||
|
steps[1].maneuver.instruction.type == TurnType::NoTurn);
|
||||||
steps[1].maneuver.instruction.type == TurnType::UseLane);
|
|
||||||
steps[0].geometry_end = 1;
|
steps[0].geometry_end = 1;
|
||||||
steps[1].geometry_begin = 0;
|
steps[1].geometry_begin = 0;
|
||||||
steps[1].AddInFront(steps[0]);
|
steps[1].AddInFront(steps[0]);
|
||||||
@ -608,7 +607,7 @@ std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps)
|
|||||||
{
|
{
|
||||||
auto &step = steps[step_index];
|
auto &step = steps[step_index];
|
||||||
const auto instruction = step.maneuver.instruction;
|
const auto instruction = step.maneuver.instruction;
|
||||||
if (instruction.type == TurnType::Suppressed || instruction.type == TurnType::UseLane)
|
if (instruction.type == TurnType::Suppressed)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(steps[last_valid_instruction].mode == step.mode);
|
BOOST_ASSERT(steps[last_valid_instruction].mode == step.mode);
|
||||||
// count intersections. We cannot use exit, since intersections can follow directly
|
// count intersections. We cannot use exit, since intersections can follow directly
|
||||||
|
@ -129,19 +129,16 @@ LaneDataVector augmentMultiple(const std::size_t none_index,
|
|||||||
{
|
{
|
||||||
lane_data.push_back({tag_by_modifier[itr->instruction.direction_modifier],
|
lane_data.push_back({tag_by_modifier[itr->instruction.direction_modifier],
|
||||||
lane_data[none_index].from,
|
lane_data[none_index].from,
|
||||||
lane_data[none_index].from,
|
lane_data[none_index].from});
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
lane_data.push_back({tag_by_modifier[straight_itr->instruction.direction_modifier],
|
lane_data.push_back({tag_by_modifier[straight_itr->instruction.direction_modifier],
|
||||||
lane_data[none_index].from,
|
lane_data[none_index].from,
|
||||||
lane_data[none_index].to,
|
lane_data[none_index].to});
|
||||||
false});
|
|
||||||
for (auto itr = straight_itr + 1; itr != intersection_range_end; ++itr)
|
for (auto itr = straight_itr + 1; itr != intersection_range_end; ++itr)
|
||||||
{
|
{
|
||||||
lane_data.push_back({tag_by_modifier[itr->instruction.direction_modifier],
|
lane_data.push_back({tag_by_modifier[itr->instruction.direction_modifier],
|
||||||
lane_data[none_index].to,
|
lane_data[none_index].to,
|
||||||
lane_data[none_index].to,
|
lane_data[none_index].to});
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lane_data.erase(lane_data.begin() + none_index);
|
lane_data.erase(lane_data.begin() + none_index);
|
||||||
@ -158,8 +155,7 @@ LaneDataVector augmentMultiple(const std::size_t none_index,
|
|||||||
lane_data.push_back({tag_by_modifier[intersection[intersection_index]
|
lane_data.push_back({tag_by_modifier[intersection[intersection_index]
|
||||||
.instruction.direction_modifier],
|
.instruction.direction_modifier],
|
||||||
lane_data[none_index].from,
|
lane_data[none_index].from,
|
||||||
lane_data[none_index].to,
|
lane_data[none_index].to});
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lane_data.erase(lane_data.begin() + none_index);
|
lane_data.erase(lane_data.begin() + none_index);
|
||||||
|
@ -107,7 +107,7 @@ LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description
|
|||||||
LaneDataVector lane_data;
|
LaneDataVector lane_data;
|
||||||
lane_data.reserve(lane_map.size());
|
lane_data.reserve(lane_map.size());
|
||||||
for (const auto &tag : lane_map)
|
for (const auto &tag : lane_map)
|
||||||
lane_data.push_back({tag.first, tag.second.first, tag.second.second, false});
|
lane_data.push_back({tag.first, tag.second.first, tag.second.second});
|
||||||
|
|
||||||
std::sort(lane_data.begin(), lane_data.end());
|
std::sort(lane_data.begin(), lane_data.end());
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ TurnLaneScenario TurnLaneHandler::deduceScenario(const NodeID at,
|
|||||||
// FIXME the lane to add depends on the side of driving/u-turn rules in the country
|
// FIXME the lane to add depends on the side of driving/u-turn rules in the country
|
||||||
if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) &&
|
if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) &&
|
||||||
is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
|
is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
|
||||||
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to, false});
|
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to});
|
||||||
|
|
||||||
bool is_simple = isSimpleIntersection(lane_data, intersection);
|
bool is_simple = isSimpleIntersection(lane_data, intersection);
|
||||||
|
|
||||||
@ -644,8 +644,6 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
|
|||||||
if (lane == straightmost_tag_index)
|
if (lane == straightmost_tag_index)
|
||||||
{
|
{
|
||||||
augmentEntry(turn_lane_data[straightmost_tag_index]);
|
augmentEntry(turn_lane_data[straightmost_tag_index]);
|
||||||
// disable this turn for assignment if it is a -use lane only
|
|
||||||
turn_lane_data[straightmost_tag_index].suppress_assignment = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched_at_first[lane])
|
if (matched_at_first[lane])
|
||||||
@ -657,7 +655,7 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
|
|||||||
std::count(matched_at_second.begin(), matched_at_second.end(), true)) ==
|
std::count(matched_at_second.begin(), matched_at_second.end(), true)) ==
|
||||||
getNumberOfTurns(next_intersection))
|
getNumberOfTurns(next_intersection))
|
||||||
{
|
{
|
||||||
TurnLaneData data = {TurnLaneType::straight, 255, 0, true};
|
TurnLaneData data = {TurnLaneType::straight, 255, 0};
|
||||||
augmentEntry(data);
|
augmentEntry(data);
|
||||||
first.push_back(data);
|
first.push_back(data);
|
||||||
std::sort(first.begin(), first.end());
|
std::sort(first.begin(), first.end());
|
||||||
|
@ -87,7 +87,7 @@ bool isValidMatch(const TurnLaneType::Mask tag, const TurnInstruction instructio
|
|||||||
TurnType::Continue && // Forks can be experienced, even for straight segments
|
TurnType::Continue && // Forks can be experienced, even for straight segments
|
||||||
(instruction.direction_modifier == DirectionModifier::SlightLeft ||
|
(instruction.direction_modifier == DirectionModifier::SlightLeft ||
|
||||||
instruction.direction_modifier == DirectionModifier::SlightRight)) ||
|
instruction.direction_modifier == DirectionModifier::SlightRight)) ||
|
||||||
instruction.type == TurnType::UseLane;
|
instruction.type == TurnType::Suppressed;
|
||||||
}
|
}
|
||||||
else if (tag == TurnLaneType::slight_left || tag == TurnLaneType::left ||
|
else if (tag == TurnLaneType::slight_left || tag == TurnLaneType::left ||
|
||||||
tag == TurnLaneType::sharp_left)
|
tag == TurnLaneType::sharp_left)
|
||||||
@ -250,10 +250,6 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
|
|||||||
BOOST_ASSERT(findBestMatch(lane_data[lane].tag, intersection) ==
|
BOOST_ASSERT(findBestMatch(lane_data[lane].tag, intersection) ==
|
||||||
intersection.begin() + road_index);
|
intersection.begin() + road_index);
|
||||||
|
|
||||||
if (TurnType::Suppressed == intersection[road_index].instruction.type &&
|
|
||||||
!lane_data[lane].suppress_assignment)
|
|
||||||
intersection[road_index].instruction.type = TurnType::UseLane;
|
|
||||||
|
|
||||||
matchRoad(intersection[road_index], lane_data[lane]);
|
matchRoad(intersection[road_index], lane_data[lane]);
|
||||||
++lane;
|
++lane;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
|
|||||||
"enter_and_exit_roundabout_intersection",
|
"enter_and_exit_roundabout_intersection",
|
||||||
extractor::guidance::TurnType::EnterAndExitRoundaboutIntersection,
|
extractor::guidance::TurnType::EnterAndExitRoundaboutIntersection,
|
||||||
"use_lane",
|
"use_lane",
|
||||||
extractor::guidance::TurnType::UseLane,
|
extractor::guidance::TurnType::Suppressed,
|
||||||
"no_turn",
|
"no_turn",
|
||||||
extractor::guidance::TurnType::NoTurn,
|
extractor::guidance::TurnType::NoTurn,
|
||||||
"suppressed",
|
"suppressed",
|
||||||
|
Loading…
Reference in New Issue
Block a user