DataInputsManager
The DataInputsManager
is used to feed external sensor data (like odometry, GNSS, and gyroscope data) into the Navigation SDK, improving navigation accuracy.
SDK Installation
DataInputsManager
is a private SDK. Contact us to request access.1. Configure credentials and set up repositories
Refer to the Mapbox Navigation SDK Installation Guide for more information on how to properly configure credentials and set up repositories to access SDK artifacts.
2. Add the dependency
Add the library dependency to your build.gradle
. The library version matches Navigation SDK version, they have the same release cadence. This way, you should not worry about versions compatibility, alight versions of the both SDK's and that would work.
dependencies {
implementation "com.mapbox.navigationcore:datainputs:3.5.2"
}
Integrate DataInputsManager
DataInputsManager
API is in a preview state and has a high chance of being changed in the future.DataInputsManager
SDK consists of one main entry point where sensor signals should be passed - DataInputsManager
. To create an instance of the DataInputsManager
, call DataInputsManager.create()
and pass an instance of the MapboxNavigation
. Note that the lifecycle of the MapboxNavigation
instance must exceed that of the DataInputsManager
, in particular, MapboxNavigation
should not be destroyed while the DataInputsManager
is still in use.
val navigationOptions = NavigationOptions.Builder(applicationContext)
.build()
val mapboxNavigation = MapboxNavigationProvider.create(navigationOptions)
val dataInputsManager = DataInputsManager.create(mapboxNavigation)
Once you have the instance, you can start updating sensor data as it becomes available. The class offers various methods to update different types of sensor data:
updateOdometryData(data: OdometryData)
– Updates the system with odometry data.updateRawGnssData(data: RawGnssData)
– Updates with GNSS data.updateCompassData(data: CompassData)
– Updates with compass data.updateSpeedData(data: SpeedData)
– Updates with vehicle speed data.updateOrientationData(data: OrientationData)
– Updates with orientation data.updateRawGyroscopeData(data: RawGyroscopeData)
– Updates with gyroscope data.updateRawAccelerometerData(data: RawAccelerometerData)
– Updates with accelerometer data.updateRawGravityData(data: RawGravityData)
– Updates with gravity data.updateImuTemperatureData(data: ImuTemperatureData)
– Updates with IMU temperature data.updateAltimeterData(data: AltimeterData)
– Updates with altimeter data.updateEtcGateInfo(info: EtcGateInfo)
– Updates with ETC gate information.updateRawLocation(location: Location)
– Updates the input service with a raw location.
For example, to update the vehicle speed, you can call
dataInputsManager.updateSpeedData(SpeedData(50.kph, System.nanoTime()))