Introduction to Path Planning

ArPathPlanningTask is the navigation component of ARNL. As an asynchronous task (thread) working with the ARIA robot control infrastructure, it's job is to plan the shortest and safest path for and then drive your mobile robot from its current position to any other reachable point in its mapped environment. ArPathPlanningTask navigates to a goal using an ArMap indicating sensable obstacles (walls, furniture, etc.), forbidden lines and areas, goal points, etc. and samples that data into a lower resolution grid. It then searches this grid for cells that are sufficiently far from obstacles to form a clear "global path" for the robot in that grid from the robot's current position to the goal. It then activates an ArAction which drives the robot along that path, and while navigating along this path, ArPathPlanningTask uses a dynamic window method and local replanning to avoid unmapped obstacles. How it plans both the global and local paths may be adjusted by modifying many parameters (see below).

For accurate navigation, also using a localization task is highly recommended.

Example programs using ArPathPlanning and localization are found in the Arnl/examples directory.

ArPathPlanningTask needs an instantiated and connected ArRobot object to hold the robot details, at least one range device (laser rangefinder, sonar, etc.), and ArMap which holds a prepared map of the robot's operating environment (see expanded description of maps in ArLocalization and Arnl docs): Additional range devices can be addedusing the addRangeDevice() function.

  ArPathPlanningTask myPathPlanningTask(myRobot, myLaser, mySonar, myMap);
  

The path planning task is set up as an ArActionGroup in the ARIA scheme of things: Your application sets the goal for the action (ArPose) and a flag to decide if whether or not, once it arrives at the goal, your robot should turn to some particular heading:

Example sets the goal pose to the robot's start up position and heading.
  myPathPlanningTask.pathPlanToPose(ArPose(0,0,0), true);
  

You may also send the robot to a goal and related pose by name, as may be embedded into the ArMap object--"Dock", for example. Simply pass the goal name string to the pathPlanningTask via the pathPlanToGoal function:

Sends the robot to the dock.
  myPathPlanningTask.pathPlanToGoal("Dock");
  

Once the action goal is set, ArPathPlanningTask automatically plans an efficient path and, with ARIA and ArLocalizationTask, drives the robot to the goal.

Four callback functions provide ways for your ARIA application to be notified and respond when the robot arrives at (addGoalDoneCB) or fails to successfully navigate (addGoalFailedCB) to the prescribed goal, if some other application event interrupts navigation (addGoalInterruptedCB), and a generic callback for any state change (addStateChangedCB). Be sure to remove each callback from the class when finished using their respective remGoalDoneCB, remGoalFailedCB, and remGoalInterruptCB methods:

  ArFunctor1<ArPose> goal_done(goalDone); // Define goalDone
  ArFunctor1<ArPose> goal_failed(goalFailed); // goalFailed
  ArFunctor1<ArPose> goal_interrupt(goalInterrupt); // and goalInterrupted handlers.
  myPathPlanningTask.addGoalDoneCB(&goal_done); // Implement each as task callbacks
  myPathPlanningTask.addGoalFailedCB(&goal_failed);
  myPathPlanningTask.addGoalInterruptedCB(&goal_interrupt);
  

Your application may get navigation status with the getState() method, which returns a value from an enumerated list of states (PathPlanningState), or get a textual description of the status using getStatusString or getFailureString (which are equivalent functions, and fill a char* buffer with text describing the current status, including failures).

  ArPathPlanningTask::PathPlanningState s = myPathPlanningTask.getState();
  char[512] text;
  myPathPlanningTask.getStatusString(text, sizeof(text));
  printf("Planning status: %s.\n", text);
  

The path planning program can be customized for specific robots and specific applications through ARIA- and ARNL-specific methods as part of the program, or by modifying the contents of your robot's ARIA or ARNL parameters file, such as params/p3dx.p and params/arnl.p respectively. Versatile parameters include the dimensions and dynamics of obstacle avoidance and path tracking. Others include details about the robot size, the robot's dynamic parameters, including maximum linear and angular accelerations and velocities, and so forth.

Notes: Unlike the localization module, the path planning module physically moves the robot. Though the path planning module can safely navigate through a mapped area in the presence of unknown obstacles, you should be aware of its limitations:


Generated on Thu Aug 6 09:40:13 2009 for BaseArnl by  doxygen 1.5.1