Skip to content

Question about route progress updates #79

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

Open
beto-alves opened this issue Sep 7, 2023 · 6 comments
Open

Question about route progress updates #79

beto-alves opened this issue Sep 7, 2023 · 6 comments

Comments

@beto-alves
Copy link

Is there a way to force instructions to jump into determined route lag and step based on the current user's location?
In our current project, we have a fixed route situation, like a delivery route from a warehouse to the factory for example. And for some scenarios, the user might be alongside and off route.
The problem is when the user goes in the route and start the trip, we are not receiving the updates in the instruction view, I already debugged the NavigationRouteProcessor, NavigationHelper and OffRouteDetector.
In this case the NavigationIndices are not receiving any updates in the NavigationRouteProcessor.

In this case, Is there any approach to solve the instructions update?

@boldtrn
Copy link
Collaborator

boldtrn commented Sep 13, 2023

You can set the leg and step index from the OffRouteDetector using the methods in the OffRouteCallback which is registered there.

@beto-alves
Copy link
Author

beto-alves commented Sep 13, 2023

Hi @boldtrn thanks for your answer!

I have researched the usage of the OffRouteCallback you mentioned in the OffRouteDetector. I found the onShouldIncreaseIndex() method but couldn't find any use of the onShouldUpdateToIndex() method, which I believe would be suitable in this context.

I also investigated the OffRouteCallback and discovered that it can only be utilized within the OffRouteDetector. Unfortunately, it's not possible to use it with a custom off-route engine because the setOffRouteDetectorCallback method in NavigationHelper has a type check, limiting its compatibility to the OffRouteDetector.

So, I see two potential solutions: either modify the OffRouteDetector to accommodate this case or expose the setOffRouteCallback method, which is currently exclusive to the OffRouteDetector, to the OffRoute abstract class. This would enable the use of the callback with a custom off-route engine, which I believe is the optimal way to address this issue.

What are your thoughts on this? Do you think it's feasible to expose these methods? If yes, I'd be glad to create a pull request and contribute to this improvement.

@boldtrn
Copy link
Collaborator

boldtrn commented Sep 14, 2023

has a type check, limiting its compatibility to the OffRouteDetector

I think you can extend the OffRouteDetector and this will work.

modify the OffRouteDetector to accommodate this case or expose the setOffRouteCallback method

I think this is something we could add, this would make the code easier as well. Feel free to open a PR for this.

@beto-alves
Copy link
Author

Yes, extending the OffRouteDetector should also work.
I will work on this and submit a pull request to expose the methods. Thank you for your support!

@boldtrn
Copy link
Collaborator

boldtrn commented Sep 14, 2023

Just to clarify, I think it would make sense to add setOffRouteDetectorCallback method to the abstract class OffRoute. I am not sure we should expose the method onShouldIncreaseIndex publicly, as this is kind of a corner case of OffrouteDetection.

@beto-alves
Copy link
Author

Yes, that's the approach I would take.
Adding setOffRouteDetectorCallback to OffRoute makes more sense than altering the visibility of onShouldIncreaseIndex.

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

No branches or pull requests

2 participants