Skip to content

Commit

Permalink
Migrate to NN 201.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Jan 23, 2024
1 parent ad77e78 commit 36966f2
Show file tree
Hide file tree
Showing 36 changed files with 258 additions and 324 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ allprojects {
// we allow access to snapshots repo if ALLOW_SNAPSHOT_REPOSITORY is set, what means we are running on CI
// with Navigation Native forced to be some snapshot version
// if you need to use snapshots while development, just set `addSnapshotsRepo` to true manually
def addSnapshotsRepo = true//project.hasProperty('ALLOW_SNAPSHOT_REPOSITORY') ? project.property('ALLOW_SNAPSHOT_REPOSITORY') : (System.getenv("ALLOW_SNAPSHOT_REPOSITORY")?.toBoolean() ?: false)
def addSnapshotsRepo = project.hasProperty('ALLOW_SNAPSHOT_REPOSITORY') ? project.property('ALLOW_SNAPSHOT_REPOSITORY') : (System.getenv("ALLOW_SNAPSHOT_REPOSITORY")?.toBoolean() ?: false)
if (addSnapshotsRepo) {
println("Snapshot repository reference added.")
maven {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import com.mapbox.navigation.base.route.RouterFailure
import com.mapbox.navigation.base.route.RouterOrigin
import com.mapbox.navigation.core.MapboxNavigation
import com.mapbox.navigation.core.MapboxNavigationProvider
import com.mapbox.navigation.core.adasis.AdasisConfig
import com.mapbox.navigation.core.adas.AdasisConfig
import com.mapbox.navigation.core.adas.AdasisDataSendingConfig
import com.mapbox.navigation.core.adas.AdasisMessageBinaryFormat
import com.mapbox.navigation.core.directions.session.RoutesObserver
import com.mapbox.navigation.core.replay.MapboxReplayer
import com.mapbox.navigation.core.replay.ReplayLocationEngine
Expand Down Expand Up @@ -121,7 +123,7 @@ class AdasisActivity : AppCompatActivity() {
routeLineView.renderRouteDrawData(mapboxMap.getStyle()!!, this)
}
}
isNavigating = true
isNavigating = result.navigationRoutes.isNotEmpty()
startSimulation(result.navigationRoutes[0].directionsRoute)
}
}
Expand Down Expand Up @@ -280,16 +282,20 @@ class AdasisActivity : AppCompatActivity() {
mapboxNavigation.registerRouteProgressObserver(routeProgressObserver)
mapboxNavigation.registerRouteProgressObserver(replayProgressObserver)

mapboxNavigation.setAdasisMessageCallback(
AdasisConfig.Builder().build()
) { messageBuffer, context ->
val dataSendingConfig = AdasisDataSendingConfig.Builder(
AdasisMessageBinaryFormat.FlatBuffers,
).build()

mapboxNavigation.setAdasisMessageObserver(
AdasisConfig.Builder(dataSendingConfig).build()
) { messageBuffer ->
this@AdasisActivity.runOnUiThread {
// TODO decode buffer and print data
adasisMessagesLog += "${numberOfMessages++}: ${messageBuffer.size} bytes\n"
binding.adasisMsgLog.text = adasisMessagesLog
binding.scrollContainer.fullScroll(View.FOCUS_DOWN)

Log.d(TAG, "Adasis message: $messageBuffer, context: $context")
Log.d(TAG, "Adasis message: $messageBuffer")
}
}
}
Expand All @@ -302,7 +308,7 @@ class AdasisActivity : AppCompatActivity() {
mapboxNavigation.unregisterLocationObserver(locationObserver)
mapboxNavigation.unregisterRouteProgressObserver(routeProgressObserver)
mapboxNavigation.unregisterRouteProgressObserver(replayProgressObserver)
mapboxNavigation.resetAdasisMessageCallback()
mapboxNavigation.resetAdasisMessageObserver()
}

override fun onDestroy() {
Expand Down
14 changes: 7 additions & 7 deletions gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ ext {
}

def getVersionName() {
// if (project.hasProperty('VERSION_NAME')) {
// return project.property('VERSION_NAME')
// }
// def prefix = project.ext.releaseTagPrefix
// def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
// def version = cmd.execute().text
return "2.19.0-preview.1-SNAPSHOT"
if (project.hasProperty('VERSION_NAME')) {
return project.property('VERSION_NAME')
}
def prefix = project.ext.releaseTagPrefix
def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
def version = cmd.execute().text
return project.ext.snapshot ? getSnapshotVersion(version) : getReleaseVersion(version)
}

def getReleaseVersion(String version) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
// version which we should use in this build
def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION")
if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') {
mapboxNavigatorVersion = 'nio-adas-lpo-flatbuffers-vectors-13-SNAPSHOT'
mapboxNavigatorVersion = '201.0.0'
}
println("Navigation Native version: " + mapboxNavigatorVersion)
def androidXWorkManagerVersion = project.hasProperty('WORK_MANAGER_VERSION') ? project.property('WORK_MANAGER_VERSION') : '2.7.0'
Expand Down
Loading

0 comments on commit 36966f2

Please sign in to comment.