-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add data inputs example for compass #67
base: main
Are you sure you want to change the base?
Conversation
a876478
to
d5d4b01
Compare
@Zayankovsky ptal. |
sampleSensorEventManager?.compassData?.observeWhenStarted(this) { | ||
if (enabled) { | ||
Log.d(TAG, "Updating compass data: $it") | ||
Dash.controller.updateCompassData(it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to reset the data when the switch is unchecked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
dd0dee1
to
1a570a6
Compare
bindSwitch( | ||
switch = menuBinding.customCompassDataInputs, | ||
state = setCustomCompassDataInputs, | ||
) { enabled -> | ||
sampleSensorEventManager?.compassData?.observeWhenStarted(this) { | ||
if (enabled) { | ||
Log.d(TAG, "Updating compass data: $it") | ||
Dash.controller.updateCompassData(it) | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bindSwitch( | |
switch = menuBinding.customCompassDataInputs, | |
state = setCustomCompassDataInputs, | |
) { enabled -> | |
sampleSensorEventManager?.compassData?.observeWhenStarted(this) { | |
if (enabled) { | |
Log.d(TAG, "Updating compass data: $it") | |
Dash.controller.updateCompassData(it) | |
} | |
} | |
} |
The UXF SDK exposes DataInputsManager interface to allow a client to send sensor data coming from a device (or vehicle) to the UXF navigation engine.
Today, this data is supported by the mentioned API:
In order to have access to DataInputsManager you should:
implementation("com.mapbox.navigationux:data-inputs:1.0.0-beta.37.1")
This PR shows how compass data from an android device can be passed to data input manager.