[osrm] 01/05: Imported Upstream version 5.4.3+ds

Bas Couwenberg sebastic at debian.org
Wed Nov 9 06:57:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository osrm.

commit e8c9c1052b860998471bd4f2a7c632145f2c7b51
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Nov 9 07:39:55 2016 +0100

    Imported Upstream version 5.4.3+ds
---
 CHANGELOG.md                               |  6 ++++
 CMakeLists.txt                             |  4 ++-
 features/guidance/roundabout.feature       | 45 ++++++++++++++++++++++++++++++
 features/guidance/turn-location.feature    | 21 ++++++++++++++
 features/support/data.js                   | 14 ++++++++++
 features/support/data_classes.js           |  7 +++++
 features/support/route.js                  |  8 ++++++
 features/support/shared_steps.js           |  7 ++++-
 include/engine/guidance/assemble_steps.hpp | 16 ++++++-----
 include/util/debug.hpp                     |  1 +
 src/engine/guidance/post_processing.cpp    |  9 ++++++
 11 files changed, 129 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f8b324b..3b891af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+# 5.4.3
+  - Changes from 5.4.2
+    - Bugfixes
+      - #3254 Fixed a bug that could end up hiding roundabout instructions
+      - #3260 fixed a bug that provided the wrong location in the arrival instruction
+
 # 5.4.2
   - Changes from 5.4.1
     - Bugfixes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92ae330..9b69592 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ endif()
 project(OSRM C CXX)
 set(OSRM_VERSION_MAJOR 5)
 set(OSRM_VERSION_MINOR 4)
-set(OSRM_VERSION_PATCH 0)
+set(OSRM_VERSION_PATCH 3)
 
 # these two functions build up custom variables:
 #   OSRM_INCLUDE_PATHS and OSRM_DEFINES
@@ -249,6 +249,8 @@ endif()
 
 # Configuring other platform dependencies
 if(APPLE)
+  set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
+  execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
   set(CMAKE_OSX_ARCHITECTURES "x86_64")
   message(STATUS "Set Architecture to x64 on OS X")
   exec_program(uname ARGS -v  OUTPUT_VARIABLE DARWIN_VERSION)
diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature
index a02c762..5638742 100644
--- a/features/guidance/roundabout.feature
+++ b/features/guidance/roundabout.feature
@@ -403,3 +403,48 @@ Feature: Basic Roundabout
             #| w,x       | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive       |
             | w,x       | ll,egg,egg,tr,tr | depart,turn right,continue left,turn slight left,arrive |
 
+    @3254
+    Scenario: Driving up to and through a roundabout
+        Given the node map
+            |   | g |  |  |  |  |   |  | a |  |   |  |   |
+            |   |   |  |  |  |  |   |  |   |  |   |  |   |
+            | e | f |  |  |  |  | b |  |   |  | d |  | h |
+            |   |   |  |  |  |  |   |  |   |  |   |  |   |
+            |   | i |  |  |  |  |   |  | c |  |   |  |   |
+            |   |   |  |  |  |  |   |  |   |  |   |  |   |
+            |   |   |  |  |  |  |   |  | k |  |   |  |   |
+
+        And the ways
+            | nodes | junction   | name       | highway     |
+            | abcda | roundabout | roundabout | residential |
+            | gfi   |            | side       | residential |
+            | efb   |            | left       | residential |
+            | dh    |            | right      | residential |
+            | ck    |            | bottom     | residential |
+
+        When I route I should get
+            | waypoints | route            | turns                           |
+            | e,h       | left,right,right | depart,roundabout-exit-2,arrive |
+
+    @3254
+    Scenario: Driving up to and through a roundabout
+        Given the node map
+            |   | g |  |   |  | a |  |   |  |   |
+            |   |   |  |   |  |   |  |   |  |   |
+            | e | f |  | b |  |   |  | d |  | h |
+            |   |   |  |   |  |   |  |   |  |   |
+            |   | i |  |   |  | c |  |   |  |   |
+            |   |   |  |   |  |   |  |   |  |   |
+            |   |   |  |   |  | k |  |   |  |   |
+
+        And the ways
+            | nodes | junction   | name       | highway     |
+            | abcda | roundabout | roundabout | residential |
+            | gfi   |            | side       | residential |
+            | efb   |            | left       | residential |
+            | dh    |            | right      | residential |
+            | ck    |            | bottom     | residential |
+
+        When I route I should get
+            | waypoints | route            | turns                           |
+            | e,h       | left,right,right | depart,roundabout-exit-2,arrive |
diff --git a/features/guidance/turn-location.feature b/features/guidance/turn-location.feature
new file mode 100644
index 0000000..f7293e1
--- /dev/null
+++ b/features/guidance/turn-location.feature
@@ -0,0 +1,21 @@
+ at routing  @guidance
+Feature: Turn Location Feature
+
+    Background:
+        Given the profile "car"
+        Given a grid size of 10 meters
+
+    Scenario: Simple feature to test turn locations
+        Given the node map
+            |   | c |   |
+            | a | b | d |
+
+        And the ways
+            | nodes  | highway |
+            | ab     | primary |
+            | cb     | primary |
+            | db     | primary |
+
+       When I route I should get
+            | waypoints | route    | turns                   | locations |
+            | a,c       | ab,cb,cb | depart,turn left,arrive | a,b,c     |
diff --git a/features/support/data.js b/features/support/data.js
index f0bf302..9ec0486 100644
--- a/features/support/data.js
+++ b/features/support/data.js
@@ -126,6 +126,20 @@ module.exports = function () {
         return fromNode;
     };
 
+    // find a node based on an array containing lon/lat
+    this.findNodeByLocation = (node_location) => {
+        var searched_coordinate = new classes.Location(node_location[0],node_location[1]);
+        for (var node in this.nameNodeHash)
+        {
+            var node_coordinate = new classes.Location(this.nameNodeHash[node].lon,this.nameNodeHash[node].lat);
+            if (this.FuzzyMatch.matchCoordinate(searched_coordinate, node_coordinate, this.zoom))
+            {
+                return node;
+            }
+        }
+        return '_';
+    };
+
     this.findWayByName = (s) => {
         return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
     };
diff --git a/features/support/data_classes.js b/features/support/data_classes.js
index 2ea8d4e..5aced6c 100644
--- a/features/support/data_classes.js
+++ b/features/support/data_classes.js
@@ -111,5 +111,12 @@ module.exports = {
             return this.match(got[0], util.format('%d ~0.0025%', want.lon)) &&
                 this.match(got[1], util.format('%d ~0.0025%', want.lat));
         }
+
+        matchCoordinate (got, want, zoom) {
+            if (got == null || want == null) return false;
+            return this.match(got.lon, util.format('%d +- %d', want.lon, 0.25*zoom)) &&
+                this.match(got.lat, util.format('%d +- %d', want.lat, 0.25*zoom));
+        }
+
     }
 };
diff --git a/features/support/route.js b/features/support/route.js
index 32401b7..b0b676e 100644
--- a/features/support/route.js
+++ b/features/support/route.js
@@ -211,6 +211,14 @@ module.exports = function () {
             .join(',');
     };
 
+    this.locations = (instructions) => {
+        return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
+            .map(v => {
+                return this.findNodeByLocation(v.maneuver.location);
+            })
+            .join(',');
+    };
+
     this.intersectionList = (instructions) => {
         return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
             .map( v => {
diff --git a/features/support/shared_steps.js b/features/support/shared_steps.js
index 0252cd4..6d04ce7 100644
--- a/features/support/shared_steps.js
+++ b/features/support/shared_steps.js
@@ -35,7 +35,7 @@ module.exports = function () {
                     if (err) return cb(err);
                     if (body && body.length) {
                         let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
-                            distances, summary, intersections, lanes;
+                            distances, summary, intersections, lanes, locations;
 
                         let json = JSON.parse(body);
 
@@ -54,6 +54,7 @@ module.exports = function () {
                             distances = this.distanceList(json.routes[0]);
                             lanes = this.lanesList(json.routes[0]);
                             summary = this.summary(json.routes[0]);
+                            locations = this.locations(json.routes[0]);
                         }
 
                         if (headers.has('status')) {
@@ -125,6 +126,10 @@ module.exports = function () {
                                 got.intersections = (intersections || '').trim();
                             }
 
+                            if (headers.has('locations')){
+                                got.locations = (locations || '').trim();
+                            }
+
                             var putValue = (key, value) => {
                                 if (headers.has(key)) got[key] = instructions ? value : '';
                             };
diff --git a/include/engine/guidance/assemble_steps.hpp b/include/engine/guidance/assemble_steps.hpp
index 116312f..7e04ab0 100644
--- a/include/engine/guidance/assemble_steps.hpp
+++ b/include/engine/guidance/assemble_steps.hpp
@@ -213,13 +213,6 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
 
     BOOST_ASSERT(segment_index == number_of_segments - 1);
     bearings = detail::getArriveBearings(leg_geometry);
-    // This step has length zero, the only reason we need it is the target location
-    maneuver = {intersection.location,
-                bearings.first,
-                bearings.second,
-                extractor::guidance::TurnInstruction::NO_TURN(),
-                WaypointType::Arrive,
-                0};
 
     intersection = {
         target_node.location,
@@ -230,6 +223,15 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
         util::guidance::LaneTupel(),
         {}};
 
+    // This step has length zero, the only reason we need it is the target location
+    maneuver = {intersection.location,
+                bearings.first,
+                bearings.second,
+                extractor::guidance::TurnInstruction::NO_TURN(),
+                WaypointType::Arrive,
+                0};
+
+
     BOOST_ASSERT(!leg_geometry.locations.empty());
     steps.push_back(RouteStep{target_node.name_id,
                               facade.GetNameForID(target_node.name_id),
diff --git a/include/util/debug.hpp b/include/util/debug.hpp
index 28cfde2..5819a02 100644
--- a/include/util/debug.hpp
+++ b/include/util/debug.hpp
@@ -23,6 +23,7 @@ inline void print(const engine::guidance::RouteStep &step)
     std::cout << static_cast<int>(step.maneuver.instruction.type) << " "
               << static_cast<int>(step.maneuver.instruction.direction_modifier) << "  "
               << static_cast<int>(step.maneuver.waypoint_type) << " "
+              << step.maneuver.location << " "
               << " Duration: " << step.duration << " Distance: " << step.distance
               << " Geometry: " << step.geometry_begin << " " << step.geometry_end
               << "\n\tIntersections: " << step.intersections.size() << " [";
diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp
index 21f7a3d..a6bd1a1 100644
--- a/src/engine/guidance/post_processing.cpp
+++ b/src/engine/guidance/post_processing.cpp
@@ -355,6 +355,10 @@ void collapseTurnAt(std::vector<RouteStep> &steps,
     BOOST_ASSERT(one_back_index < steps.size());
     const auto &current_step = steps[step_index];
     const auto &one_back_step = steps[one_back_index];
+    // Don't collapse roundabouts
+    if (entersRoundabout(current_step.maneuver.instruction) ||
+        entersRoundabout(one_back_step.maneuver.instruction))
+        return;
 
     // FIXME: this function assumes driving on the right hand side of the streat
     const auto bearingsAreReversed = [](const double bearing_in, const double bearing_out) {
@@ -521,6 +525,11 @@ void collapseTurnAt(std::vector<RouteStep> &steps,
 //
 bool isStaggeredIntersection(const RouteStep &previous, const RouteStep &current)
 {
+    //don't touch roundabouts
+    if (entersRoundabout(previous.maneuver.instruction) ||
+        entersRoundabout(current.maneuver.instruction))
+        return false;
+
     // Base decision on distance since the zig-zag is a visual clue.
     // If adjusted, make sure to check validity of the is_right/is_left classification below
     const constexpr auto MAX_STAGGERED_DISTANCE = 3; // debatable, but keep short to be on safe side

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osrm.git



More information about the Pkg-grass-devel mailing list