diff --git a/features/support/route.js b/features/support/route.js index 91dc35359..10178a31a 100644 --- a/features/support/route.js +++ b/features/support/route.js @@ -174,15 +174,17 @@ module.exports = function () { this.lanesList = (instructions) => { return this.extractInstructionList(instructions, s => { return s.intersections.map( i => { - if(i.lanes == undefined ) - return ''; - else + if(i.lanes) { return i.lanes.map( l => { let indications = l.indications.join(';'); return indications + ':' + (l.valid ? 'true' : 'false'); }).join(' '); } + else + { + return ''; + } }).join(';'); }); }; diff --git a/include/extractor/guidance/turn_instruction.hpp b/include/extractor/guidance/turn_instruction.hpp index a14034058..10032e46e 100644 --- a/include/extractor/guidance/turn_instruction.hpp +++ b/include/extractor/guidance/turn_instruction.hpp @@ -49,7 +49,7 @@ const constexpr Enum EnterRotary = 12; // Enter a rotary const constexpr Enum EnterAndExitRotary = 13; // Touching a rotary const constexpr Enum EnterRoundaboutIntersection = 14; // Entering a small 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 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 || instruction.type == extractor::guidance::TurnType::Suppressed || - instruction.type == extractor::guidance::TurnType::StayOnRoundabout || - // it is enough to output them within the intersections array - instruction.type == extractor::guidance::TurnType::UseLane; + instruction.type == extractor::guidance::TurnType::StayOnRoundabout; } inline bool hasRampType(const extractor::guidance::TurnInstruction instruction) diff --git a/include/extractor/guidance/turn_lane_data.hpp b/include/extractor/guidance/turn_lane_data.hpp index e13a0d840..01f68a73b 100644 --- a/include/extractor/guidance/turn_lane_data.hpp +++ b/include/extractor/guidance/turn_lane_data.hpp @@ -24,7 +24,6 @@ struct TurnLaneData // 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 // one-to-one mapping. - bool suppress_assignment; bool operator<(const TurnLaneData &other) const; }; typedef std::vector LaneDataVector; diff --git a/include/util/debug.hpp b/include/util/debug.hpp index a50f7688c..36486153a 100644 --- a/include/util/debug.hpp +++ b/include/util/debug.hpp @@ -90,9 +90,7 @@ inline void print(const extractor::guidance::lanes::LaneDataVector &turn_lane_da std::cout << "\t" << entry.tag << "(" << extractor::guidance::TurnLaneType::toString(entry.tag) << ") from: " << static_cast(entry.from) - << " to: " << static_cast(entry.to) - << " Can Be Suppresssed: " << (entry.suppress_assignment ? "true" : "false") - << "\n"; + << " to: " << static_cast(entry.to) << "\n"; std::cout << std::flush; } diff --git a/src/engine/guidance/lane_processing.cpp b/src/engine/guidance/lane_processing.cpp index eb8ef91fc..dff1bba1d 100644 --- a/src/engine/guidance/lane_processing.cpp +++ b/src/engine/guidance/lane_processing.cpp @@ -96,7 +96,7 @@ std::vector anticipateLaneChange(std::vector steps, // only prevent use lanes due to making all turns. don't make turns during curvy // segments - if (previous_inst.type == TurnType::UseLane) + if (previous_inst.type == TurnType::Suppressed) time_to_constrained += previous.duration; else time_to_constrained = 0; @@ -193,8 +193,9 @@ std::vector anticipateLaneChange(std::vector steps, anticipate_for_right_turn(); } - if (previous_inst.type == TurnType::UseLane && current_inst.type == TurnType::UseLane && - previous.mode == current.mode && previous_lanes == current_lanes) + if (previous_inst.type == TurnType::Suppressed && + current_inst.type == TurnType::Suppressed && previous.mode == current.mode && + previous_lanes == current_lanes) { previous.ElongateBy(current); current.Invalidate(); diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp index c4f10f4fd..38cc02031 100644 --- a/src/engine/guidance/post_processing.cpp +++ b/src/engine/guidance/post_processing.cpp @@ -133,8 +133,7 @@ void closeOffRoundabout(const bool on_roundabout, BOOST_ASSERT(leavesRoundabout(steps[1].maneuver.instruction) || steps[1].maneuver.instruction.type == TurnType::StayOnRoundabout || steps[1].maneuver.instruction.type == TurnType::Suppressed || - steps[1].maneuver.instruction.type == TurnType::NoTurn || - steps[1].maneuver.instruction.type == TurnType::UseLane); + steps[1].maneuver.instruction.type == TurnType::NoTurn); steps[0].geometry_end = 1; steps[1].geometry_begin = 0; steps[1].AddInFront(steps[0]); @@ -608,7 +607,7 @@ std::vector buildIntersections(std::vector steps) { auto &step = steps[step_index]; 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); // count intersections. We cannot use exit, since intersections can follow directly diff --git a/src/extractor/guidance/turn_lane_augmentation.cpp b/src/extractor/guidance/turn_lane_augmentation.cpp index 4e5c7efd0..f31cf91ff 100644 --- a/src/extractor/guidance/turn_lane_augmentation.cpp +++ b/src/extractor/guidance/turn_lane_augmentation.cpp @@ -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[none_index].from, - lane_data[none_index].from, - false}); + lane_data[none_index].from}); } lane_data.push_back({tag_by_modifier[straight_itr->instruction.direction_modifier], lane_data[none_index].from, - lane_data[none_index].to, - false}); + lane_data[none_index].to}); for (auto itr = straight_itr + 1; itr != intersection_range_end; ++itr) { lane_data.push_back({tag_by_modifier[itr->instruction.direction_modifier], lane_data[none_index].to, - lane_data[none_index].to, - false}); + lane_data[none_index].to}); } 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] .instruction.direction_modifier], lane_data[none_index].from, - lane_data[none_index].to, - false}); + lane_data[none_index].to}); } } lane_data.erase(lane_data.begin() + none_index); diff --git a/src/extractor/guidance/turn_lane_data.cpp b/src/extractor/guidance/turn_lane_data.cpp index 18c27e223..0b94bcbc1 100644 --- a/src/extractor/guidance/turn_lane_data.cpp +++ b/src/extractor/guidance/turn_lane_data.cpp @@ -107,7 +107,7 @@ LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description LaneDataVector lane_data; lane_data.reserve(lane_map.size()); 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()); diff --git a/src/extractor/guidance/turn_lane_handler.cpp b/src/extractor/guidance/turn_lane_handler.cpp index 128e47354..5a74d0318 100644 --- a/src/extractor/guidance/turn_lane_handler.cpp +++ b/src/extractor/guidance/turn_lane_handler.cpp @@ -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 if (!lane_data.empty() && canMatchTrivially(intersection, 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); @@ -644,8 +644,6 @@ std::pair TurnLaneHandler::partitionLaneData( if (lane == 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]) @@ -657,7 +655,7 @@ std::pair TurnLaneHandler::partitionLaneData( std::count(matched_at_second.begin(), matched_at_second.end(), true)) == getNumberOfTurns(next_intersection)) { - TurnLaneData data = {TurnLaneType::straight, 255, 0, true}; + TurnLaneData data = {TurnLaneType::straight, 255, 0}; augmentEntry(data); first.push_back(data); std::sort(first.begin(), first.end()); diff --git a/src/extractor/guidance/turn_lane_matcher.cpp b/src/extractor/guidance/turn_lane_matcher.cpp index e66f46b33..311658b42 100644 --- a/src/extractor/guidance/turn_lane_matcher.cpp +++ b/src/extractor/guidance/turn_lane_matcher.cpp @@ -87,7 +87,7 @@ bool isValidMatch(const TurnLaneType::Mask tag, const TurnInstruction instructio TurnType::Continue && // Forks can be experienced, even for straight segments (instruction.direction_modifier == DirectionModifier::SlightLeft || instruction.direction_modifier == DirectionModifier::SlightRight)) || - instruction.type == TurnType::UseLane; + instruction.type == TurnType::Suppressed; } else if (tag == TurnLaneType::slight_left || tag == TurnLaneType::left || tag == TurnLaneType::sharp_left) @@ -250,10 +250,6 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection, BOOST_ASSERT(findBestMatch(lane_data[lane].tag, intersection) == 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]); ++lane; } diff --git a/src/extractor/scripting_environment_lua.cpp b/src/extractor/scripting_environment_lua.cpp index 013a15c9a..d7cf56e83 100644 --- a/src/extractor/scripting_environment_lua.cpp +++ b/src/extractor/scripting_environment_lua.cpp @@ -176,7 +176,7 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context) "enter_and_exit_roundabout_intersection", extractor::guidance::TurnType::EnterAndExitRoundaboutIntersection, "use_lane", - extractor::guidance::TurnType::UseLane, + extractor::guidance::TurnType::Suppressed, "no_turn", extractor::guidance::TurnType::NoTurn, "suppressed",