public class Slam
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
int |
activeLocalization()
Ask robot to localize actively (The robot will rotate and capture the key-frames),
and return its current location.
|
int |
activeLocalization(double searchRadius)
Ask robot to localize actively (The robot will rotate and capture the key-frames),
and return its current location.
|
int |
getLocation()
Ask robot's current location.
|
public int activeLocalization()
Bundle key: LOCATION - includes (x,y,heading) (Float, Float, Float) & sessionId (Int) & submapId (Int), the sessionId means the N'th scan (currently don't care since now the scan can't be interrupted, the sessionId should be always the same), and the submapId means the N'th submap, since each submap has its own coordinate, please use it together with (x,y,heading). CONFIDENCELEVEL - confidence of this result (Int), range from 0(confidence HIGH) ~ 3(confidence LOW)
Example: String tmp; Bundle bundle = result.getBundle("RESULT"); Location location = bundle.getParcelable("LOCATION"); tmp = String.format("x:%f, y:%f, heading:%f", location.coordinate.x, location.coordinate.y, location.heading); tmp = String.format("session ID: %d, submap ID: %d", location.sessionID, location.submapID); tmp = String.format("confidence level: %d", bundle.getInt("CONFIDENCELEVEL"));
public int activeLocalization(double searchRadius)
searchRadius
- the search radius to find a free point(m), the default
value is 3m.
Bundle key: LOCATION - includes (x,y,heading) (Float,
Float, Float) & sessionId (Int) & submapId (Int),
the sessionId means the N'th scan (currently don't care since
now the scan can't be interrupted, the sessionId should be
always the same), and the submapId means the N'th submap,
since each submap has its own coordinate, please use it
together with (x,y,heading).
CONFIDENCELEVEL - confidence of this result (Int), range
from 0(confidence HIGH) ~ 3(confidence LOW)
Example: String tmp; Bundle bundle = result.getBundle("RESULT"); Location location = bundle.getParcelable("LOCATION"); tmp = String.format("x:%f, y:%f, heading:%f", location.coordinate.x, location.coordinate.y, location.heading); tmp = String.format("session ID: %d, submap ID: %d", location.sessionID, location.submapID); tmp = String.format("confidence level: %d", bundle.getInt("CONFIDENCELEVEL"));
public int getLocation()
Example: String tmp; Bundle bundle = result.getBundle("RESULT"); Location location = bundle.getParcelable("LOCATION"); tmp = String.format("x:%f, y:%f, heading:%f", location.coordinate.x, location.coordinate.y, location.heading); tmp = String.format("session ID: %d, submap ID: %d", location.sessionID, location.submapID); tmp = String.format("confidence level: %d", bundle.getInt("CONFIDENCELEVEL"));