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

Adasis functionality #7538

Merged
merged 11 commits into from
Jan 23, 2024
Merged

Adasis functionality #7538

merged 11 commits into from
Jan 23, 2024

Conversation

DzmitryFomchyn
Copy link
Contributor

Description

@DzmitryFomchyn DzmitryFomchyn added the skip changelog Should not be added into version changelog. label Sep 27, 2023
@github-actions
Copy link

github-actions bot commented Sep 27, 2023

Changelog

Features

  • Added Advanced Driver Assistance Systems (ADAS) functionality as an experimental API. [#7538](https://github.com/mapbox/mapbox-navigation-android/pull/7538)
  • Added NavigationViewApi#recenterCamera() that allows to programatically recenter the camera position as if the recenter button was clicked. [#7713](https://github.com/mapbox/mapbox-navigation-android/pull/7713)

Bug fixes and improvements

  • Fixed a bug with multiple instances of cache which resulted in excessive memory consumption. [#7688](https://github.com/mapbox/mapbox-navigation-android/pull/7688)
  • Improved Map Matching to avoid false deviation of the location puck to a parallel street. [#7694](https://github.com/mapbox/mapbox-navigation-android/pull/7694)
  • Improved handling of no storage available during navigation tiles downloading. [#7694](https://github.com/mapbox/mapbox-navigation-android/pull/7694)
  • Improved handling of invalid config in DeviceProfile#customConfig. [#7694](https://github.com/mapbox/mapbox-navigation-android/pull/7694)
  • Fixed a native crash in E-Horizon implementation caused by internal race condition. [#7694](https://github.com/mapbox/mapbox-navigation-android/pull/7694)
  • Fixed an issue where reroute for multi-leg routes used to fail in case waypoint_names or waypoint_targets parameters were specified without an explicit waypoint_indices parameter. [#7709](https://github.com/mapbox/mapbox-navigation-android/pull/7709)

Known issues ⚠️

Other changes

Android Auto Changelog

Features

Bug fixes and improvements

  • The app is now considered as the one in active navigation only when an active route is set to MapboxNavigation. Previously it was always considered active. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)
  • When Android Auto host tells the app to stop active navigation because another app starts navigating, now SDK will enter FreeDrive mode instead of stopping trip session completely. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 126 lines in your changes are missing coverage. Please review.

Comparison is base (dfbc743) 74.10% compared to head (36966f2) 74.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##               main    #7538    +/-   ##
==========================================
  Coverage     74.10%   74.11%            
- Complexity     6165     6252    +87     
==========================================
  Files           835      852    +17     
  Lines         33175    33672   +497     
  Branches       3957     4011    +54     
==========================================
+ Hits          24584    24955   +371     
- Misses         7055     7167   +112     
- Partials       1536     1550    +14     
Files Coverage Δ
...ava/com/mapbox/navigation/core/MapboxNavigation.kt 70.31% <100.00%> (+0.45%) ⬆️
.../navigation/core/adas/AdasisMessageBinaryFormat.kt 100.00% <100.00%> (ø)
...gation/navigator/internal/MapboxNativeNavigator.kt 0.00% <ø> (ø)
...avigation/core/NavigationSdkInformationProvider.kt 0.00% <0.00%> (ø)
...navigation/core/adas/AdasisConfigMessageOptions.kt 96.77% <96.77%> (ø)
...ox/navigation/core/adas/AdasisConfigPathOptions.kt 98.03% <98.03%> (ø)
...on/core/adas/AdasisConfigProfileLongTypeOptions.kt 97.50% <97.50%> (ø)
...n/core/adas/AdasisConfigProfileShortTypeOptions.kt 98.30% <98.30%> (ø)
...x/navigation/core/adas/AdasisProfileLongOptions.kt 96.55% <96.55%> (ø)
.../navigation/core/adas/AdasisProfileShortOptions.kt 96.55% <96.55%> (ø)
... and 11 more

@dzinad
Copy link
Contributor

dzinad commented Sep 28, 2023

Approved for snapshot, but before merging we still have some follow-up to do.

@dzinad dzinad force-pushed the df-adasis-preview branch from 59f2311 to 092542c Compare October 19, 2023 10:03
@dzinad dzinad force-pushed the df-adasis-preview branch 2 times, most recently from 8a13250 to b71478d Compare January 12, 2024 19:16
@DzmitryFomchyn DzmitryFomchyn force-pushed the df-adasis-preview branch 3 times, most recently from d22dfce to 08b55d3 Compare January 16, 2024 18:56
@DzmitryFomchyn DzmitryFomchyn marked this pull request as ready for review January 16, 2024 18:57
@DzmitryFomchyn DzmitryFomchyn requested a review from a team as a code owner January 16, 2024 18:57
@DzmitryFomchyn DzmitryFomchyn changed the title Adasis preview Adasis functionality Jan 16, 2024
@DzmitryFomchyn
Copy link
Contributor Author

DzmitryFomchyn commented Jan 16, 2024

Changelog since 2.19.0-preview.1-SNAPSHOT:

  • Package com.mapbox.navigation.core.adasis has been renamed to com.mapbox.navigation.core.adas
  • AdasisConfig, AdasisConfigDataSending, AdasisConfigMessageOptions, AdasisConfigPathOptions, AdasisConfigProfileLongTypeOptions, AdasisConfigProfileShortTypeOptions, ProfileLong, ProfileShort, Segment, Stub constructors are private now. Use corresponding builder classes for object instantiation.
  • Now AdasisConfig.Builder requires dataSendingConfig property via constructor
  • ADASISv2MessageCallback has been renamed to AdasisV2MessageObserver
  • ProfileLong has been renamed to AdasisProfileLongOptions
  • ProfileShort has been renamed to AdasisProfileShortOptions
  • Segment has been renamed to AdasisSegmentOptions
  • Stub has been renamed to AdasisStubOptions
  • AdasisConfigDataSending has been renamed to AdasisDataSendingConfig
  • EdgeAdasAttributes has been renamed to AdasEdgeAttributes
  • SpeedLimitInfo has been renamed to AdasSpeedLimitInfo
  • SpeedLimitRestriction has been renamed to AdasSpeedLimitRestriction
  • ValueOnEdge has been renamed to AdasValueOnEdge
  • AdasisSpeedLimitInfo.Type has been renamed to AdasSpeedLimitInfo.SpeedLimitType. Internal subclasses have been replaced by Int values and grouped into @IntDef
  • Internal subclasses of AdasSpeedLimitRestriction.VehicleType has been replaced by Int values and grouped into @IntDef
  • SensorData.Weather.Condition has been renamed to SensorData.Weather.ConditionType. Internal subclasses have been replaced by Int values and grouped into @IntDef
  • AdasSpeedLimitRestriction.weather has been renamed to weatherConditionTypes

Copy link
Member

@0xDAD 0xDAD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only these put in red frame are Adasis related
image
The rest is just Adas

@DzmitryFomchyn DzmitryFomchyn requested a review from 0xDAD January 22, 2024 23:46
gradle/artifact-settings.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
gradle/dependencies.gradle Outdated Show resolved Hide resolved
* @param callback Message callback
*/
@ExperimentalPreviewMapboxNavigationAPI
fun setAdasisMessageCallback(adasisConfig: AdasisConfig, callback: AdasisV2MessageCallback) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a one-shot callback, right? If that's true, we call things like this observer, not callback.
Also maybe to register/unregister, as for all other observers we have. We also allow to unregister one specific observer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, we definately shold rename it to observer.

Also maybe to register/unregister, as for all other observers we have. We also allow to unregister one specific observer.

We can't do as we did with other observers because NN requires AdasisConfig and if we registered an observer with config1 we won't be able to register new observer with config2.

@0xDAD can we do anything with this? Can you think of use cases where customers might need to set multiple observers with different configs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not support multiple callbacks for adasis (and probably don't have to). ADASIS generation is enabled once user sets callback with corresponding config. What if end up with methods like startAdasisEhp(config, callback) and stopAdasisEhp()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already provide something like that. Ok, let's leave it as is for now.

*/
@ExperimentalPreviewMapboxNavigationAPI
class AdasisConfigProfileLongTypeOptions private constructor(
val lat: Boolean,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, would anyone actually need latitude without longitude or vice versa?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are different profiles so from adasis configuration perspective they are separate options

* @param messageBuffer Message buffer in format specified via [AdasisDataSendingConfig.messageBinaryFormat]
* @param context Additional context with metadata related to the current messages package
*/
fun onMessage(messageBuffer: List<Byte>, context: AdasisMessageContext)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expose any deserialization tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. If we're speaking about flat buffer format, deserialisation happens with 3rd party SDK and we probably shouldn't include it to our SDK. We agreed with NN that we can share deserialisation tools with customers who need it.

In case of need, we'll be able to add this functionality in future without breaking changes.

}

private fun Lane.toValue(): Value {
val str = "{\"currentLaneIndex\": $currentLaneIndex, \"laneCount\": $laneCount}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected that lane value is a json? Do we have some agreement on this? Value can also contain map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point, thanks for noticing!

@0xDAD could you please take a look? Any guarantee that this format won't be changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently we expect json like that

{"currentLaneIndex": 1, "laneCount": 3}

docs say:

Lane sensor:

  • value is an object with the following fields: {"currentLaneIndex": 1, "laneCount": 3}
  • For right-hand traffic 1 is the very right lane and so on
  • currentLaneIndex == 0 means that lane information is not available

It may change or it may become deprecated. Depends on how NIO uses it. I'd leave that in the form of arbitrary json object just to make it as flexible as possible but it's up to you do decide

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xDAD On platform side we accept object, not json and we convert object to json when ween to pass it from platform to C++ side.

There might be issues if you change expected json format and don't notify us, so this solution doesn't look like reliable. Makes sense to consider changing it on NN side.

@DzmitryFomchyn DzmitryFomchyn merged commit ff95d8c into main Jan 23, 2024
38 of 43 checks passed
@DzmitryFomchyn DzmitryFomchyn deleted the df-adasis-preview branch January 23, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Should not be added into version changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants