MapTrip SDK Android Manual 9.9.7
FollowMeRoute Class Reference

This class provides a special kind of Navigation developed for waste disposal or winter road clearance
More...

+ Inheritance diagram for FollowMeRoute:

Public Member Functions

ApiError addRemark (final int code, final String remark)
 
void addTaskListener (TaskListener listener)
 
Task< FollowMeRoutecalculate (final boolean fromCurrentPosition, final boolean doContinue)
 
ApiError continueFollowMeRoute ()
 
ApiError discardNextMeters (final int meters, final boolean later)
 
ApiError discardNextSegments (final int segmentsInFront, final boolean later)
 
ApiError discardPreviousEvents (final boolean later)
 
boolean equals (Object o)
 
Iterable< FollowMeRouteEventgetFollowMeEventsIterator (final int maxEvents, final double maxDistance)
 
Iterable< FollowMeRouteIntervalgetFollowMeIntervalIterator ()
 
String getFullPath ()
 
Polygon getMissedCollectionPointsExtent ()
 
int getRemainingCollectionPointsNum ()
 
FollowMeState getStatus ()
 
Waypoint highlightSegment (final int segmentsInFront)
 
ApiError pauseFollowMeRoute ()
 
void removeAllTaskListeners ()
 
void removeTaskListener (TaskListener listener)
 
ApiError showRemainingCollectionPoints (final boolean show, final Mapviewer mapviewer)
 
ApiError showRemainingTransferLines (final boolean show, final Mapviewer mapviewer)
 
ApiError start (final boolean simulation)
 
ApiError stopFollowMeRoute ()
 
ApiError terminate ()
 

Static Public Member Functions

static void addFollowMeRouteListener (FollowMeRouteListener listener)
 
static FollowMeRoute getPausedFollowMeRoute ()
 
static FollowMeRoute init (final String nmeaFileName)
 
static void removeAllFollowMeRouteListeners ()
 
static void removeFollowMeRouteListener (FollowMeRouteListener listener)
 

Detailed Description

A follow me route is a navigation process that guides along a route which is specified in a gps log file. If the route is left, the routing guides to the position where the route was left and continues to guide based on the log file. The route is filled with points on the map which are removed / collected by driving over the positions.

The nmea file used for follow me may contain special tags at certain positions (see Gps.addActionToLog() and Gps.addEventToLog() ) which will fire an event if reached(FollowMeRouteListener.followMeAction() and FollowMeRouteListener.followMeEvent() )

An action defines a predefined event (FmrActionType) which will also affect the followMe behavior while events are purely userdefined and only fire the described event callback.

The defined actions result in the following behavior:

  • FmrActionType.COLLECT_START starts the collection mode from the given position (Those parts of the recorded route have to be exactly passed / driven over in follow me navigation)
  • FmrActionType.TRANSFER_START starts the transfer mode from the given position (Those parts of the recorded route are only used to lead to the next collection segment and don't have to be exactly passed / driven over)
  • FmrActionType.COLLECT_RIGHT only in collection mode. Recorded route segments will only be marked as reached if driven on the left side of the road
  • FmrActionType.COLLECT_LEFT only in collection mode. Recorded route segments will only be marked as reached if driven on the right side of the road
  • FmrActionType.COLLECT_BOTH only in collection mode. Recorded route segments will only be marked as reached if driven on the right side of the road and a second time on the left side of the road
  • FmrActionType.COLLECT_UNKNOWN only in collection mode. Recorded route segments will be marked as reached if driven from any side of the road

The last received action is valid until a new action is received (e.g. after a MTA_FMR_ACTION_TYPE "MTA_FMR_ACT_COLLECT_LEFT" action, dots have to be collected on the left side until the next event is received

Member Function Documentation

◆ addFollowMeRouteListener()

static void addFollowMeRouteListener ( FollowMeRouteListener  listener)
static

◆ addRemark()

ApiError addRemark ( final int  code,
final String  remark 
)

Adds a remark to the remarks file. The path for the remarks files can be configured in the settings.ini section [FOLLOWME] key "RemarksFilePath".

Parameters
remark- The remark to be written to the remarks file
Returns
Errorcode

◆ addTaskListener()

void addTaskListener ( TaskListener  listener)

◆ calculate()

Task< FollowMeRoute > calculate ( final boolean  fromCurrentPosition,
final boolean  doContinue 
)

Calculates the route asynchronously.

Parameters
fromCurrentPosition- Add the approaching part from the current position to the start point of the real FollowMeRoute.
doContinue- Add the approaching part from the current position to the point of the real FollowMeRoute, where the route was paused.
Returns
a task that asynchronously calculates the route. By registering the task callbacks, the state of this operation can be retrieved.
The task can return (BaseTask.getReturnValue()) the following Errorcodes

◆ continueFollowMeRoute()

ApiError continueFollowMeRoute ( )

Continues on the segment where the follow me route was paused. This can be used to continue at the same route segment at a later point in time.

Returns

◆ discardNextMeters()

ApiError discardNextMeters ( final int  meters,
final boolean  later 
)

Discards the next meters

Parameters
later- True: The events will be collected later (currently missed) or (false) will never be collected anymore and not displayed on the map (discarded).
Returns
Errorcode

◆ discardNextSegments()

ApiError discardNextSegments ( final int  segmentsInFront,
final boolean  later 
)

Discards the next n street segments

Parameters
later- True: The events will be collected later (currently missed) or (false) will never be collected anymore and not displayed on the map (discarded).
Returns
Errorcode

◆ discardPreviousEvents()

ApiError discardPreviousEvents ( final boolean  later)

Discards the previous missed events

Parameters
later- True: The events will be collected later (currently missed) or (false) will never be collected anymore and not displayed on the map (discarded).
Returns
Errorcode

◆ equals()

boolean equals ( Object  o)
inherited

◆ getFollowMeEventsIterator()

Iterable< FollowMeRouteEvent > getFollowMeEventsIterator ( final int  maxEvents,
final double  maxDistance 
)

Get an iterator to a list of upcoming follow me events. The list can be limited both by number of events and by distance.

Parameters
maxEvents- maximum number of events to return, unlimited if 0
maxDistance- maximum route length for which events are to be returned, unlimited if 0
Returns
iterator of upcoming follow me events

◆ getFollowMeIntervalIterator()

Iterable< FollowMeRouteInterval > getFollowMeIntervalIterator ( )

Get an iterator to a list of intervals. A FollowMe interval is a coherent part of the route with a unique MTA_FOLLOW_ME_INTERVAL_TYPE.

Returns
iterator of intervals

◆ getFullPath()

String getFullPath ( )

Returns
the full path of the nmea or csv file of the current FollowMe route

◆ getMissedCollectionPointsExtent()

Polygon getMissedCollectionPointsExtent ( )

Returns
the extent of missed collection points of a follow me route.

◆ getPausedFollowMeRoute()

static FollowMeRoute getPausedFollowMeRoute ( )
static

Returns paused follow me route. If now route was paused check the last error via Api.getLastError() For the returned follow me object no route calculation is necessary. It will be calculated automatically by the next FollowMeRoute.continueFollowMeRoute() call.

Returns
the paused follow me object

◆ getRemainingCollectionPointsNum()

int getRemainingCollectionPointsNum ( )

Returns
the number of remaining collection points of a follow me route or a (negative) Errorcode.

◆ getStatus()

FollowMeState getStatus ( )

Returns
current status or the follow me route. FollowMeState

◆ highlightSegment()

Waypoint highlightSegment ( final int  segmentsInFront)

Sets the green arrow n street segments in front of the current position on the route. If the parameter segmentsInFront is zero, the green arrow will be deleted. The returned waypoint has a user attribute 'segmentsInFront', which contains the (probably corrected) value of segmentsInFront. Use this value to check, if your committed value has exceeded the number of route segments. This value can be -1, if an error occurred. Use this function in combination with FollowMeRoute.discardNextSegments()

Parameters
segmentsInFront
Returns
the start point of the highlighted segment as a Waypoint.

◆ init()

static FollowMeRoute init ( final String  nmeaFileName)
static

Creates a FollowMeRoute object. If the returned object is invalid, the handed file could not be found.

Parameters
nmeaFileName- The full path to the nmea or csv file OR the relative path on the FollowMeServer.
Returns
A new FollowMeRoute object.

◆ pauseFollowMeRoute()

ApiError pauseFollowMeRoute ( )

Stops the follow me process and remembers the current position on the follow me route. During a paused follow me route, a normal route calculation and navigation can be started. A paused follow me route is persistently stored and can be continued even after the api is re-initialized. See FollowMeRoute.getPausedFollowMeRoute()

Returns

◆ removeAllFollowMeRouteListeners()

static void removeAllFollowMeRouteListeners ( )
static

◆ removeAllTaskListeners()

void removeAllTaskListeners ( )

◆ removeFollowMeRouteListener()

static void removeFollowMeRouteListener ( FollowMeRouteListener  listener)
static

◆ removeTaskListener()

void removeTaskListener ( TaskListener  listener)

◆ showRemainingCollectionPoints()

ApiError showRemainingCollectionPoints ( final boolean  show,
final Mapviewer  mapviewer 
)

Shows the remaining / unreached collection points. The map viewer uses the layer mmPacman. You cannot hide this Layer during a FMR guidance.

Parameters
show- Shows (true) or hides (false) the Layer.
mapviewer- The map to show the points.
Returns
Errorcode

◆ showRemainingTransferLines()

ApiError showRemainingTransferLines ( final boolean  show,
final Mapviewer  mapviewer 
)

Shows the remaining / unreached transfer parts. Use this function only for overview purposes. The content of this layer is only refreshed in this function call. Not automatically during any ordinary FMR guidance. The map viewer uses the layer mmFmrTransfer. You cannot hide this Layer during a FMR guidance.

Parameters
show- Shows (true) or hides (false) the Layer.
mapviewer- The map to show the points.
Returns
Errorcode

◆ start()

ApiError start ( final boolean  simulation)

Starts the guidance of the previously calculated route.

Parameters
simulation- Starts a simulation along the route without regards to any real GPS position.

◆ stopFollowMeRoute()

ApiError stopFollowMeRoute ( )

Stops the FollowMe Route. It cannot be continued anymore.

Returns

◆ terminate()

ApiError terminate ( )

Terminates this FollowMe Route and deletes all paused settings, etc.

Returns
Errorcode

The documentation for this class was generated from the following file: