Skip to content

Commit

Permalink
Bump NN; Support treeTrailingLength
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Feb 22, 2024
1 parent 1ea5569 commit 1ed11b2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def getVersionName() {
// def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
// def version = cmd.execute().text
// return project.ext.snapshot ? getSnapshotVersion(version) : getReleaseVersion(version)
return "2.19.0-adas-reconstructor-1-SNAPSHOT"
return "2.19.0-adas-reconstructor-2-SNAPSHOT"
}
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 = 'public-reconstructor-snapshot-33-SNAPSHOT'
mapboxNavigatorVersion = 'public-reconstructor-snapshot-35-SNAPSHOT'
}
println("Navigation Native version: " + mapboxNavigatorVersion)
def androidXWorkManagerVersion = project.hasProperty('WORK_MANAGER_VERSION') ? project.property('WORK_MANAGER_VERSION') : '2.7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
* @param enableRetransmission if true, retransmission will be enabled
* (package will be appended with retransmission data, messages from previous cycles)
* @param retransmissionMeters after passing this distance, messages will not be retransmitted
* @throws treeTrailingLength the trailing length of the path tree, relatively
* to the map-matched position, in the adasis provider
*/
@ExperimentalPreviewMapboxNavigationAPI
class AdasisDataSendingConfig private constructor(
Expand All @@ -21,6 +23,7 @@ class AdasisDataSendingConfig private constructor(
val metadataCycleSeconds: Int,
val enableRetransmission: Boolean,
val retransmissionMeters: Int,
val treeTrailingLength: Int,
) {

/**
Expand All @@ -32,6 +35,7 @@ class AdasisDataSendingConfig private constructor(
.metadataCycleSeconds(metadataCycleSeconds)
.enableRetransmission(enableRetransmission)
.retransmissionMeters(retransmissionMeters)
.treeTrailingLength(treeTrailingLength)

@JvmSynthetic
internal fun toNativeAdasisConfigDataSending(): com.mapbox.navigator.AdasisConfigDataSending {
Expand All @@ -42,6 +46,7 @@ class AdasisDataSendingConfig private constructor(
metadataCycleSeconds,
enableRetransmission,
retransmissionMeters,
treeTrailingLength,
)
}

Expand All @@ -59,7 +64,8 @@ class AdasisDataSendingConfig private constructor(
if (messagesInPackage != other.messagesInPackage) return false
if (metadataCycleSeconds != other.metadataCycleSeconds) return false
if (enableRetransmission != other.enableRetransmission) return false
return retransmissionMeters == other.retransmissionMeters
if (retransmissionMeters != other.retransmissionMeters) return false
return treeTrailingLength == other.treeTrailingLength
}

/**
Expand All @@ -72,6 +78,7 @@ class AdasisDataSendingConfig private constructor(
result = 31 * result + metadataCycleSeconds.hashCode()
result = 31 * result + enableRetransmission.hashCode()
result = 31 * result + retransmissionMeters.hashCode()
result = 31 * result + treeTrailingLength.hashCode()
return result
}

Expand All @@ -86,7 +93,8 @@ class AdasisDataSendingConfig private constructor(
"messagesInPackage=$messagesInPackage, " +
"metadataCycleSeconds=$metadataCycleSeconds, " +
"enableRetransmission=$enableRetransmission, " +
"retransmissionMeters=$retransmissionMeters" +
"retransmissionMeters=$retransmissionMeters," +
"treeTrailingLength=$treeTrailingLength" +
")"
}

Expand All @@ -102,6 +110,7 @@ class AdasisDataSendingConfig private constructor(
private var metadataCycleSeconds: Int = 5
private var enableRetransmission: Boolean = true
private var retransmissionMeters: Int = 300
private var treeTrailingLength: Int = 100

/**
* Interval between sending messages in milliseconds
Expand Down Expand Up @@ -139,6 +148,14 @@ class AdasisDataSendingConfig private constructor(
this.retransmissionMeters = retransmissionMeters
}

/**
* The trailing length of the path tree, relatively to the map-matched position,
* in the adasis provider
*/
fun treeTrailingLength(treeTrailingLength: Int) = apply {
this.treeTrailingLength = treeTrailingLength
}

/**
* Build the [AdasisDataSendingConfig]
*/
Expand All @@ -149,6 +166,7 @@ class AdasisDataSendingConfig private constructor(
metadataCycleSeconds = metadataCycleSeconds,
enableRetransmission = enableRetransmission,
retransmissionMeters = retransmissionMeters,
treeTrailingLength = treeTrailingLength,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AdasisConfigTest : BuilderTest<AdasisConfig, AdasisConfig.Builder>() {
.metadataCycleSeconds(300)
.enableRetransmission(false)
.retransmissionMeters(400)
.treeTrailingLength(500)
.build()

val messageOptions = AdasisConfigMessageOptions.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class AdasisDataSendingConfigTest :
.metadataCycleSeconds(300)
.enableRetransmission(false)
.retransmissionMeters(400)
.treeTrailingLength(500)
}

override fun trigger() {
Expand Down

0 comments on commit 1ed11b2

Please sign in to comment.