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.
Related
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.
How to map in real time using indoor beacons on Android? Did tests using the SDK Estimote however, they do not have support for Android in indoor and do not have a method that returns the distance to the beacon.
With that, I'm using Alt SDK that returns me the distance.
But not her how to solve these doubts:
1) create a map (2D or 3D Google Maps type) with the location map of the inside of a room or shop for example.
2) show the location of the user's route to the beacon.
3) how to deal with the route to the beacon avoiding collision enters walls on the map?
4) how to locate the user's position in relation to beacons and know the position x, y or lat, long each beacon?
5) I saw this project trilateration but not your using to address the above questions.
6) need to use the GPS plus Bluetooth or just the Bluetooth solves?
I would recommend using one of the existing solutions, as this is a huge task that you're trying to achieve. I work for Proximi.io, that is a unified positioning platform. We provide beacon trilateration and showing your exact positioning on top of an indoor map based on that info. However, we don't have routing features. For that I would recommend checking out Steerpath, http://www.steerpath.com/. They specialize in beacon-based navigation, and deal with the wall issue.
Building an indoor navigation system is very complex. Beacon toolkits can tell you roughly how far you are from a stationary transmitter, but cannot tell you direction. It is just a tiny building block of a big system. A beacon is to an indoor navigation system as a brick is to a building.
You have brought up several important requirements and there are many others, including:
Building a system to record beacon positions in a known coordinate frame, and send them to your app
Transform beacon coordinate frame estimated positions to map coordinate frame for displaying a blue dot.
How to build such a system is simply beyond the scope of questions that can be answered properly on StackOverflow.
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.
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.
Is it possible to get the location of the building shown in the Camera view using Augmented Reality in Android??
I have the GPS coordinates of the mobile but now i want to get the GPS coordinates of the building shown in the Camera view???
Please suggest me some ideas?????
If you have the GPS coordinate of your mobile phone and the direction (using the compass of the mobile phone) in which it is hold, you could use some trigonometry to approximate the location of the building. The remaining problem is that you have to somewhere estimate how far the building is away from your phone.
But if you assume for example that you're always walking in streets and the point to a building, it should be easier to find the building.
I would not depend on the compass output, it's always in question.
What I did was use Gogle maps, get a location fix, draw the point on the map (if you want to draw a line use bearing that would be a better hint I guess) then let the user draw or adjust the line using sattelite view to pinpoint the target. You can then get the new geo-coord and get a fairly accurate bearing ( if that's required )
I would also suggest using both the network and gps provider, in cities sometimes the network provider is more accurate than the GPS if the glass/metal canyon is preventing it, even a couple of hundred yards can get you close to your position.
Anyway it's a somewhat manual process but it's more reliable then trying to guess distance and hoping the azimuth is reliable (rarely is)