Skip to content

Commit

Permalink
Support for visual sub-maneuvers (#303)
Browse files Browse the repository at this point in the history
* Support for visual sub-maneuvers

* Address PR comments

* Added and updated tests

* Update release version

* Fix a typo

* Update _typos.toml to ignore extended response

* Update common/ferrostar/src/routing_adapters/osrm/models.rs

Co-authored-by: Ian Wagner <[email protected]>

* Add Prettier (#304)

* Update ferrostar version

* Add prettier

* Run Prettier

* Update guide

* Rename format to format:fix, add format:check script

* Add format:check to GitHub workflow

* Autocomplete search for Android Demo App (#295)

* Support arbitrary Valhalla options (formerly we only merged costing options)

* Fix argument

* Improve docs of some convenience initializers

* Align Android with iOS costing options

* swiftformat

* Don't forget the web ;)

* Add Android-specific README

* Set up Android to use API keys properly via local.properties

* Fix CI

* Fix subtle bug where Android location providers never updated lastLocation

* Rename U-Turn images to match how Kotlin stringifies the maneuvers

* Allow the fused location provider to report an initial fix faster

* First pass at an actually usable demo app

* Minor build script improvement

* Checkpoint commit phase 1

* Checkpoint commit phase 2 highlighting some bad stuff to clean up

* Add docs on the StaticLocationEngine

* Fix formatting + doc test

* Fix typo in Android readme

Co-authored-by: Jacob Fielding <[email protected]>

* Kotlin let closure idiom

* ktfmtFormat + auto-commit

* Remove extraneous env?

* Try switching to a mix of Apple Silicon Ubuntu runners for Android

* Fix runner permissions (I think)

* Apply automatic changes

* Address open thread re: iOS uturn image name

* Add TODO docs

* Fix the navigation camera (re-)application logic

* Cleanup

* Remove old comment

* Apply automatic changes

---------

Co-authored-by: Jacob Fielding <[email protected]>
Co-authored-by: ianthetechie <[email protected]>

* Fix ManeuverImage

* Fix ManeuverImage again

* Fix newline ending

---------

Co-authored-by: Ian Wagner <[email protected]>
Co-authored-by: Mike Hays <[email protected]>
Co-authored-by: Ian Wagner <[email protected]>
Co-authored-by: Jacob Fielding <[email protected]>
Co-authored-by: ianthetechie <[email protected]>
  • Loading branch information
6 people authored Oct 22, 2024
1 parent 40ee690 commit 359ec90
Show file tree
Hide file tree
Showing 28 changed files with 426 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if useLocalFramework {
path: "./common/target/ios/libferrostar-rs.xcframework"
)
} else {
let releaseTag = "0.18.0"
let releaseTag = "0.19.0"
let releaseChecksum = "c23dd4145abb11c97b8e26166999aa6b3b42b8f4b49ccf322764cf4a10cfc916"
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
Expand Down
7 changes: 6 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[default]
extend-ignore-re = [
"VALHALLA_EXTENDED_OSRM_RESPONSE.*",
]

[default.extend-words]
rememberable = "rememberable"

[files]
extend-exclude = ["**/build/*", "*.pbxproj", "**/dist/*", "guide/**/*.js"]
extend-exclude = ["**/build/*", "*.pbxproj", "**/dist/*", "guide/**/*.js"]
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ plugins {

allprojects {
group = "com.stadiamaps.ferrostar"
version = "0.18.0"
version = "0.19.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ fun PreviewInstructionsView() {
text = "Hyde Street",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

InstructionsView(instructions = instructions, distanceToNextManeuver = 42.0)
Expand All @@ -85,8 +87,10 @@ fun PreviewRTLInstructionsView() {
text = "ادمج يسارًا",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

InstructionsView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ fun ManeuverImageLeftTurnPreview() {
text = "",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}

@Preview
Expand All @@ -64,5 +65,6 @@ fun ManeuverImageContinueUturnPreview() {
text = "",
maneuverType = ManeuverType.CONTINUE,
maneuverModifier = ManeuverModifier.U_TURN,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ class InstructionViewTest {
text = "Hyde Street",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

paparazzi.snapshot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
}

Expand All @@ -39,7 +40,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
}

Expand All @@ -51,7 +53,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
tint = Color.Magenta)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class RTLInstructionViewTests {
text = "ادمج يسارًا",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

paparazzi.snapshot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class FerrostarCoreTest {
text = "Sail straight",
maneuverType = ManeuverType.DEPART,
maneuverModifier = ManeuverModifier.STRAIGHT,
roundaboutExitDegrees = null)
roundaboutExitDegrees = null,
laneInfo = null)
private val mockRoute =
Route(
geometry = mockGeom,
Expand All @@ -117,6 +118,7 @@ class FerrostarCoreTest {
VisualInstruction(
primaryContent = instructionContent,
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)),
spokenInstructions = listOf(),
duration = 0.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ fun NavigationState.Companion.pedestrianExample(): NavigationState {
text = "Head east",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 0.0,
),
spokenInstruction = null,
Expand Down
7 changes: 5 additions & 2 deletions apple/Sources/FerrostarCore/Mock/MockNavigationState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ public extension NavigationState {
text: "Hyde Street",
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil, triggerDistanceBeforeManeuver: 42.0
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 42.0
),
],
spokenInstructions: [],
Expand Down
4 changes: 3 additions & 1 deletion apple/Sources/FerrostarSwiftUI/TestFixtureFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct VisualInstructionContentFactory: TestFixtureFactory {
text: textBuilder(n),
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
)
}
}
Expand All @@ -53,6 +54,7 @@ struct VisualInstructionFactory: TestFixtureFactory {
VisualInstruction(
primaryContent: primaryContentBuilder(n),
secondaryContent: secondaryContentBuilder(n),
subContent: nil,
triggerDistanceBeforeManeuver: 42.0
)
}
Expand Down
22 changes: 16 additions & 6 deletions apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ public struct InstructionsView: View {
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand All @@ -174,9 +177,11 @@ public struct InstructionsView: View {
text: "Use the second exit to leave the roundabout.",
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand All @@ -187,9 +192,11 @@ public struct InstructionsView: View {
text: "Links einfädeln.",
maneuverType: .merge,
maneuverModifier: .slightLeft,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: germanFormatter,
Expand All @@ -202,14 +209,17 @@ public struct InstructionsView: View {
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand Down
Loading

0 comments on commit 359ec90

Please sign in to comment.