Rerouting in Skobbler Map - android

I am trying to resume navigation in the route that is cached but I could hardly find any method which could perform that feature in SKmaps. Therefore I am trying to customize the rerouting technique so that the user will be navigated to the same route.
Is there any way to perform custom rerouting in skobbler map?
This question is similar to the one posted in SKForum

What do you mean by "resume navigation in the cached" route? Are you referring to the saveRouteToCache and loadRouteFromCache APIs? (details here)
A rerouting call is triggered whenever the navigation engine detects that you are no longer following the route - i.e. you've been "matched" to a street/street segment that is not part of the original route. When recalculating the route, the same route settings used for the original route calculation are used (same end point, same routing profile, same via points) - the only difference being the start position (which is you current position).
In the scenario you have described on the forums you are calculating a route from a list of points and I'm assuming that you are starting to navigate on that particular route. Once you start moving I'm assuming that the navigation engine detects that you are not on the route (cannot really tell without looking at your input data) and triggers a rerouting call - at that time the routing engine attempts to create a route from your current position to the initial route and fails.
If you'd like to stop the rerouting logic, when you receive the call to onReRoutingStarted, call stopNavigation and trigger a route recalculation with your own routing engine.

Related

DJI SDK: Pause/Resume Waypoint mission when arriving on point?

I haven't found any info on this. I'd like to build a waypoint mission like this:
drone arrives at waypoint
whole mission pauses, notifies the user (is there a listener for waypoints?)
app goes to another activity to take photo
user comes back from photo activity
user presses button, mission continues to next waypoint.
I see the waypoint actions but it's not exactly what I'd like to achieve. I'd like to let the user control the mission manually, but have the option to do things like skip waypoints, but also to go to another activity while the drone is waiting at a waypoint.
Any tips on this?
Thanks
This answer pertains specifically to the android SDK, but similar concepts exist for the iOS SDK as well.
In Android, waypoint missions are created and controlled through the WaypointMissionOperator class. Instances of this class allow for setting a listener through the addListener method that will be called when updated aircraft state is available. The onExecutionUpdate method of the WaypointMissionOperatorListener that you pass to that method will receive a WaypointMissionExecutionEvent. This object has a getProgress method which will give you information on the state of the mission that you need (
targetWaypointIndex and isWaypointReached).
To pause the mission at a specific waypoint, you may want to add a hold at the waypoint. This allows your software running on the mobile device time to detect that the aircraft has reached the waypoint and send a mission pause command.
The rest of your question gets into a bit of design philosophy which is a bit out of scope for stackoverflow, but feel free to contact me directly.

HERE Android SDK NavigateManager simulate without Map is not giving maneuvers

I am using the HERE Android SDK embedded in a QT application, and am trying to do turn by turn directions simulated, but without a map display. There is no Map or MapFragment in my app, I'm using the MapEngine and NavigationManager directly. And I am initializing the map engine on the main UI thread, as that is recommended (not sure if that could be an issue here).
I am able to initialize the map engine, create the route and dump it successfully. However, when I use NavigationManager to simulate the route, I can see navigation movement (the coordinates in position updates progressing). However, I have ManeuverEventListeners and NewInstructionEventListeners, and they are never called.
And in my position listener, if I call getNextManeuverDistance() or getETA() I get error responses. All other functions had success, and the simulated navigation will complete eventually (at the expected time) but without ever delivering any instructions.
I have the same code working fine in a sample app, but running in the QT framework I'm never getting valid distances or maneuvers. In the API reference it says getNextManeuver() will return null (and get distance returns MAX_INT) if the next maneuver is not available yet. What can be causing this?
Is it valid to run this in an app without a Map nor a MapFragment? Any ideas why NavigateManager simulate would act this way?
Yes, I eventually figured out that the map data must be manually preloaded. Seems that calculating the route is not enough, and the data fetching is normally done by the map view, and the navigation manager is just waiting for the map data.
In my case, as soon as I have a calculated route I start the mMapDataPrefetcher.fetchMapData(route,radius), and then immediately start the mNavigationManager.simulate(route,speed). The navigation is a little wonky until the map data is loaded, but starts responding immediately after the map loading is complete. The loading can be slow in some of my testing, not sure why. But in frequent uses, the map data is often already present, so works better in that case.
I'm not sure what a good radius is; I tried 500m and the call failed; 2000m is working for me right now.
See the pages here:
https://developer.here.com/documentation/android-premium/topics/map-data.html
https://developer.here.com/documentation/android-premium/topics/maps-offline.html
These features are described as beta, so I'm not sure if there is any way to do this in a supported, production fashion.

Android Google Maps Directions: how to avoid wrong routes, when gps points to the other side of road

I'm developing a gps tracking system that sends it's coordinates to my phone through a server. The only problem with this system is that the gps can't always be precise and it fails a few meters. This means it could point to the opposite side of road while driving. And when i want to route these coordinates, instead of routing properly, it gives back a wrong route.
I'm curious about this problem. I haven't find any parameters in the Directions Url that could switch off rules of the road. That would be great in this situation. Maybe is there any solution?
The method i'm using is that i make a query on my server, it gives back coordinates, then i route the first coordinate with the second, the second with the third and so an. (based on time stamp)
I hope i wrote down clearly my problem. Although i felt unnecessary to post my code, on request i will update the post with that.
As you can see, on "Nyugati u." it should show only one route instead of two.
you need to snap your gps latlngs to polyline you get from directions api.
google does not track your previous request and just calculating route from origin you have provided.
You can calculate your current bearing and check if google directions result tooks you back and ignore it.
There are some methods to avoid gps jittering see
Android GPS Coordinates Scattered
https://github.com/Hypercubesoft/HCKalmanFilter

SKNavigationListener issues with event handling

I am developing an Android application using skobbler/telenav SDK also known as SKMaps. I am currently implementing a simple gps navigation system using SKRouteManager and SKNavigation manager and the corresponding Listeners. So far I have been able to set the destination for my navigation by geocoding postcodes into gps locations using the google api. I also have alternative routes and the onReRoutingStarted() event of the SKNavigationListener is working right. However, I have a problem with onDestinationReached() - it seems like it does not get called when I reach my destination so my navigation does not stop. So if I keep driving and pass the destination point the app starts rerouting me again. Is there an issue with the onDestinationReached() or any special requirements when implementing it?
I thought it should work because it successfully calculates the route in the first place so it should know the destination point and I shouldnt have to specify it in any other way. But the method does not get called by the app when I reach the end of the route.
I have also encountered another issue with the SKNavigationListener events - onUpdateNavigationState(SKNavigationState navigationState). Inside the method I am trying to obtain some of the information the SKNavigationState object should be able to provide me with. The problems are as follows:
Eclipse cannot recognise the method getDistanceToDestination() - acts as if it is not defined inside the class SKNavigationState.
getCurrentAdviceCurrentStreetName() returns null
As far as I understand getCurrentAdviceDistanceToAdvice() should give me the distance to the point where I will receive another advice and getCurrentAdviceDistanceToDestination() should give me the remaining distance to the end point of the route. Both methods are supposed to return the distance in meters but they provide me with some really large numbers (more than a billion) when my route is only 5 kilometers long. Also, sometimes they return 0.
The onUpdateNavigationState(SKNavigationState navigation state) is supposed to get called multiple times while following the route and every time provide me with new information about the state of my navigation. It does get called multiple times but when I use the above methods they keep returning the same values (if I restart the application the values change but during a single test they give me the same values).
If anyone has any clue what could be going wrong. It is really confusing because I can successfully get the current speed from the SKNavigationState object using getCurrentSpeed(). But somehow some of the methods seem to not exist and others return values that dont make sense.
This issue was a bug on the 2.0.2 SDK version - it was fixed in vs 2.1.0 (which should be out on the 30'th of June 2014)

Android Google Maps V2 - create object movement player on map using historical position data set - Map limiations of data and upate interval?

So I am embarking on a project that involves the following:
I have a set of location data for a certain period of time, which location data can be from multiple objects or single object. I am trying to create something similar to a playback map where the user can play all object's movement from a certain period ( think of a music player and how you can move progress bar).
Question:
Is there any limitation in this where the Map API won't be able to handle so much updating or not being able to handle such amount of data displayed on the map?
I am sorry if the question seems to broad but I am just trying to understand the limiations before I begin working on this project.

Categories

Resources