Main Page | Modules | Class Hierarchy | Class List | Class Members | Examples

Localization

Introduction to localization.

MobileRobots Advanced Robotics Navigation and Localization System (ARNL)

Copyright (c) 2004, 2005 ActivMedia Robotics, LLC.
Copyright (c) 2006, MobileRobots, Inc.
All rights reserved.

The ArLocalizationTask class works asynchronously to localize a robot in a known (mapped) indoor environment. Besides a prepared map created and edited with Mapper3 (tm) or similar utility, ArLocalization requires the use of a MobileRobots or ActivMedia robot platform or simulator equipped with a SICK laser range-finding sensor. (To do localization with sonar, use ArSonarLocalizationTask instead.)

In addition, ArLocalizationTask uses ARIA. The ARNL distribution contains ARIA.

Programming and Using ArLocalizationTask

ArLocalizationTask implements the Monte Carlo Localization Algorithm to accurately place the robot within a given map of its operating environment, as derived from laser-ranging and robot odometry information. The localization task is meant to be initialized and run as a separate thread within ARIA. Please consult the Arnl/examples source files for details.

Briefly, in order to run the localization task thread, the ArLocalizationTask class needs instantiated and initialized ArRobot, ArSick and ArMap objects. The output of the localization is reflected directly in the pose of the ArRobot, unless explicitly set not to do so.

In order to use localization in your own software, follow these two steps, at minimum and in order:

1. Create a ArLocalizationTask class with an instantiated ArRobot, an ArSick class and a map of the robot's environment, explicitly as a file or from ArMap. For example,

  // Create the localization task (it will start its own thread here)
  ArLocalizationTask *myLocTask = new ArLocalizationTask(myRobot, mySick, mapname);

2. Initialize the robot's location inside the map:

  // Set the initial pose to the robot's "Home" position from the map, or
  // (0,0,0) if none, then let the localization thread take over.
  myLocaTask->localizeRobotAtHomeBlocking();

You can later reset the robot to a unique "home" pose, as prescribed in the map, any time before or after initialization using the localizeRobotAtHomeBlocking() or localizeRobotAtHomeNonBlocking() functions. Or use the forceUpdatePose() method to place the robot in the map:

  // Force the current localization pose
  myLocaTask->forceUpdatePose(pose, ns, xstd, ystd, tstd);

Thereafter, ArLocalizationTask thread automatically acts to relocate the robot in the map. To conserve processing resources, automatic localization updates happen only when the robot has moved beyond set translational and/or rotational limits. By default, these limits are set to +-200 mm translation and +-5 degrees rotation but may be changed by modifying ARNL's configuration parameters.

Localization Results and States

Each time ArLocalizationTask acts to update the robot's position in the map, it resets the pose of the ArRobot in ARIA (unless set not to do so). Hence, you may directly read the pose from the ArRobot class. There also are a number of functions in the ArLocalizationTask class which can return the current robot location and the states of the localization. These flags and scores show the state of the localization. These functions incluge getLocalizationScore(), getSensorBelief(), getState(), getIdleFlag().

Since the localization task deals with a map and builds its own occupancy grid, the class also provides access to the map and grid using member functions. Get these data by including the related include files and member functions.

Failed Callback.

ArLocalizationTask can alert your program if it fails to update localization while running. In order to do this, add a callback function to the class using addFailedLocalizationCB. Remove the callback using the remFailedLocalizationCB when finished:

    ArFunctor1<int> tracking_failed(failed); // note that failed must be defined.
    myLocaTask->addFailedLocalizationCB(&trackingFailed);


Generated on Tue Feb 20 10:56:29 2007 for Arnl by  doxygen 1.4.0