BaseArnl: ArServerModeGoto Class Reference

- Main Page
- Classes
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

# ArServerModeGoto Class Reference

`#include <ArServerClasses.h>`

List of all members.

## Detailed Description

Handles going to a goal or point.

It sets the server Status and Mode strings when active.

This class adds the following data requests to the server:

gotoGoal
  Sends the robot to the goal with the given name.
gotoPose
  Sends the robot to the given pose. Parameters are 2 4-byte integers for X and Y, and an optional 4-byte integer for heading.
home
  Sends the robot to a home point from the map, or 0,0,0 if none.
goalName
  Requests a reply packet containing the name of the current goal
tourGoals
  Sends the robot to each goal in the map in turn.
getGoals
  Requests a reply packet containing the names of all goals in the map (separated by null byte)

Examples:

  justPathPlanning.cpp.

## Public Member Functions
void | tourGoals (void)
| Enter a "tour goals" mode, in which the robot is sent to each goal in the map in turn.
void | tourGoalsInList (std::deque< std::string > goalList)
| Enter a "tour goals" mode, in which the robot is sent to each goal in the given list in turn.
void | addTourGoalsInListSimpleCommand (ArServerHandlerCommands *commandsServer)
| Add a "tour" command to the given "simple commands" object.
## Protected Member Functions
void | reset (void)
| Reset state.
void | goalDone (ArPose pose)
| Callback from ARNL when a goal is reached.
void | goalFailed (ArPose pose)
| Callback from ARNL when a goal fails.
void | findNextTourGoal (void)
| Set myGoalName to the name of the next goal in the tour.
size_t | numGoalsTouring ()
| Returns: number of goals in current tour, or 0 if none
void | planToNextTourGoal ()
| Keep trying to plan paths to goals in a tour, until either a plan succeeds or all the goals fail.
void | tourGoalsInListCommand (ArArgumentBuilder *args)
| Used as callback from ArServerHandlerCommands (simple/custom commands).
## Protected Attributes
std::deque< std::string > | myTouringGoalsList

## Member Function Documentation

void ArServerModeGoto::tourGoals | ( | void |  | ) |

Enter a "tour goals" mode, in which the robot is sent to each goal in the map in turn.

This mode can be entered using the tourGoals networking request.

void ArServerModeGoto::tourGoalsInList | ( | std::deque< std::string > | goalList | ) |

Enter a "tour goals" mode, in which the robot is sent to each goal in the given list in turn.

void ArServerModeGoto::addTourGoalsInListSimpleCommand | ( | ArServerHandlerCommands * | commandsServer | ) |

Add a "tour" command to the given "simple commands" object.

This simple (custom) command accepts a comma-separated list of goals, builds a list of goals, expanding items ending in a wildcard (*) to maching goals, and omitting invalid goals, and then calls tourGoalsInList().

Examples:
  justPathPlanning.cpp.

void ArServerModeGoto::goalDone | ( | ArPose | pose | ) | `[protected]`

Callback from ARNL when a goal is reached.

Set myStatus and other state. If touring, plan the next goal in the tour.

void ArServerModeGoto::goalFailed | ( | ArPose | pose | ) | `[protected]`

Callback from ARNL when a goal fails.

Set myStatus and other state. If touring, plan the next goal in the tour.

## Member Data Documentation

std::deque<std::string> ArServerModeGoto::myTouringGoalsList`[protected]`