[tts] Change notification to 400-700 m

Signed-off-by: thesupertechie <thesupertechie1@gmail.com>
This commit is contained in:
thesupertechie
2025-11-29 22:05:30 -08:00
committed by zyphlar
parent 4691de7a66
commit 4f739d98b0
4 changed files with 14 additions and 9 deletions

View File

@@ -104,5 +104,7 @@
"in_1_mile":"In one mile", "in_1_mile":"In one mile",
"in_1_5_miles":"In one and a half miles", "in_1_5_miles":"In one and a half miles",
"in_2_miles":"In two miles", "in_2_miles":"In two miles",
"unknown_camera":"Camera ahead" "unknown_camera":"Camera ahead",
"continue":"Continue on the current road until further instructions.",
"continue_street":"Continue on"
} }

View File

@@ -16,7 +16,7 @@ namespace
{ {
// If the distance between two sequential turns is less than kSecondTurnThresholdDistM // If the distance between two sequential turns is less than kSecondTurnThresholdDistM
// the information about the second turn will be shown or pronounced // the information about the second turn will be shown or pronounced
// when the user is approaching to the first one with "Then.". // when the user is approaching to the first one with "Then,".
double constexpr kSecondTurnThresholdDistM = 400.0; double constexpr kSecondTurnThresholdDistM = 400.0;
// If the distance between two sequential turns is less than kDistanceNotifyThresholdM // If the distance between two sequential turns is less than kDistanceNotifyThresholdM
// the notification will *not* append second distance, (like "In 500 meters. Turn left. Then. Turn right.") // the notification will *not* append second distance, (like "In 500 meters. Turn left. Then. Turn right.")
@@ -25,7 +25,7 @@ double constexpr kDistanceNotifyThresholdM = 50.0;
// Returns true if the closest turn is an entrance to a roundabout and the second is // Returns true if the closest turn is an entrance to a roundabout and the second is
// an exit form a roundabout. // an exit form a roundabout.
// Note. There are some cases when another turn (besides an exit from roundabout) // Note. There are some cases when another turn (besides an exit from roundabout)
// follows an entrance to a roundabout. It could happend in case of turns inside a roundabout. // follows an entrance to a roundabout. It could happened in case of turns inside a roundabout.
// Returns false otherwise. // Returns false otherwise.
bool IsClassicEntranceToRoundabout(routing::turns::TurnItemDist const & firstTurn, bool IsClassicEntranceToRoundabout(routing::turns::TurnItemDist const & firstTurn,
routing::turns::TurnItemDist const & secondTurn) routing::turns::TurnItemDist const & secondTurn)
@@ -244,13 +244,13 @@ void NotificationManager::SetLengthUnits(measurement_utils::Units units)
switch (units) switch (units)
{ {
case measurement_utils::Units::Metric: case measurement_utils::Units::Metric:
m_settings.SetState(30 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */, m_settings.SetState(30 /* notificationTimeSeconds */, 400 /* minNotificationDistanceUnits */,
2000 /* maxNotificationDistanceUnits */, GetSoundedDistMeters() /* soundedDistancesUnits */, 2000 /* maxNotificationDistanceUnits */, GetSoundedDistMeters() /* soundedDistancesUnits */,
measurement_utils::Units::Metric /* lengthUnits */); measurement_utils::Units::Metric /* lengthUnits */);
return; return;
case measurement_utils::Units::Imperial: case measurement_utils::Units::Imperial:
m_settings.SetState(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */, m_settings.SetState(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */,
5000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */, 1000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */,
measurement_utils::Units::Imperial /* lengthUnits */); measurement_utils::Units::Imperial /* lengthUnits */);
return; return;
} }

View File

@@ -141,7 +141,7 @@ struct Notification
uint32_t m_distanceUnits; uint32_t m_distanceUnits;
uint8_t m_exitNum; uint8_t m_exitNum;
/// if m_useThenInsteadOfDistance == true the m_distanceUnits is ignored. /// if m_useThenInsteadOfDistance == true the m_distanceUnits is ignored.
/// The word "Then" shall be pronounced intead of the distance. /// The word "Then" will be pronounced instead of the distance.
bool m_useThenInsteadOfDistance; bool m_useThenInsteadOfDistance;
CarDirection m_turnDir = CarDirection::None; CarDirection m_turnDir = CarDirection::None;
PedestrianDirection m_turnDirPedestrian = PedestrianDirection::None; PedestrianDirection m_turnDirPedestrian = PedestrianDirection::None;

View File

@@ -92,8 +92,7 @@ void FormatFullRoadName(RouteSegment::RoadNameInfo & road, std::string & name)
if (!road.m_name.empty()) if (!road.m_name.empty())
outArr.emplace_back(road.m_name); outArr.emplace_back(road.m_name);
} }
name = strings::JoinStrings(outArr.begin(), outArr.end(), ";");
name = strings::JoinStrings(outArr.begin(), outArr.end(), "; ");
strings::Trim(name); strings::Trim(name);
} }
@@ -133,7 +132,7 @@ std::string GetTtsText::GetTurnNotification(Notification const & notification) c
if (notification.m_distanceUnits > 0) if (notification.m_distanceUnits > 0)
distStr = GetTextByIdTrimmed(GetDistanceTextId(notification)); distStr = GetTextByIdTrimmed(GetDistanceTextId(notification));
// Get a string like 245; CA 123; Highway 99; San Francisco // Get a string like [245] > CA 123/Highway 99/San Francisco
// In the future we could use the full RoadNameInfo struct to do some nice formatting. // In the future we could use the full RoadNameInfo struct to do some nice formatting.
std::string streetOut; std::string streetOut;
RouteSegment::RoadNameInfo nsi = notification.m_nextStreetInfo; // extract non-const RouteSegment::RoadNameInfo nsi = notification.m_nextStreetInfo; // extract non-const
@@ -344,6 +343,10 @@ std::string GetYouArriveTextId(Notification const & notification)
return "you_have_reached_the_destination"; return "you_have_reached_the_destination";
} }
std::string GetContinueTextId(Notification const & notification){
return "continue"
}
std::string GetDirectionTextId(Notification const & notification) std::string GetDirectionTextId(Notification const & notification)
{ {
if (notification.IsPedestrianNotification()) if (notification.IsPedestrianNotification())