Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cf8a3d51f | |||
| 7886a1d446 | |||
| fbeacde0d5 | |||
| 59c60f7c54 | |||
| 46922646c2 | |||
| 1e0ec0ab8f | |||
| 3bde88eec5 |
@@ -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
|
||||
|
||||
+3
-1
@@ -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)
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
@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 |
|
||||
@@ -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('')];
|
||||
};
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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 : '';
|
||||
};
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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() << " [";
|
||||
|
||||
@@ -355,6 +355,10 @@ void collapseTurnAt(std::vector<RouteStep> &steps,
|
||||
BOOST_ASSERT(one_back_index < steps.size());
|
||||
const auto ¤t_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 ¤t)
|
||||
{
|
||||
//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
|
||||
|
||||
Reference in New Issue
Block a user