ArServerModeDock Class Reference

#include <ArDocking.h>

Inheritance diagram for ArServerModeDock:

ArDockInterface ArServerModeDockPioneer ArServerModeDockTriangleBump ArServerModeDockPatrolBot ArServerModeDockPowerBot ArServerModeDockSimulator List of all members.

Detailed Description

This class sends the robot to a recharging "dock" station when a user commands it from a client, or when an automatic condition occurs.

You need to have a dock object in your map. Some conditions for automatically docking, and for staying docked or allowing the robot to leave the dock, can be set via ArConfig (or directly).

Examples:

arnlServer.cpp.


Public Member Functions

 ArServerModeDock (ArServerBase *serverBase, ArRobot *robot, ArLocalizationTask *locTask, ArPathPlanningTask *pathTask, bool useChargeState=false, ArFunctor *shutdownFunctor=NULL)
 Constructor.
virtual ~ArServerModeDock (void)
 Destructor.
virtual State getState (void) const
 Gets the docking state we're in.
virtual void dock (void)=0
 Sends the robot to the dock (subclass needs to implement).
virtual void undock (void)=0
 Has the robot leave the dock (subclass needs to implement).
virtual void checkDock (void)
 Sees if the robot is already docked and activates itself if it is (subclass should implement).
virtual void activateAsDocked (void)
 Forces the robot to think that it is already docked and to activate it.
virtual void checkDefault (void)
 For default modes, sees if it should activate itself.
virtual bool getForcedDock (void)
 Gets whether our docking is forced or not.
void requestForcedDock (void)
 Requests a forced dock.
const char * getDockName (void)
 Gets the name of the dock we're using.
void setDockingVoltage (double dockingVoltage)
 Set the voltage we go dock at.
double getDockingVoltage (void) const
 Get the voltage we go dock at.
void setDoneChargingVoltage (double doneChargingVoltage)
 Set the voltage we're done docking at (does first of voltage or time).
double getDoneChargingVoltage (void) const
 Get the voltage we're done docking at (does first of voltage or time).
void setDoneChargingMinutes (int doneChargingMinutes)
 Sets the number of minutes we dock for (does first of voltage or time).
int getDoneChargingMinutes (void)
 Gets the number of minutes we dock for (does first of voltage or time).
bool getUseChargeState ()
 Gets whether we're using the charge state or not.
void setDoneChargingAtFloat (bool doneChargingAtFloat)
 Sets whether we're done docking at float or not (this ONLY has meaning if getUseChargeState is true).
bool getDoneChargingAtFloat (void)
 Gets whether we're done docking at float or not (this ONLY has meaning if getUseChargeState is true).
void setMinimumMinutesBetweenAutoDock (int minutesBetween)
 Sets the number of minutes we won't auto redock for this many minutes after the last dock.
int getMinimumMinutesBetweenAutoDock (void)
 Sets the number of minutes we won't auto redock for this many minutes after the last dock.
void setAutoDock (bool autoDocking)
 Sets whether we auto dock or not.
bool getAutoDock (void)
 Enables the auto docking.
virtual void addToConfig (ArConfig *config)
 Adds the docking information to the given config.
virtual void addControlCommands (ArServerHandlerCommands *handlerCommands)
 Adds simple commands to.
void serverDock (ArServerClient *client, ArNetPacket *packet)
 Takes the server command to undock.
void serverUndock (ArServerClient *client, ArNetPacket *packet)
 Takes the server command to undock.
void serverDockInfo (ArServerClient *client, ArNetPacket *packet)
 Returns out the state of the docking.
void serverGetAutoDock (ArServerClient *client, ArNetPacket *packet)
 Returns whether we're auto docking or not.
void serverSetAutoDock (ArServerClient *client, ArNetPacket *packet)
 Sets whether we're auto docking or not.
void addStateChangedCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a functor to get called when the state changes.
void remStateChangedCB (ArFunctor *functor)
 Removes a functor to get called when the state changes.
unsigned int getFailedGotoNum (void)
 Gets the number of times goto has failed.
void addForcedDockCB (ArFunctor *functor, int position=50)
 Adds a callback for when forced docking (mostly voltage) occurs.
void remForcedDockCB (ArFunctor *functor)
 Removes a callback for when forced docking (mostly voltage) occurs.
void addIdleDockCB (ArFunctor *functor, int position=50)
 Adds a callback for when idle docking occurs.
void remIdleDockCB (ArFunctor *functor)
 Removes a callback for when idle docking occurs.
void addRequestedDockCB (ArFunctor *functor, int position=50)
 Adds a callback for when normal requested docking occurs.
void remRequestedDockCB (ArFunctor *functor)
 Removes a callback for when normal requested docking occurs.
void addDrivingToDockCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is driving to the docking goal.
void remDrivingToDockCB (ArFunctor *functor)
 Removes a callback for when the robot is driving to the docking goal.
void addDrivingIntoDockCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is driving into the actual dock.
void remDrivingIntoDockCB (ArFunctor *functor)
 Removes a callback for when the robot is driving into the actual dock.
void addDockedCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is finally docked.
void remDockedCB (ArFunctor *functor)
 Removes a callback for when the robot is finally docked.
void addDockNowUnforcedCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is not forced docked anymore.
void remDockNowUnforcedCB (ArFunctor *functor)
 Removes a callback for when the robot is not forced anymore.
void addDockNowForcedCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is forced again.
void remDockNowForcedCB (ArFunctor *functor)
 Removes a callback for when the robot is forced again.
void addUndockingCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is undocking.
void remUndockingCB (ArFunctor *functor)
 Removes a callback for when the robot is undocking.
void addUndockedCB (ArFunctor *functor, int position=50)
 Adds a callback for when the robot is undocked.
void remUndockedCB (ArFunctor *functor)
 Removes a callback for when the robot is undocked.

Static Public Member Functions

static ArServerModeDockcreateDock (ArServerBase *serverBase, ArRobot *robot, ArLocalizationTask *locTask, ArPathPlanningTask *pathTask, ArFunctor *shutdownFunctor=NULL)
 This will create a dock of the appropriate type for the robot.

Protected Member Functions

void dockUserTask (void)
ArMapObject * findDock (ArMapInterface *arMap)
 this is a helper function that will find the dock from the preferred dock and whats in the map
void clearInterrupted (void)
 This is for clearing the interrupted mode.
void resumeInterrupted (bool assureDeactivation)
 This is for resuming the interrupted mode if we should.


Member Function Documentation

void ArServerModeDock::dockUserTask ( void   )  [protected]


Generated on Thu Apr 23 10:19:34 2009 for ARNL by  doxygen 1.5.1