Announce route recalculation #6576

Merged
root merged 2 commits from recalc_and_begin_tts into master 2025-03-01 09:01:15 +00:00
46 changed files with 112 additions and 0 deletions

View file

@ -27,6 +27,7 @@
"onto":"إلى",
"take_exit_number":"خروج إلى",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"إعادة حساب المسار",
"destination":"سوف تصل.",
"you_have_reached_the_destination":"لقد وصلت.",
"in_50_meters":"بعد خمسين متراً",

View file

@ -27,6 +27,7 @@
"onto":"на",
"take_exit_number":"З'езд на",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Пераразлік маршруту",
"destination":"Вы прыбудзеце ў пункт прызначэння.",
"you_have_reached_the_destination":"Вы прыбылі ў пункт прызначэння.",
"in_50_meters":"Праз пяцьдзесят метраў",

View file

@ -27,6 +27,7 @@
"onto":"onto",
"take_exit_number":"Agafeu la sortida",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalcular el recorregut",
"destination":"Arribareu a la destinació.",
"you_have_reached_the_destination":"Heu arribat.",
"in_50_meters":"A cinquanta metres",

View file

@ -27,6 +27,7 @@
"onto":"na",
"take_exit_number":"výstup na",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Přepočítání trasy",
"destination":"Přijedete do cíle.",
"you_have_reached_the_destination":"Jste v cíli.",
"in_50_meters":"Za padesát metrů",

View file

@ -27,6 +27,7 @@
"onto":"ad",
"take_exit_number":"Afkørsel ad",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Genberegning af ruten",
"destination":"Ankommer du.",
"you_have_reached_the_destination":"Du er ankommet.",
"in_50_meters":"Om halvtreds meter",

View file

@ -27,6 +27,7 @@
"onto":"auf",
"take_exit_number":"Nehmen Sie die Ausfahrt auf",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Neuberechnung der Route",
"destination":"Werden Sie ankommen.",
"you_have_reached_the_destination":"Sie sind angekommen.",
"in_50_meters":"In fünfzig Metern",

View file

@ -27,6 +27,7 @@
"onto":"στην",
"take_exit_number":"Εξοδος στην",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Επαναϋπολογισμός της διαδρομής",
"destination":"Θα φτάσετε.",
"you_have_reached_the_destination":"Έχετε φτάσει.",
"in_50_meters":"Σε πενήντα μέτρα",

View file

@ -27,6 +27,7 @@
"onto":"onto",
"take_exit_number":"Take exit",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculating the route",
"destination":"Youll arrive.",
"you_have_reached_the_destination":"You have arrived.",
"in_50_meters":"In fifty meters",

View file

@ -27,6 +27,7 @@
"onto":"hacia",
"take_exit_number":"Tome la salida",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculando la ruta",
"destination":"Llegará a su destino.",
"you_have_reached_the_destination":"Ha llegado a su destino.",
"in_50_meters":"En cincuenta metros",

View file

@ -27,6 +27,7 @@
"onto":"hacia",
"take_exit_number":"Tome la salida",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculando la ruta",
"destination":"Llegará a su destino.",
"you_have_reached_the_destination":"Ha llegado a su destino.",
"in_50_meters":"En cincuenta metros",

View file

@ -27,6 +27,7 @@
"onto":"NULL",
"take_exit_number":"Irten",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Ibilbidea berriro kalkulatzea",
"destination":"Zure helmugara iritsiko zara.",
"you_have_reached_the_destination":"Helmugara iritsi zara.",
"in_50_meters":"Berrogeita hamar metrora",

View file

@ -27,6 +27,7 @@
"onto":"ﺐﻫ",
"take_exit_number":"خروجﺐﻫ",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"محاسبه مجدد مسیر",
"destination":"به مقصد خواهيد رسيد.",
"you_have_reached_the_destination":"به مقصد رسيديد.",
"in_50_meters":"در پنجاه متری",

View file

@ -27,6 +27,7 @@
"onto":"tielle",
"take_exit_number":"Poistu tielle",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Reitin uudelleenlaskenta",
"destination":"Olet perillä.",
"you_have_reached_the_destination":"Olet saapunut.",
"in_50_meters":"Viidenkymmenen metrin päässä",

View file

@ -27,6 +27,7 @@
"onto":"sur",
"take_exit_number":"Sortie sur",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalcul de l'itinéraire",
"destination":"Vous arriverez.",
"you_have_reached_the_destination":"Vous êtes arrivé.",
"in_50_meters":"Dans cinquante mètres",

View file

@ -27,6 +27,7 @@
"onto":"पर",
"take_exit_number":"बाहर जाएं पर",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"मार्ग की पुनर्गणना",
"destination":"गंतव्य स्थान",
"you_have_reached_the_destination":"आप पहुंच गए हैं।",
"in_50_meters":"पचास मीटर में।",

View file

@ -27,6 +27,7 @@
"onto":"na",
"take_exit_number":"Izlaz na",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculating the route",
"destination":"Stižete.",
"you_have_reached_the_destination":"Stigli ste.",
"in_50_meters":"Za pedeset metara",

View file

@ -27,6 +27,7 @@
"onto":"a",
"take_exit_number":"Hajtson ki a",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Az útvonal újraszámítása",
"destination":"Megérkezik.",
"you_have_reached_the_destination":"Megérkezett.",
"in_50_meters":"Ötven méter után",

View file

@ -27,6 +27,7 @@
"onto":"ke",
"take_exit_number":"Keluar ke",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Menghitung ulang rute",
"destination":"Anda akan tiba.",
"you_have_reached_the_destination":"Anda sudah sampai.",
"in_50_meters":"Setelah lima puluh meter",

View file

@ -27,6 +27,7 @@
"onto":"sulla",
"take_exit_number":"Uscita sulla",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Ricalcolo del percorso",
"destination":"Arriverai.",
"you_have_reached_the_destination":"Sei arrivato.",
"in_50_meters":"Tra cinquanta metri",

View file

@ -27,6 +27,7 @@
"onto":"NULL",
"take_exit_number":"出口を出る",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"ルートの再計算",
"destination":"到着します。",
"you_have_reached_the_destination":"目的地に到着しました。",
"in_50_meters":"五十メートル先",

View file

@ -27,6 +27,7 @@
"onto":"NULL",
"take_exit_number":"출구",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"경로 다시 계산하기",
"destination":"도착할 예정입니다.",
"you_have_reached_the_destination":"도착했습니다.",
"in_50_meters":"오십 미터 앞",

View file

@ -27,6 +27,7 @@
"onto":"वर",
"take_exit_number":"बाहेर पडा वर",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"मार्गाची पुनर्गणना करत आहे",
"destination":"तुम्ही पोहोचाल.",
"you_have_reached_the_destination":"तुम्ही पोहोचला आहात.",
"in_50_meters":"पन्नास मीटर मध्ये",

View file

@ -27,6 +27,7 @@
"onto":"inn på",
"take_exit_number":"Ta avkjøringen inn på",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Beregner ruten på nytt",
"destination":"Ankommer du.",
"you_have_reached_the_destination":"Du har ankommet.",
"in_50_meters":"Om femti meter",

View file

@ -27,6 +27,7 @@
"onto":"naar",
"take_exit_number":"Verlaat naar",
"take_exit_number_street_verb":"Neem",
"route_recalculating":"De route herberekenen",
"destination":"Arriveert u.",
"you_have_reached_the_destination":"Bestemming bereikt.",
"in_50_meters":"Over vijftig meter",

View file

@ -27,6 +27,7 @@
"onto":"na",
"take_exit_number":"Wybierz zjazd",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Ponowne obliczanie trasy",
"destination":"Dojedziesz do celu.",
"you_have_reached_the_destination":"Dotarłeś do celu.",
"in_50_meters":"Za pięćdziesiąt metrów",

View file

@ -27,6 +27,7 @@
"onto":"para",
"take_exit_number":"Pegue a saída",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculando rota",
"destination":"Você chegará ao seu destino.",
"you_have_reached_the_destination":"Você chegou ao seu destino.",
"in_50_meters":"Em cinquenta metros",

View file

@ -27,6 +27,7 @@
"onto":"para",
"take_exit_number":"Siga pela saída",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculando itinerário",
"destination":"Chegará ao seu destino.",
"you_have_reached_the_destination":"Chegou ao seu destino.",
"in_50_meters":"A cinquenta metros",

View file

@ -27,6 +27,7 @@
"onto":"pe",
"take_exit_number":"Ieșire pe",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalcularea traseului",
"destination":"Veți sosi.",
"you_have_reached_the_destination":"Ați ajuns.",
"in_50_meters":"După cincizeci de metri",

View file

@ -27,6 +27,7 @@
"onto":"на",
"take_exit_number":"Съезд на",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Перерасчет маршрута",
"destination":"Вы прибудете в пункт назначения.",
"you_have_reached_the_destination":"Вы прибыли в пункт назначения.",
"in_50_meters":"Через пятьдесят метров",

View file

@ -27,6 +27,7 @@
"onto":"na",
"take_exit_number":"Výjazd na",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Prepočítanie trasy",
"destination":"Dorazíte do cieľa.",
"you_have_reached_the_destination":"Dorazili ste do cieľa.",
"in_50_meters":"Po päťdesiatich metroch",

View file

@ -27,6 +27,7 @@
"onto":"onto",
"take_exit_number":"Take exit",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Recalculating the route",
"destination":"Стижете на одредиште.",
"you_have_reached_the_destination":"Стигли сте.",
"in_50_meters":"За педесет метара",

View file

@ -27,6 +27,7 @@
"onto":"in på",
"take_exit_number":"Utgång in på",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Omberäkning av rutten",
"destination":"Är du framme.",
"you_have_reached_the_destination":"Du har anlänt.",
"in_50_meters":"Om femtio meter",

View file

@ -27,6 +27,7 @@
"onto":"kwenye",
"take_exit_number":"Kuondoka kwenye",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Kuhesabu upya njia",
"destination":"Utawasili.",
"you_have_reached_the_destination":"Umewasili mwisho wa safari.",
"in_50_meters":"Kabla ya mita hamsini",

View file

@ -27,6 +27,7 @@
"onto":"เข้าสู่",
"take_exit_number":"ทางออก เข้าสู่",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"การคำนวณเส้นทางใหม่",
"destination":"คุณจะถึง",
"you_have_reached_the_destination":"คุณมาถึงแล้ว",
"in_50_meters":"อีกห้าสิบเมตร",

View file

@ -27,6 +27,7 @@
"onto":"yönünde",
"take_exit_number":ıkın yönünde",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Rotanın yeniden hesaplanması",
"destination":"Varacaksınız.",
"you_have_reached_the_destination":"Hedef noktasına vardınız.",
"in_50_meters":"Elli metre sonra",

View file

@ -27,6 +27,7 @@
"onto":"на",
"take_exit_number":"З'їзд на",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Перерахунок маршруту",
"destination":"Ви прибудете.",
"you_have_reached_the_destination":"Ви прибули.",
"in_50_meters":"Через п'ятдесят метрів",

View file

@ -27,6 +27,7 @@
"onto":"vào",
"take_exit_number":"Đi theo lối ra số",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"Tính toán lại lộ trình",
"destination":"Bạn sẽ đến.",
"you_have_reached_the_destination":"Bạn đã đến.",
"in_50_meters":"Trong năm mươi mét nữa",

View file

@ -27,6 +27,7 @@
"onto":"驶入到",
"take_exit_number":"驶出 上",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"重新计算路线",
"destination":"即将到达目的地。",
"you_have_reached_the_destination":"您已到达目的地。",
"in_50_meters":"在五十米后",

View file

@ -27,6 +27,7 @@
"onto":"駛入到",
"take_exit_number":"出口 上",
"take_exit_number_street_verb":"NULL",
"route_recalculating":"重新計算路",
"destination":"即將到達目的地。",
"you_have_reached_the_destination":"你已到達目的地。",
"in_50_meters":"在五十公尺後",

View file

@ -596,6 +596,50 @@
en = NULL
nl = Neem
[route_recalculating]
en = Recalculating the route
af = Herbereken die roete
ar = إعادة حساب المسار
az = Marşrutun yenidən hesablanması
be = Пераразлік маршруту
bg = Преизчисляване на маршрута
ca = Recalcular el recorregut
cs = Přepočítání trasy
da = Genberegning af ruten
de = Neuberechnung der Route
el = Επαναϋπολογισμός της διαδρομής
es = Recalculando la ruta
et = Marsruudi ümberarvutamine
eu = Ibilbidea berriro kalkulatzea
fa = محاسبه مجدد مسیر
fi = Reitin uudelleenlaskenta
fr = Recalcul de l'itinéraire
he = חישוב מחדש של המסלול
hi = मार्ग की पुनर्गणना
hu = Az útvonal újraszámítása
id = Menghitung ulang rute
it = Ricalcolo del percorso
ja = ルートの再計算
ko = 경로 다시 계산하기
lt = Maršruto perskaičiavimas
mr = मार्गाची पुनर्गणना करत आहे
nb = Beregner ruten på nytt
nl = De route herberekenen
pl = Ponowne obliczanie trasy
pt = Recalculando itinerário
pt-BR = Recalculando rota
ro = Recalcularea traseului
ru = Перерасчет маршрута
sk = Prepočítanie trasy
sv = Omberäkning av rutten
sw = Kuhesabu upya njia
th = การคำนวณเส้นทางใหม่
tr = Rotanın yeniden hesaplanması
uk = Перерахунок маршруту
vi = Tính toán lại lộ trình
zh-Hans = 重新计算路线
zh-Hant = 重新計算路
[destination]
en = Youll arrive.
ar = سوف تصل.

View file

@ -74,6 +74,7 @@ void RoutingSession::BuildRoute(Checkpoints const & checkpoints, uint32_t timeou
m_isFollowing = false;
m_routingRebuildCount = -1; // -1 for the first rebuild.
m_routingRebuildAnnounceCount = 0;
RebuildRoute(checkpoints.GetStart(), m_buildReadyCallback, m_needMoreMapsCallback,
m_removeRouteCallback, timeoutSec, SessionState::RouteBuilding, false /* adjust */);
@ -242,6 +243,10 @@ void RoutingSession::Reset()
m_passedDistanceOnRouteMeters = 0.0;
m_isFollowing = false;
m_lastCompletionPercent = 0;
// reset announcement counters
m_routingRebuildCount = -1;
m_routingRebuildAnnounceCount = 0;
}
void RoutingSession::SetState(SessionState state)
@ -484,6 +489,14 @@ void RoutingSession::GenerateNotifications(std::vector<std::string> & notificati
ASSERT(m_route, ());
// Generate recalculating notification if needed and reset
if (m_routingRebuildCount > m_routingRebuildAnnounceCount)
{
m_routingRebuildAnnounceCount = m_routingRebuildCount;
notifications.emplace_back(m_turnNotificationsMgr.GenerateRecalculatingText());
return;
}
// Voice turn notifications.
if (!m_routingSettings.m_soundDirection)
return;

View file

@ -234,6 +234,7 @@ private:
double m_passedDistanceOnRouteMeters = 0.0;
// Rerouting count
int m_routingRebuildCount = -1; // -1 for the first rebuild called in BuildRoute().
int m_routingRebuildAnnounceCount = 0; // track TTS announcement state (ignore the first build)
biodranik commented 2024-08-26 08:10:35 +00:00 (Migrated from github.com)
Review

It should also be reset in BuildRoute L77

It should also be reset in BuildRoute L77
mutable double m_lastCompletionPercent = 0.0;
DECLARE_THREAD_CHECKER(m_threadChecker);

View file

@ -84,6 +84,11 @@ std::string NotificationManager::GenerateTurnText(uint32_t distanceUnits, uint8_
return m_getTtsText.GetTurnNotification({distanceUnits, exitNum, useThenInsteadOfDistance, turn.m_pedestrianTurn, lengthUnits, nextStreetInfo});
}
std::string NotificationManager::GenerateRecalculatingText() const
{
return m_getTtsText.GetRecalculatingNotification();
}
std::string NotificationManager::GenerateSpeedCameraText() const
{
return m_getTtsText.GetSpeedCameraNotification();

View file

@ -49,6 +49,9 @@ public:
measurement_utils::Units GetLengthUnits() const { return m_settings.GetLengthUnits(); }
void SetLocaleWithJsonForTesting(std::string const & json, std::string const & locale);
/// \brief Generate text of route rebuild notification.
std::string GenerateRecalculatingText() const;
/// \brief Generate text of speed camera notification.
std::string GenerateSpeedCameraText() const;

View file

@ -250,6 +250,11 @@ std::string GetTtsText::GetTurnNotification(Notification const & notification) c
return out;
}
std::string GetTtsText::GetRecalculatingNotification() const
{
return GetTextById("route_recalculating");
}
std::string GetTtsText::GetSpeedCameraNotification() const
{
return GetTextById("unknown_camera");

View file

@ -25,6 +25,8 @@ public:
std::string GetTurnNotification(Notification const & notification) const;
std::string GetRecalculatingNotification() const;
std::string GetSpeedCameraNotification() const;
/// \brief Sets a locale.