Skip to content

Commit

Permalink
update osr (wheelchair profile, level handling fixes, elevator handli…
Browse files Browse the repository at this point in the history
…ng fixes, speeds adjusted) (#491)
  • Loading branch information
felixguendling committed Apr 21, 2024
1 parent 5ee023f commit 092abec
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
[osr]
url=git@github.com:motis-project/osr.git
branch=master
commit=4666c6ca17375ffc5591987d9eb426fb6b33c22c
commit=37f17c99a2f4cbe7063d11d2fe50ad6294ecb7ed
[adr]
url=git@github.com:triptix-tech/adr.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
5622279301642490618
7916048274967469391
cista 715692faa0d6dea6c878e2e1a64cdbd1324274f7
zlib fe8e13ffca867612951bc6baf114e5ac8b00f305
boost 1c3f21c1fa8b149da89e2f6bcb48b28fff30fa5e
Expand Down Expand Up @@ -38,7 +38,7 @@ sol2 fdb0f8a60e48aa737f0a8d73edede48627f0c984
variant 5aa73631dc969087c77433a5cdef246303051f69
tiles 64f297ea0f782d04c89e82c6d478a1dd453e5f70
rtree.c 6ed73a7dc4f1184f2b5b2acd8ac1c2b28a273057
osr 4666c6ca17375ffc5591987d9eb426fb6b33c22c
osr 37f17c99a2f4cbe7063d11d2fe50ad6294ecb7ed
luabind b5d39b6f7511930115964304a423f0e6336e0eb2
tbb b3011be5060ec1be43c76d4a8cc80d5550adb31d
osrm-backend a7fe58cf3b6a54968d1248e0b4299d49db02ff2e
Expand Down
32 changes: 25 additions & 7 deletions modules/osr/src/osr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ mm::msg_ptr osr::table(mm::msg_ptr const& msg) const {
auto const fut = utl::to_vec(*req->from(), [&](auto&& from) {
return mm::spawn_job([&]() {
switch (profile) {
case o::search_profile::kWheelchair:
return o::route(*impl_->w_, *impl_->l_,
impl_->get_dijkstra<o::foot<true>>(),
{from_fbs(from), o::level_t::invalid()}, {to},
kMaxDist, o::direction::kForward);
break;
case o::search_profile::kFoot:
return o::route(*impl_->w_, *impl_->l_,
impl_->get_dijkstra<o::foot>(),
impl_->get_dijkstra<o::foot<false>>(),
{from_fbs(from), o::level_t::invalid()}, {to},
kMaxDist, o::direction::kForward);
break;
Expand Down Expand Up @@ -137,9 +143,15 @@ mm::msg_ptr osr::one_to_many(mm::msg_ptr const& msg) const {
: o::direction::kBackward;
auto result = std::vector<std::optional<o::path>>{};
switch (profile) {
case o::search_profile::kWheelchair:
result =
o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::foot<true>>(),
from, to, kMaxDist, dir);
break;
case o::search_profile::kFoot:
result = o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::foot>(),
from, to, kMaxDist, dir);
result = o::route(*impl_->w_, *impl_->l_,
impl_->get_dijkstra<o::foot<false>>(), from, to,
kMaxDist, dir);
break;
case o::search_profile::kBike:
result = o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::bike>(),
Expand All @@ -164,8 +176,8 @@ mm::msg_ptr osr::one_to_many(mm::msg_ptr const& msg) const {
? motis::osrm::Cost{static_cast<double>(r->cost_),
static_cast<double>(r->dist_)}
: motis::osrm::Cost{
std::numeric_limits<double>::max(),
std::numeric_limits<double>::max()};
std::numeric_limits<std::uint16_t>::max(),
std::numeric_limits<std::uint16_t>::max()};
})))
.Union());
return make_msg(fbb);
Expand All @@ -184,9 +196,15 @@ mm::msg_ptr osr::via(mm::msg_ptr const& msg) const {
o::location{from_fbs(req->waypoints()->Get(1)), o::level_t::invalid()};
auto result = std::optional<o::path>{};
switch (profile) {
case o::search_profile::kWheelchair:
result =
o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::foot<true>>(),
from, to, kMaxDist, o::direction::kForward);
break;
case o::search_profile::kFoot:
result = o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::foot>(),
from, to, kMaxDist, o::direction::kForward);
result = o::route(*impl_->w_, *impl_->l_,
impl_->get_dijkstra<o::foot<false>>(), from, to,
kMaxDist, o::direction::kForward);
break;
case o::search_profile::kBike:
result = o::route(*impl_->w_, *impl_->l_, impl_->get_dijkstra<o::bike>(),
Expand Down

0 comments on commit 092abec

Please sign in to comment.