Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve voice instructions #4696

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
af6af8e
first improved instructions
Trietes Apr 13, 2024
13ef437
Merge branch 'valhalla:master' into improve-voice-instructions
Trietes Apr 19, 2024
c835e2c
typo in docs
kevinkreiser Apr 19, 2024
c8f4773
PBF support for `/expansion` (#4614)
chrstnbwnkl Apr 22, 2024
56785d0
label third_party includes as -isystem in test/CMakeLists.txt (#4698)
nilsnolde Apr 23, 2024
812383f
Address some "unused code" errors (#4701)
michaelkirk Apr 24, 2024
9888d8e
rm unused import fixes building tests without prime_server (#4705)
michaelkirk Apr 24, 2024
16fecc1
Correctly set has_highway, has_ferry and has_toll attributes when dir…
michaelhrabanek Apr 25, 2024
0636e37
Added elapsed_cost to map matching json output (#4709)
NorekZ May 2, 2024
651a515
test-add workflow to auto-update the fossgis instances (#4716)
nilsnolde May 2, 2024
629f0dd
always save vcpkg cache (#4719)
nilsnolde May 5, 2024
1594fe9
Remove tile_extract from config when creating stats (#4722)
chrstnbwnkl May 7, 2024
76f316c
add error when we fail to find any connection in matrix (#4718)
nilsnolde May 8, 2024
6fbe96e
auto-update the fossgis instances (#4717)
nilsnolde May 8, 2024
26cfae4
add some error communication & handling to `valhalla_ingest_transit` …
nilsnolde May 10, 2024
3463f1a
Fix inconsistency in graph.lua for motor_vehicle_node (#4724)
michaelhrabanek May 13, 2024
c14d3ac
fix echo statement for linux/macos in building.md (#4730)
martin-schlossarek May 14, 2024
78c1701
Removed voice & banner instructions from last step and added ssmlAnno…
Trietes Jun 4, 2024
4f6ef05
Adds documentation for `ignore_oneways` option (#4743)
eikes Jun 5, 2024
48b339b
add deadend to directededge json (#4751)
chrstnbwnkl Jun 5, 2024
f4ce0db
first improved instructions
Trietes Apr 13, 2024
e8d387e
Merge branch 'improve-voice-instructions' of https://github.com/Triet…
Trietes Jun 8, 2024
66e7428
cleanup and fixed tests
Trietes Jun 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/update_public_servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update public FOSSGIS servers

on:
push:
branches:
- master
paths:
- .github/workflows
- 'src'
- 'valhalla'
- 'proto'
- 'scripts'
- 'lua'
workflow_dispatch:

jobs:
update_servers:
name: Update servers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run script
run: |
eval $(ssh-agent -s)
ssh-add - <<< "${{ secrets.SSH_SECRET }}"
# first the build server
ssh -p 23432 -o StrictHostKeyChecking=no valhalla@162.55.103.19 'sudo bash -s builder' < scripts/update_public_server.sh
# then the services
ssh -p 23432 -o StrictHostKeyChecking=no valhalla@162.55.2.221 'sudo bash -s service' < scripts/update_public_server.sh
3 changes: 1 addition & 2 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ jobs:
-DPREFER_EXTERNAL_DEPS=ON \
-DENABLE_GDAL=ON

- if: ${{ steps.vcpkg-restore.outputs.cache-hit != 'true' }}
name: Save vcpkg packages (if cache miss)
- name: Save vcpkg packages (always, to avoid redundant rebuilds)
uses: actions/cache/save@v3
with:
key: ${{ steps.vcpkg-restore.outputs.cache-primary-key }}
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
* FIXED: Fix segfault in OSRM serializer with bannerInstructions when destination is on roundabout [#4480](https://github.com/valhalla/valhalla/pull/4481)
* FIXED: Fix segfault in costmatrix (date_time and time zone always added). [#4530](https://github.com/valhalla/valhalla/pull/4530)
* FIXED: Fixed roundoff issue in Tiles Row and Col methods [#4585](https://github.com/valhalla/valhalla/pull/4585)
* FIXED: Fix for assigning attributes has_(highway, ferry, toll) if directions_type is none [#4465](https://github.com/valhalla/valhalla/issues/4465)
* FIXED: Have the `valhalla_add_predicted_speeds` summary always be created from `mjolnir.tile_dir` [#4722](https://github.com/valhalla/valhalla/pull/4722)
* FIXED: Fix inconsistency in graph.lua for motor_vehicle_node [#4723](https://github.com/valhalla/valhalla/issues/4723)
* **Enhancement**
* UPDATED: French translations, thanks to @xlqian [#4159](https://github.com/valhalla/valhalla/pull/4159)
* CHANGED: -j flag for multithreaded executables to override mjolnir.concurrency [#4168](https://github.com/valhalla/valhalla/pull/4168)
Expand Down Expand Up @@ -114,6 +117,12 @@
* ADDED: some missing documentation about request parameters [#4687](https://github.com/valhalla/valhalla/pull/4687)
* ADDED: Consider more forward/backward tags for access restrictions and speeds [#4686](https://github.com/valhalla/valhalla/pull/4686)
* CHANGED: change costmatrix max_distance threshold to a distance threshold instead of duration [#4672](https://github.com/valhalla/valhalla/pull/4672)
* ADDED: PBF support for expansion [#4614](https://github.com/valhalla/valhalla/pull/4614/)
* ADDED: elapsed_cost field to map matching json response [#4709](https://github.com/valhalla/valhalla/pull/4709)
* ADDED: error if we fail to find any matrix connection [#4718](https://github.com/valhalla/valhalla/pull/4718)
* ADDED: Fail early in valhalla_ingest_transit if there's no valid GTFS feeds [#4710](https://github.com/valhalla/valhalla/pull/4710/)
* ADDED: Added ssmlAnnouncements for voice instructions and removed voice and banner instructions from last step. [#4644](https://github.com/valhalla/valhalla/pull/4644)
* ADDED: deadend information in directed edge JSON for `/locate` [#4751](https://github.com/valhalla/valhalla/pull/4751)

## Release Date: 2023-05-11 Valhalla 3.4.0
* **Removed**
Expand Down
1 change: 1 addition & 0 deletions docs/docs/api/turn-by-turn/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ These options are available for `auto`, `bus`, and `truck` costing methods.
| `ignore_closures` | If set to `true`, ignores all closures, marked due to live traffic closures, during routing. **Note:** This option cannot be set if `location.search_filter.exclude_closures` is also specified in the request and will return an error if it is |
| `closure_factor` | A factor that penalizes the cost when traversing a closed edge (eg: if `search_filter.exclude_closures` is `false` for origin and/or destination location and the route starts/ends on closed edges). Its value can range from `1.0` - don't penalize closed edges, to `10.0` - apply high cost penalty to closed edges. Default value is `9.0`. **Note:** This factor is applicable only for motorized modes of transport, i.e `auto`, `motorcycle`, `motor_scooter`, `bus`, `truck` & `taxi`. |
| `ignore_restrictions` | If set to `true`, ignores any restrictions (e.g. turn/dimensional/conditional restrictions). Especially useful for matching GPS traces to the road network regardless of restrictions. Default is `false`. |
| `ignore_oneways` | If set to `true`, ignores one-way restrictions. Especially useful for matching GPS traces to the road network ignoring uni-directional traffic rules. Not included in `ignore_restrictions` option. Default is `false`. |
| `ignore_non_vehicular_restrictions` | Similar to `ignore_restrictions`, but will respect restrictions that impact vehicle safety, such as weight and size restrictions. |
| `ignore_access` | Will ignore mode-specific access tags. Especially useful for matching GPS traces to the road network regardless of restrictions. Default is `false`. |
| `ignore_closures` | Will ignore traffic closures. Default is `false`. |
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ git clone https://github.com/microsoft/vcpkg && git -C vcpkg checkout <some-tag>
./vcpkg/bootstrap-vcpkg.sh
# windows: cmd.exe /c bootstrap-vcpkg.bat
# only build Release versions of dependencies, not Debug
echo "VCPKG_BUILD_TYPE release" >> vcpkg/triplets/x64-linux.cmake
echo "set(VCPKG_BUILD_TYPE release)" >> vcpkg/triplets/x64-linux.cmake
# windows: echo.set(VCPKG_BUILD_TYPE release)>> .\vcpkg\triplets\x64-windows.cmake
# osx: echo "VCPKG_BUILD_TYPE release" >> vcpkg/triplets/arm64-osx.cmake
# osx: echo "set(VCPKG_BUILD_TYPE release)" >> vcpkg/triplets/arm64-osx.cmake

# vcpkg will install everything during cmake configuration
# if you want to ENABLE_SERVICES=ON, install https://github.com/kevinkreiser/prime_server#build-and-install (no Windows)
Expand Down Expand Up @@ -116,7 +116,7 @@ git -C C:\path\to\vcpkg checkout f330a32
# only build release versions for vcpkg packages
echo.set(VCPKG_BUILD_TYPE release)>> path\to\vcpkg\triplets\x64-windows.cmake
cd C:\path\to\valhalla
C:\path\to\vcpkg.exe install --triple x64-windows
C:\path\to\vcpkg.exe install --triplet x64-windows
```
2. Let CMake configure the build with the required modules enabled. The final command for `x64` could look like
```
Expand Down
2 changes: 1 addition & 1 deletion lua/graph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ motor_vehicle_node = {
["forestry"] = 0,
["destination"] = 1,
["customers"] = 1,
["official"] = 0,
["official"] = 1,
["public"] = 1,
["restricted"] = 1,
["allowed"] = 1,
Expand Down
3 changes: 2 additions & 1 deletion proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ set(protobuf_descriptors
incidents.proto
status.proto
matrix.proto
isochrone.proto)
isochrone.proto
expansion.proto)

if(ENABLE_DATA_TOOLS)
# Only mjolnir needs the OSM PBF descriptors
Expand Down
9 changes: 4 additions & 5 deletions proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import public "info.proto"; // statistics about the request, filled out by
import public "status.proto"; // info for status endpoint
import public "matrix.proto"; // the matrix results
import public "isochrone.proto"; // the isochrone results
import public "expansion.proto"; // the expansion results

message Api {
// this is the request to the api
Expand All @@ -20,11 +21,9 @@ message Api {
Status status = 4; // status
Matrix matrix = 5; // sources_to_targets
Isochrone isochrone = 6; // isochrone
//TODO: isochrone
//TODO: matrix
//TODO: locate
//TODO: height
//TODO: expansion
Expansion expansion = 7; // expansion
//TODO: locate;
//TODO: height;

// here we store a bit of info about what happened during request processing (stats/errors/warnings)
Info info = 20;
Expand Down
10 changes: 10 additions & 0 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,13 @@ enum TransitType {
kGondola = 6;
kFunicular = 7;
}

message Summary {
float length = 1; // kilometers or miles based on units
double time = 2; // seconds
BoundingBox bbox = 3; // Bounding box of the shape
bool has_time_restrictions = 4; // Does the route contain any time restrictions?
bool has_toll = 5;
bool has_ferry = 6;
bool has_highway = 7;
}
9 changes: 0 additions & 9 deletions proto/directions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import public "sign.proto";

message DirectionsLeg {

message Summary {
float length = 1; // kilometers or miles based on units
double time = 2; // seconds
BoundingBox bbox = 3; // Bounding box of the shape
bool has_time_restrictions = 4; // Does the route contain any time restrictions?
bool has_toll = 5;
bool has_ferry = 6;
bool has_highway = 7;
}

message GuidanceView {
enum Type{
Expand Down
26 changes: 26 additions & 0 deletions proto/expansion.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

option optimize_for = LITE_RUNTIME;
package valhalla;

message Expansion {

message Geometry {
repeated sint32 coords = 1 [packed=true];
}

enum EdgeStatus {
connected = 0;
settled = 1;
reached = 2;
}

repeated uint32 costs = 1 [packed=true];
repeated uint32 durations = 2 [packed=true];
repeated uint32 distances = 3 [packed=true];
repeated EdgeStatus edge_status = 4;
repeated uint32 edge_id = 5 [packed=true];
repeated uint32 pred_edge_id = 6 [packed=true];

repeated Geometry geometries = 7;
}
2 changes: 1 addition & 1 deletion proto/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ message PbfFieldSelector {
bool status = 4; // /status
bool matrix = 5; // sources_to_targets
bool isochrone = 6;
bool expansion = 9;
// TODO: enable these once we have objects for them
// bool locate = 7;
// bool height = 8;
// bool expansion = 9;
}

message AvoidEdge {
Expand Down
1 change: 1 addition & 0 deletions proto/trip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ message TripLeg {
repeated Incident incidents = 11;
repeated string algorithms = 12;
repeated Closure closures = 13;
Summary summary = 14;
}

message TripRoute {
Expand Down
42 changes: 42 additions & 0 deletions scripts/update_public_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# updates Valhalla on the FOSSGIS servers
# accepts one argument, either "builder" or "service"

set -e

server=$1
src_dir="/src/valhalla"

git config --global --add safe.directory /src/valhalla

git -C "${src_dir}" checkout master
git -C "${src_dir}" pull
git submodule update --init --recursive

# remove the build folder first
rm -r "${src_dir}"/build

if [[ $server == "builder" ]]; then
cmake -S "${src_dir}" -B "${src_dir}/build" \
-DENABLE_TOOLS=OFF \
-DENABLE_SERVICES=OFF \
-DENABLE_HTTP=OFF \
-DENABLE_PYTHON_BINDINGS=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_SINGLE_FILES_WERROR=OFF \
-DENABLE_GDAL=OFF

sudo make -C "${src_dir}/build" -j$(nproc) install
# config is updated by the build script on the server
else
cmake -S "${src_dir}" -B "${src_dir}/build" \
-DENABLE_DATA_TOOLS=OFF \
-DENABLE_SERVICES=ON \
-DENABLE_HTTP=ON \
-DENABLE_PYTHON_BINDINGS=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_SINGLE_FILES_WERROR=OFF

sudo make -C "${src_dir}/build" -j$(nproc) install
# Update the configs
/opt/valhalla/runner_build_config.sh 8000 && /opt/valhalla/runner_build_config.sh 8001
fi
2 changes: 1 addition & 1 deletion scripts/valhalla_build_config
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ help_text = {
'landmarks': 'Location of sqlite file holding landmark POI created with valhalla_build_landmarks',
'timezone': 'Location of sqlite file holding timezone information created with valhalla_build_timezones',
'transit_dir': 'Location of intermediate transit tiles created with valhalla_build_transit',
'transit_feeds_dir': 'Location of GTFS transit feeds',
'transit_feeds_dir': 'Location of all GTFS transit feeds, needs to contain one subdirectory per feed',
'transit_bounding_box': 'Add comma separated bounding box values to only download transit data inside the given bounding box',
'transit_pbf_limit': 'Limit individual PBF files to this many trips (needed for PBF\'s stupid size limit)',
'hierarchy': 'bool indicating whether road hierarchy is to be built - default to True',
Expand Down
1 change: 1 addition & 0 deletions src/baldr/directededge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ json::MapPtr DirectedEdge::json() const {
{"sidewalk_left", static_cast<bool>(sidewalk_left_)},
{"sidewalk_right", static_cast<bool>(sidewalk_right_)},
{"sac_scale", to_string(static_cast<SacScale>(sac_scale_))},
{"deadend", static_cast<bool>(deadend_)},
{"geo_attributes",
json::map({
{"length", static_cast<uint64_t>(length_)},
Expand Down
14 changes: 13 additions & 1 deletion src/mjolnir/ingest_transit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,22 @@ std::priority_queue<tile_transit_info_t> select_transit_tiles(const std::string&
filesystem::recursive_directory_iterator end_file_itr;
for (; gtfs_feed_itr != end_file_itr; ++gtfs_feed_itr) {
const auto& feed_path = gtfs_feed_itr->path();
if (gtfs_feed_itr->is_directory() && filesystem::is_empty(feed_path)) {
LOG_ERROR("Feed directory " + feed_path.string() + " is empty");
continue;
}
if (filesystem::is_directory(feed_path)) {
// feed_path has a trailing separator
const auto feed_name = feed_path.filename().string();

LOG_INFO("Loading " + feed_name);
gtfs::Feed feed(feed_path.string());
feed.read_feed();
auto read_result = feed.read_feed();
if (read_result.code != gtfs::ResultCode::OK) {
LOG_ERROR("Couldn't find a required file for feed " + feed_path.filename().string() + ": " +
read_result.message);
continue;
}
LOG_INFO("Done loading, now parsing " + feed_name);

const auto& stops = feed.get_stops();
Expand Down Expand Up @@ -874,6 +883,9 @@ std::list<GraphId> ingest_transit(const boost::property_tree::ptree& pt) {
// go get information about what transit tiles we should be fetching
LOG_INFO("Tiling GTFS Feeds");
auto tiles = select_transit_tiles(gtfs_dir);
if (tiles.empty()) {
throw std::runtime_error("Couldn't find any usable GTFS feeds.");
}

LOG_INFO("Writing " + std::to_string(tiles.size()) + " transit pbf tiles with " +
std::to_string(thread_count) + " threads...");
Expand Down
3 changes: 3 additions & 0 deletions src/mjolnir/valhalla_add_predicted_traffic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ int main(int argc, char** argv) {
if (!summary)
return EXIT_SUCCESS;

// don't use the .tar for stats
config.get_child("mjolnir").erase("tile_extract");

GraphReader reader(config.get_child("mjolnir"));
// Iterate through the tiles
int shortcuts_with_speed = 0;
Expand Down
19 changes: 12 additions & 7 deletions src/mjolnir/valhalla_ingest_transit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}

// spawn threads to download all the tiles returning a list of
// tiles that ended up having dangling stop pairs
auto dangling_tiles = valhalla::mjolnir::ingest_transit(config);

// spawn threads to connect dangling stop pairs to adjacent tiles' stops
valhalla::mjolnir::stitch_transit(config, dangling_tiles);
try {
// spawn threads to download all the tiles returning a list of
// tiles that ended up having dangling stop pairs
auto dangling_tiles = valhalla::mjolnir::ingest_transit(config);

// spawn threads to connect dangling stop pairs to adjacent tiles' stops
valhalla::mjolnir::stitch_transit(config, dangling_tiles);
} catch (const std::runtime_error& e) {
LOG_ERROR(e.what());
return EXIT_FAILURE;
}

return 0;
return EXIT_SUCCESS;
}
12 changes: 3 additions & 9 deletions src/odin/directionsbuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ void DirectionsBuilder::PopulateDirectionsLeg(const Options& options,
EnhancedTripLeg* etp,
std::list<Maneuver>& maneuvers,
DirectionsLeg& trip_directions) {
bool has_toll = false;
bool has_highway = false;
bool has_ferry = false;
// Populate trip and leg IDs
trip_directions.set_trip_id(etp->trip_id());
trip_directions.set_leg_id(etp->leg_id());
Expand Down Expand Up @@ -147,15 +144,12 @@ void DirectionsBuilder::PopulateDirectionsLeg(const Options& options,
trip_maneuver->set_end_shape_index(maneuver.end_shape_index());
if (maneuver.portions_toll()) {
trip_maneuver->set_portions_toll(maneuver.portions_toll());
has_toll = true;
}
if (maneuver.portions_highway()) {
trip_maneuver->set_portions_highway(maneuver.portions_highway());
has_highway = true;
}
if (maneuver.ferry()) {
trip_maneuver->set_portions_ferry(maneuver.ferry());
has_ferry = true;
}

trip_maneuver->set_has_time_restrictions(maneuver.has_time_restrictions());
Expand Down Expand Up @@ -439,9 +433,9 @@ void DirectionsBuilder::PopulateDirectionsLeg(const Options& options,
trip_directions.mutable_summary()->set_has_time_restrictions(has_time_restrictions);

// Populate toll, highway, ferry tags
trip_directions.mutable_summary()->set_has_toll(has_toll);
trip_directions.mutable_summary()->set_has_highway(has_highway);
trip_directions.mutable_summary()->set_has_ferry(has_ferry);
trip_directions.mutable_summary()->set_has_toll(etp->summary().has_toll());
trip_directions.mutable_summary()->set_has_highway(etp->summary().has_highway());
trip_directions.mutable_summary()->set_has_ferry(etp->summary().has_ferry());
}

} // namespace odin
Expand Down
10 changes: 10 additions & 0 deletions src/proto_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,14 @@ travel_mode_type(const valhalla::DirectionsLeg_Maneuver& maneuver) {
throw std::logic_error("Unknown travel mode");
}
}

const std::string& Expansion_EdgeStatus_Enum_Name(const Expansion_EdgeStatus status) {
static const std::unordered_map<int, std::string> statuses{
{Expansion_EdgeStatus_reached, "r"},
{Expansion_EdgeStatus_settled, "s"},
{Expansion_EdgeStatus_connected, "c"},
};
auto i = statuses.find(status);
return i == statuses.cend() ? empty_str : i->second;
}
} // namespace valhalla
Loading