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

Sonar Localization

MobileRobots Advanced Robotics Navigation and Localization System (ARNL) Developer's Reference Manual

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

The ArSonarLocalizationTask class works asynchronously to localize a robot in a known (mapped) indoor environment. Besides a prepared line map created and edited with Mapper3 (tm) or similar utility, ArSonarLocalization requires the use of a MobileRobots or ActivMedia robot platform or simulator equipped with ultrasonic range-finding sensors (sonar). (If you have a SICK laser, you can use ArLocalizationTask -- available in ARNL only, not SONARNL -- to do more accurate localization.)

In addition, ArSonarLocalizationTask uses ARIA and contains a full version of ARIA.

Programming and Using ArLocalizationTask

ArSonarLocalizationTask implements the Monte Carlo Localization Algorithm to more accurately place the robot within a given line map of its operating environment, as derived from sonar-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 sonar localization task thread, the ArSonarLocalizationTask class needs instantiated and initialized ArRobot, ArSonarDevice 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 ArSonarLocalizationTask class with an instantiated ArRobot, an ArSonarDevice class and a line 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)
  ArSonarLocalizationTask *myLocaTask  = new ArSonarLocalizationTask(myRobot, mySonar, 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, ArSonarLocalizationTask 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 SONARNL's configuration parameters.

Localization Results and States

Each time ArSonarLocalizationTask 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 ArSonarLocalizationTask 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 include getLocalizationScore(), getSensorBelief(), getState() and getIdleFlag().

Failed Callback.

ArSonarLocalizationTask 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