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

History reader #4194

Merged
merged 7 commits into from
Oct 13, 2022
Merged

History reader #4194

merged 7 commits into from
Oct 13, 2022

Conversation

Udumft
Copy link
Contributor

@Udumft Udumft commented Oct 11, 2022

Description

Adding history reader feature to improve debugging capabilities and to support feature parity between platforms.

Implementation

Implementation is based on NN.HistoryReader which is designed to read pbf history files. Added several convenience wrapper methods to access contents as well as convenience initializers to simplify history replay setup, including free drive and AG scenarios.

@Udumft Udumft self-assigned this Oct 11, 2022
@Udumft Udumft force-pushed the vk/NAVIOS-666-history-reader branch from db1c229 to e72535f Compare October 11, 2022 11:36
@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

RouteProgress

  • removed method: init(route:options:legIndex:spokenInstructionIndex:) in RouteProgress

RouteLegProgress

  • removed method: init(leg:stepIndex:spokenInstructionIndex:) in RouteLegProgress

@Udumft Udumft marked this pull request as ready for review October 11, 2022 13:04
@Udumft Udumft requested a review from a team October 11, 2022 13:04

/// Provides event-by-event access to history files contents.
///
/// Supports `pbf.gz` files.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the file extension for a compressed protocol buffer. This same file extension represent a Mapbox vector tile, a raw OSM extract, or a completely arbitrary data structure. We should be more specific, but what more can we say about the expected file format, assuming the format isn’t officially stable yet?

For what it’s worth, I think it would be wonderful if at some point we could publish the .proto file somewhere and generate support code via swift-protobuf. That would give developers the ability to introspect these files without us having to essentially reverse-engineer the format within this SDK.

self.init(indexedRouteResponse: routeResponse,
customRoutingProvider: customRoutingProvider,
credentials: credentials,
locationSource: ReplayLocationManager(historyFileDump: historyFileDump),
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! This is exactly the original vision behind introducing ReplayLocationManager in the first place. But how important is it to provide this convenience initializer versus expecting developers to compose ReplayLocationManager(historyFileDump:) with the existing initializer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking that this convenience init would help to configure replaying. It may go a bit beyond simply simulating coordinates stream, as replay probably should also restore RouteOptions or other configuration as it was recorded...

Comment on lines 117 to 118
default:
break
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add support for the other HistoryRecordTypes, GetStatus and PushHistory? At a glance, it doesn’t seem as useful as the two you’ve hooked up above, but then we should open a ticket to track that as tail work, for completeness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added them as internal objects. They make next to 0 sense to users. We are not exposing navigation status publicly in RouteController so we shouldn't do it here too, and push history event parameters are cryptic even to myself.
I think current approach will allow to introduce new types of events if they arrive later.

@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

RouteProgress

  • removed method: init(route:options:legIndex:spokenInstructionIndex:) in RouteProgress

RouteLegProgress

  • removed method: init(leg:stepIndex:spokenInstructionIndex:) in RouteLegProgress

@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

RouteProgress

  • removed method: init(route:options:legIndex:spokenInstructionIndex:) in RouteProgress

RouteLegProgress

  • removed method: init(leg:stepIndex:spokenInstructionIndex:) in RouteLegProgress

@Udumft Udumft requested review from 1ec5, S2Ler and a team October 12, 2022 14:57
@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

RouteProgress

  • removed method: init(route:options:legIndex:spokenInstructionIndex:) in RouteProgress

RouteLegProgress

  • removed method: init(leg:stepIndex:spokenInstructionIndex:) in RouteLegProgress

@Udumft Udumft merged commit b5dc0e2 into main Oct 13, 2022
@Udumft Udumft deleted the vk/NAVIOS-666-history-reader branch October 13, 2022 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants