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

NAVAND-1166: add snapshot logs #6952

Draft
wants to merge 3 commits into
base: release-v2.7
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ workflows:
only:
- main
- release-v.*
- NAVAND-1166-dd-logs
- release:
filters:
tags:
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=mapbox
POM_DEVELOPER_NAME=Mapbox

ALLOW_SNAPSHOT_REPOSITORY=true

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
Expand Down
2 changes: 1 addition & 1 deletion gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
mapboxArtifactLicenseUrl = 'https://www.mapbox.com/legal/tos/'
snapshot = project.hasProperty("snapshot") ? project.property("snapshot").toBoolean() : false
releaseTagPrefix = project.hasProperty('RELEASE_TAG_PREFIX') ? project.property('RELEASE_TAG_PREFIX') : 'v'
versionName = getVersionName()
versionName = '2.7.2-logged-SNAPSHOT'
}

def getVersionName() {
Expand Down
7 changes: 6 additions & 1 deletion libnavui-maps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ dependencies {
implementation project(":libnavui-resources")

api dependenciesList.mapboxMapSdk
api("com.mapbox.maps:android-core") {
version {
strictly '10.7.0-a34a63fde5-SNAPSHOT'
}
}
api dependenciesList.mapboxSdkTurf

implementation dependenciesList.androidXAppCompat
Expand All @@ -63,7 +68,7 @@ dokkaHtmlPartial {
moduleName.set("UI Maps")
dokkaSourceSets {
configureEach {
reportUndocumented.set(true)
reportUndocumented.set(false)
perPackageOption {
matchingRegex.set("com.mapbox.navigation.ui.maps.internal.*")
suppress.set(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.mapbox.navigation.ui.maps.camera.data.debugger.MapboxNavigationViewpo
import com.mapbox.navigation.ui.maps.camera.utils.normalizeBearing
import com.mapbox.navigation.utils.internal.ifNonNull
import com.mapbox.navigation.utils.internal.logE
import com.mapbox.navigation.utils.internal.logI
import com.mapbox.navigation.utils.internal.logW
import com.mapbox.navigation.utils.internal.toPoint
import java.util.concurrent.CopyOnWriteArraySet
Expand Down Expand Up @@ -270,6 +271,10 @@ class MapboxNavigationViewportDataSource(
* to control the camera in scenarios like free drive where the maneuver points are not available.
*/
var followingPadding: EdgeInsets = EMPTY_EDGE_INSETS
set(value) {
field = value
logI("followingPadding: $value")
}
private var appliedFollowingPadding = followingPadding

/**
Expand All @@ -279,6 +284,10 @@ class MapboxNavigationViewportDataSource(
* or its remainder if [onRouteProgressChanged] is also available, and the [additionalPointsToFrameForOverview].
*/
var overviewPadding: EdgeInsets = EMPTY_EDGE_INSETS
set(value) {
field = value
logI("overviewPadding: $value")
}

private var additionalPointsToFrameForFollowing: List<Point> = emptyList()
private var additionalPointsToFrameForOverview: List<Point> = emptyList()
Expand Down Expand Up @@ -333,6 +342,10 @@ class MapboxNavigationViewportDataSource(
* @see [getViewportData]
*/
fun evaluate() {
logI("evaluate; options: $options")
logI("evaluate; followingPadding: $followingPadding")
logI("evaluate; overviewPadding: $overviewPadding")

updateFollowingData()
updateOverviewData()

Expand Down Expand Up @@ -412,6 +425,7 @@ class MapboxNavigationViewportDataSource(
* @see [evaluate]
*/
fun onRouteChanged(route: NavigationRoute) {
logI("onRouteChanged; route: ${route.id}", LOG_CATEGORY)
if (!route.directionsRoute.isSameRoute(navigationRoute?.directionsRoute)) {
clearRouteData()
this.navigationRoute = route
Expand Down Expand Up @@ -477,6 +491,9 @@ class MapboxNavigationViewportDataSource(
return
}

val stepProgress = routeProgress.currentLegProgress?.currentStepProgress
logI("onRouteProgressChanged; route: ${routeProgress.navigationRoute.id}, stepIndex=${stepProgress?.stepIndex}, distanceRemaining=${stepProgress?.distanceRemaining}", LOG_CATEGORY)

ifNonNull(
routeProgress.currentLegProgress,
routeProgress.currentLegProgress?.currentStepProgress
Expand Down Expand Up @@ -558,6 +575,7 @@ class MapboxNavigationViewportDataSource(
* Provide additional points that should be fitted into the following frame update.
*/
fun additionalPointsToFrameForFollowing(points: List<Point>) {
logI("additionalPointsToFrameForFollowing: $points", LOG_CATEGORY)
additionalPointsToFrameForFollowing = ArrayList(points)
}

Expand All @@ -577,6 +595,7 @@ class MapboxNavigationViewportDataSource(
* @see [evaluate]
*/
fun followingCenterPropertyOverride(value: Point?) {
logI("followingCenterPropertyOverride: $value", LOG_CATEGORY)
followingCenterProperty.override = value
}

Expand All @@ -589,6 +608,7 @@ class MapboxNavigationViewportDataSource(
* @see [evaluate]
*/
fun followingZoomPropertyOverride(value: Double?) {
logI("followingZoomPropertyOverride: $value", LOG_CATEGORY)
followingZoomProperty.override = value
}

Expand All @@ -601,6 +621,7 @@ class MapboxNavigationViewportDataSource(
* @see [evaluate]
*/
fun followingBearingPropertyOverride(value: Double?) {
logI("followingBearingPropertyOverride: $value", LOG_CATEGORY)
followingBearingProperty.override = value
}

Expand All @@ -613,6 +634,7 @@ class MapboxNavigationViewportDataSource(
* @see [evaluate]
*/
fun followingPitchPropertyOverride(value: Double?) {
logI("followingPitchPropertyOverride: $value", LOG_CATEGORY)
followingPitchProperty.override = value
}

Expand Down Expand Up @@ -699,6 +721,11 @@ class MapboxNavigationViewportDataSource(
// needs to be added here to be taken into account for bearing smoothing
pointsForFollowing.addAll(additionalPointsToFrameForFollowing)

logI(
"updateFollowingData; location: $localTargetLocation",
LOG_CATEGORY
)

if (pointsForFollowing.isEmpty()) {
options.followingFrameOptions.run {
val cameraState = mapboxMap.cameraState
Expand Down Expand Up @@ -734,6 +761,10 @@ class MapboxNavigationViewportDataSource(
options.followingFrameOptions.maximizeViewableGeometryWhenPitchZero &&
followingPitchProperty.get() == ZERO_PITCH
) {
logI(
"updateFollowingData; generating for maximal viewable area in pitch 0",
LOG_CATEGORY
)
mapboxMap.cameraForCoordinates(
pointsForFollowing,
followingPadding,
Expand All @@ -758,17 +789,37 @@ class MapboxNavigationViewportDataSource(
.pitch(followingPitchProperty.get())
.zoom(cameraState.zoom)
.build()
logI(
"updateFollowingData; fallbackCameraOptions: $fallbackCameraOptions",
LOG_CATEGORY
)
logI(
"updateFollowingData; map size: $mapSize, screenBox=$screenBox, resultingPadding=$padding",
LOG_CATEGORY
)
if (pointsForFollowing.size > 1) {
logI(
"updateFollowingData; generating for multiple points",
LOG_CATEGORY
)
mapboxMap.cameraForCoordinates(
pointsForFollowing,
fallbackCameraOptions,
screenBox
)
} else {
logI(
"updateFollowingData; generating for one point",
LOG_CATEGORY
)
fallbackCameraOptions
}
}

logI(
"updateFollowingData; generated cameraFrame: $cameraFrame",
LOG_CATEGORY
)
followingCenterProperty.fallback = cameraFrame.center!!
options.followingFrameOptions.run {
followingZoomProperty.fallback = max(min(cameraFrame.zoom!!, maxZoom), minZoom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class MapboxNavigationViewportDataSourceOptions internal constructor() {
* Options that impact generation of overview frames.
*/
val overviewFrameOptions = OverviewFrameOptions()

override fun toString(): String {
return "MapboxNavigationViewportDataSourceOptions(followingFrameOptions=$followingFrameOptions, overviewFrameOptions=$overviewFrameOptions)"
}
}

/**
Expand Down Expand Up @@ -179,6 +183,10 @@ class FollowingFrameOptions internal constructor() {
* Defaults to `20.0` meters.
*/
var minimumDistanceBetweenIntersections = 20.0

override fun toString(): String {
return "IntersectionDensityCalculation(enabled=$enabled, averageDistanceMultiplier=$averageDistanceMultiplier, minimumDistanceBetweenIntersections=$minimumDistanceBetweenIntersections)"
}
}

/**
Expand Down Expand Up @@ -218,6 +226,10 @@ class FollowingFrameOptions internal constructor() {
StepManeuver.OFF_RAMP,
StepManeuver.FORK
)

override fun toString(): String {
return "PitchNearManeuvers(enabled=$enabled, triggerDistanceFromManeuver=$triggerDistanceFromManeuver, excludedManeuvers=$excludedManeuvers)"
}
}

/**
Expand Down Expand Up @@ -253,6 +265,10 @@ class FollowingFrameOptions internal constructor() {
* Defaults to `100.0` meters.
*/
var distanceToFrameAfterManeuver = 100.0

override fun toString(): String {
return "FrameGeometryAfterManeuver(enabled=$enabled, distanceToCoalesceCompoundManeuvers=$distanceToCoalesceCompoundManeuvers, distanceToFrameAfterManeuver=$distanceToFrameAfterManeuver)"
}
}

/**
Expand All @@ -275,6 +291,10 @@ class FollowingFrameOptions internal constructor() {
* Defaults to `45.0` degrees.
*/
var maxBearingAngleDiff = 45.0

override fun toString(): String {
return "BearingSmoothing(enabled=$enabled, maxBearingAngleDiff=$maxBearingAngleDiff)"
}
}

/**
Expand All @@ -291,6 +311,10 @@ class FollowingFrameOptions internal constructor() {
require(y in 0.0..1.0) { "y value must be within [0.0..1.0] range" }
}
}

override fun toString(): String {
return "FollowingFrameOptions(defaultPitch=$defaultPitch, minZoom=$minZoom, maxZoom=$maxZoom, focalPoint=$focalPoint, maximizeViewableGeometryWhenPitchZero=$maximizeViewableGeometryWhenPitchZero, intersectionDensityCalculation=$intersectionDensityCalculation, pitchNearManeuvers=$pitchNearManeuvers, frameGeometryAfterManeuver=$frameGeometryAfterManeuver, bearingSmoothing=$bearingSmoothing, centerUpdatesAllowed=$centerUpdatesAllowed, zoomUpdatesAllowed=$zoomUpdatesAllowed, bearingUpdatesAllowed=$bearingUpdatesAllowed, pitchUpdatesAllowed=$pitchUpdatesAllowed, paddingUpdatesAllowed=$paddingUpdatesAllowed)"
}
}

/**
Expand Down Expand Up @@ -389,5 +413,13 @@ class OverviewFrameOptions internal constructor() {
* The factor has to be a positive integer.
*/
var simplificationFactor = 25

override fun toString(): String {
return "GeometrySimplification(enabled=$enabled, simplificationFactor=$simplificationFactor)"
}
}

override fun toString(): String {
return "OverviewFrameOptions(maxZoom=$maxZoom, geometrySimplification=$geometrySimplification, centerUpdatesAllowed=$centerUpdatesAllowed, zoomUpdatesAllowed=$zoomUpdatesAllowed, bearingUpdatesAllowed=$bearingUpdatesAllowed, pitchUpdatesAllowed=$pitchUpdatesAllowed, paddingUpdatesAllowed=$paddingUpdatesAllowed)"
}
}