Here offroad navigation using LocationDataSourceAutomotive - android

I want to guide the drivers using our application on areas that are not mapped by Here. Problem is that the PositioningManager gives "map matched" positions that are sometimes far from the position the truck actually is.
So I used LocationDataSourceAutomotive to provide my own positions (raw positions given by the device) and everything is fine (PositionIndicator is moving on the map, getLastKnownPosition() is good, etc.) except that the navigation is not working.
I start navigation using
NavigationManager.getInstance().startNavigation(route);
But I don't get any instruction in the NewInstructionEventListener. And I'm not "re-routed" when I'm not following the computed route.
Does anyone have an idea why and how I could work around this issue or to achieve the same goal (offroad navigation) using other means ?

LocationDataSourceAutomotive is not mean to be used in this manner.
Generally off road navigation is not supported by the engine. If your device is positioned at places without the road network the navigation engine continues to match against the known road network. It will resume navigation if the user travels back on the route or drives onto a road on the known road network.
Also, the positioning manager will callback with different types of positions. Please do instanceof MapMatchedPosition to differentiate whether the onPositionUpdated callbacks from Navigation manager are matched or raw.

Related

Inaccurate locations in turn-by-turn GPS navigation

I am developing an Android application which has a turn-by-turn navigation between two locations. However, I've been struggling to make the navigation smooth.
I call Directions Api from Google API to retrieve the route and I've already displayed it on the map. When switching to turn-by-turn navigaton I just set the marker to the new location (also animating the marker) using location manager (using both course and fine location). Everything works fine although the gps and network provider have some innacurate locations as shown in the image in the link below.
Although does errors sometimes aren't too big ( for example the location is set at the sidewalk next to the street), I need the marker to be always following the polyline as long as the user is following the route, otherwise it will have to recalculate the route. Furthermore, as I calculate the bearing of the icon through the previous location and the new one, sometimes the icon does weird things.
I don't want to use any external library as the majority aren't free and the application won't be for personal use in a future.
My first idea was to check if the distance of my updated location to the polyline was bigger than x (say 5) in order to detect those errors. However, my application has to recalculate the route so this isn't a valid option.
I've read about Kalman algorithm to detect errors, but people say that gps internally already filters location using that algorithm.
So I need advice in order to fix those innacurate locations and make a smooth navigation as Mapbox or Google Maps or Uber does.
Link to image: https://ibb.co/n511We
Yellow line indicates the route I made and the purple circles are the inaccurate locations.

Detecting whether a coordinate falls within a predefined area in Android google maps

I am writing an app that has functionality to select GPS markers based off of their location. How is it possible to test whether a GPS coordinate falls within a given area? I already have the area data, available in GeoJSON, KML, and Shapefile. However, after browsing the api, I cannot find any method that tells me how to test if a point is within an area.
Thanks.

Here Map slow, how to turn off 3d- buildings?

I'm implementing a simple navigation app with the here-sdk for Android.
It has some great features that would be quite useful compared to my current google maps based app.
However, the app is very slow when navigating as well as when I simply scroll around on the map. I assume that turning off the 3d- buildings would improve the performance, but I cant find a way to achieve this...
Is it possible? And how?
Thanks
Check out Map.setExtrudedBuildingsVisible (boolean visible)
See:
https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-mapping-map.html#topic-apiref__setextrudedbuildingsvisible-boolean
There's another type of 3D Buildings (3DLandmarks, some 3D Models of famous buildings). Those you can activate/deactivate via setLandmarksVisible(false)
Btw: What device are you running ? What CPU/GPU chipset is it having ? We know that extruded buildings can cause some performance trouble on some few GPUs (see: https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/development-tips.html)

Android indoor directions with Google api

I currently have an app which displays a map fragment and can display navigation to a given point. The indoor maps is enabled and the building I'm trying to use does have indoor maps, but it only navigates to outside the building even when the transport mode is set to walking.
Is there currently any way to do this?
It seems that the Google Maps Android API does not support this feature for now.
Even if you select the correct travel mode, which should be walking, the route is traced on the nearest road and not on the indoor path.
I'm also waiting for this option to be released, since it is currently possible to get this outcome using Google's own Maps web app.
My graduate project is about indoor positioning when GPS is not available in android. The answer is yes, but there is not easy way. Hard way to do this but accuracy not good as good the GPS. There are two main approach to get location.
Approaches
1. Sensor-Fusion: This method for the get relative location. Using built-in sensors (gyroscope, accelerometer, compass) calculate the distance & direction over time. So you get the new location adding this value to old location. It also called dead-reckoning.
2. Wi-fi Signal Strength: If there are two or more a.p. which locations are known before, use the signal strengths to estimate your location. This idea a bit similar to how GPS works.
Weak Sides
1. Sensor-Fusion: Calculating new location error(e0) occur. When calculating next new location new error(e1) occurs again. So you get new location with e0+e1. I mean error groves exponentially over time.
2. Wi-fi Signal Strength: Some items can block the a.p. So you get weak signal strength and calculate wrong location.
Finally
I use first approach for short time(10sec). Second approach to correct location(every 10sec). So you get the best results for long & short time.
Source
Deeper explaination at this pdf.
open source android app using first approach.

How to navigate the user from floor to floor using android application

I have the requirment to navigate the user from floor to floor using wifi and gps. If user have have android tablet with wifi connection and walking to get lattitude and longitude .I have to draw or voice recognition to go left or right to tell to the user.Is it possible? if it is can anybody tell how to dO?
Thanks
First of all GPS doesn't work well/at all in closed spaces. WIFI does give you a location but its not very accurate (above 100 meters radius).
in conclusion i would say its a waste of time trying to do something like that because it will perform poorly and be pretty useless.
if you really want to go on and make it then go google for samples and examples and tutorials on how to implement the location Receiver both for FINE and COARSE location.
for the drawing part you will need the orientation sensor to tell you which way you are facing or get the bearing from the gps provider.
this is pretty general info but it should be enough to get you started.
One solution would be to have people walk around and take wifi measurements at different places on each floor, then you can store this, and then you can tell where they are on that particular floor.
You may want to break the building up into grids so you can state they are in Grid 5 D for example, if that is how you label them, or at least show that on a map.
Indoors the GPS will most likely not be working.
The wifi approach isn't foolproof but if you take multiple measurements by stair entrances and elevators you should get a good idea when they change floors, and perhaps have some people able to correct the database if they know they are in a particular grid but the app tells them it is somewhere else, so you can start to get a fuzzy idea where people are.

Categories

Resources