ArServerModeRatioDrive Class Reference

#include <ArServerModeRatioDrive.h>

Inheritance diagram for ArServerModeRatioDrive:

ArServerMode List of all members.

Detailed Description

Examples:

drawingsExampleWithRobot.cpp, serverDemo.cpp, and simpleServerExample.cpp.


Public Member Functions

virtual void activate (void)
 The function called when the mode is activated.
void addControlCommands (ArServerHandlerCommands *handlerCommands)
 This adds commands that'll let you disable and enable safe driving.
void addDrivingBackwardsCallback (ArFunctor *functor, int position=50)
 Adds a callback mode for when trying to back up.
void addSafeDrivingCallback (ArFunctor *functor, int position=50)
 Adds a callback mode for when safe driving is activated.
void addToConfig (ArConfig *config, const char *section)
 Adds to a config in a section.
void addUnsafeDrivingCallback (ArFunctor *functor, int position=50)
 Adds a callback mode for when unsafe driving is activated.
 ArServerModeRatioDrive (ArServerBase *server, ArRobot *robot, bool takeControlOnJoystick=true, bool useComputerJoystick=true, bool useRobotJoystick=true, bool useServerCommands=true, const char *name="ratioDrive", bool robotJoystickOverridesLocks=true)
 Constructor.
virtual void deactivate (void)
 The function called when the mode is deactivated.
virtual ArActionGroupgetActionGroup (void)
 This function should return the action group this mode uses.
ArActionRatioInputgetActionRatioInput (void)
bool getSafeDriving (void)
 Gets whether we're driving safely or not.
bool getUseLocationDependentDevices (void)
 Gets whether we're using the range devices that depend on location.
void ratioDrive (double transRatio, double rotRatio, double throttleRatio, bool isActivating=false, double latRatio=0)
 Sets the ratio drive action.
void remDrivingBackwardsCallback (ArFunctor *functor)
 Removes a callback mode for when trying to back up.
void remSafeDrivingCallback (ArFunctor *functor)
 Removes a callback mode for when safe driving is activated.
void remUnsafeDrivingCallback (ArFunctor *functor)
 Removes a callback mode for when unsafe driving is activated.
void setSafeDriving (bool safe, bool internal=false)
 Sets whether we're safe driving or not.
void setUseLocationDependentDevices (bool useLocationDependentDevices, bool internal=false)
 Sets whether we're using the range devices that depend on location.
virtual void userTask (void)
 The ArMode's user task, don't need one, subclass must provide if needed.
virtual ~ArServerModeRatioDrive ()
 Destructor.

Protected Member Functions

void joyUserTask (void)
void ratioFireCallback (void)
void serverGetSafeDrive (ArServerClient *client, ArNetPacket *packet)
void serverRatioDrive (ArServerClient *client, ArNetPacket *packet)
void serverSafeDrivingDisable (void)
void serverSafeDrivingEnable (void)
void serverSetSafeDrive (ArServerClient *client, ArNetPacket *packet)

Protected Attributes

bool myDriveSafely
ArCallbackList myDrivingBackwardsCallbacks
bool myGotServerCommand
ArServerHandlerCommandsmyHandlerCommands
ArRatioInputJoydrivemyJoydrive
ArJoyHandlermyJoyHandler
ArFunctorC< ArServerModeRatioDrivemyJoyUserTaskCB
bool myLastRobotSafeDrive
bool myLastTimedOut
double myLatRatio
ArActionDeceleratingLimitermyLimiterBackward
ArActionDeceleratingLimitermyLimiterForward
ArActionDeceleratingLimitermyLimiterLateralLeft
ArActionDeceleratingLimitermyLimiterLateralRight
ArActionMovementParametersmyMovementParameters
bool myNewDriveSafely
bool myPrinting
ArActionRatioInputmyRatioAction
ArActionGroup myRatioDriveGroup
ArFunctorC< ArServerModeRatioDrivemyRatioFireCB
ArRatioInputRobotJoydrivemyRobotJoydrive
ArRobotJoyHandlermyRobotJoyHandler
bool myRobotJoystickOverridesLock
double myRotRatio
ArCallbackList mySafeDrivingCallbacks
bool mySentRecenter
ArFunctor2C< ArServerModeRatioDrive,
ArServerClient *, ArNetPacket * > 
myServerGetSafeDriveCB
ArFunctor2C< ArServerModeRatioDrive,
ArServerClient *, ArNetPacket * > 
myServerRatioDriveCB
ArFunctorC< ArServerModeRatioDrivemyServerSafeDrivingDisableCB
ArFunctorC< ArServerModeRatioDrivemyServerSafeDrivingEnableCB
ArFunctor2C< ArServerModeRatioDrive,
ArServerClient *, ArNetPacket * > 
myServerSetSafeDriveCB
bool myTakeControlOnJoystick
double myThrottleRatio
double myTimeout
double myTransRatio
ArCallbackList myUnsafeDrivingCallbacks
bool myUseComputerJoystick
bool myUseLocationDependentDevices
bool myUseRobotJoystick
bool myUseServerCommands


Constructor & Destructor Documentation

ArServerModeRatioDrive::ArServerModeRatioDrive ( ArServerBase server,
ArRobot robot,
bool  takeControlOnJoystick = true,
bool  useComputerJoystick = true,
bool  useRobotJoystick = true,
bool  useServerCommands = true,
const char *  name = "ratioDrive",
bool  robotJoystickOverridesLocks = true 
)

Constructor.

ArServerModeRatioDrive::~ArServerModeRatioDrive (  )  [virtual]

Destructor.


Member Function Documentation

void ArServerModeRatioDrive::activate ( void   )  [virtual]

The function called when the mode is activated.

Subclasses must implement this, but also call baseActivate().-

Implements ArServerMode.

void ArServerModeRatioDrive::addControlCommands ( ArServerHandlerCommands handlerCommands  ) 

This adds commands that'll let you disable and enable safe driving.

void ArServerModeRatioDrive::addDrivingBackwardsCallback ( ArFunctor functor,
int  position = 50 
) [inline]

Adds a callback mode for when trying to back up.

void ArServerModeRatioDrive::addSafeDrivingCallback ( ArFunctor functor,
int  position = 50 
) [inline]

Adds a callback mode for when safe driving is activated.

void ArServerModeRatioDrive::addToConfig ( ArConfig config,
const char *  section 
)

Adds to a config in a section.

void ArServerModeRatioDrive::addUnsafeDrivingCallback ( ArFunctor functor,
int  position = 50 
) [inline]

Adds a callback mode for when unsafe driving is activated.

void ArServerModeRatioDrive::deactivate ( void   )  [virtual]

The function called when the mode is deactivated.

Subclasses must implement this, and also call baseDeactivate().

Implements ArServerMode.

virtual ArActionGroup* ArServerModeRatioDrive::getActionGroup ( void   )  [inline, virtual]

This function should return the action group this mode uses.

Reimplemented from ArServerMode.

ArActionRatioInput* ArServerModeRatioDrive::getActionRatioInput ( void   )  [inline]

bool ArServerModeRatioDrive::getSafeDriving ( void   ) 

Gets whether we're driving safely or not.

bool ArServerModeRatioDrive::getUseLocationDependentDevices ( void   ) 

Gets whether we're using the range devices that depend on location.

void ArServerModeRatioDrive::joyUserTask ( void   )  [protected]

void ArServerModeRatioDrive::ratioDrive ( double  transRatio,
double  rotRatio,
double  throttleRatio,
bool  isActivating = false,
double  latRatio = 0 
)

Sets the ratio drive action.

Parameters:
isActivating a bool set to true only if this method is called from the activate() method, otherwise false
transRatio Amount of forward velocity to request
rotRatio Amount of rotational velocity to request
throttleRatio Amount of speed to request
latRatio amount of lateral velocity to request (if robot supports it)

void ArServerModeRatioDrive::ratioFireCallback ( void   )  [protected]

void ArServerModeRatioDrive::remDrivingBackwardsCallback ( ArFunctor functor  )  [inline]

Removes a callback mode for when trying to back up.

void ArServerModeRatioDrive::remSafeDrivingCallback ( ArFunctor functor  )  [inline]

Removes a callback mode for when safe driving is activated.

void ArServerModeRatioDrive::remUnsafeDrivingCallback ( ArFunctor functor  )  [inline]

Removes a callback mode for when unsafe driving is activated.

void ArServerModeRatioDrive::serverGetSafeDrive ( ArServerClient client,
ArNetPacket packet 
) [protected]

void ArServerModeRatioDrive::serverRatioDrive ( ArServerClient client,
ArNetPacket packet 
) [protected]

void ArServerModeRatioDrive::serverSafeDrivingDisable ( void   )  [protected]

void ArServerModeRatioDrive::serverSafeDrivingEnable ( void   )  [protected]

void ArServerModeRatioDrive::serverSetSafeDrive ( ArServerClient client,
ArNetPacket packet 
) [protected]

void ArServerModeRatioDrive::setSafeDriving ( bool  safe,
bool  internal = false 
)

Sets whether we're safe driving or not.

void ArServerModeRatioDrive::setUseLocationDependentDevices ( bool  useLocationDependentDevices,
bool  internal = false 
)

Sets whether we're using the range devices that depend on location.

void ArServerModeRatioDrive::userTask ( void   )  [virtual]

The ArMode's user task, don't need one, subclass must provide if needed.

Reimplemented from ArServerMode.


Member Data Documentation

bool ArServerModeRatioDrive::myDriveSafely [protected]

ArCallbackList ArServerModeRatioDrive::myDrivingBackwardsCallbacks [protected]

bool ArServerModeRatioDrive::myGotServerCommand [protected]

ArServerHandlerCommands* ArServerModeRatioDrive::myHandlerCommands [protected]

ArRatioInputJoydrive* ArServerModeRatioDrive::myJoydrive [protected]

ArJoyHandler* ArServerModeRatioDrive::myJoyHandler [protected]

ArFunctorC<ArServerModeRatioDrive> ArServerModeRatioDrive::myJoyUserTaskCB [protected]

bool ArServerModeRatioDrive::myLastRobotSafeDrive [protected]

bool ArServerModeRatioDrive::myLastTimedOut [protected]

double ArServerModeRatioDrive::myLatRatio [protected]

ArActionDeceleratingLimiter* ArServerModeRatioDrive::myLimiterBackward [protected]

ArActionDeceleratingLimiter* ArServerModeRatioDrive::myLimiterForward [protected]

ArActionDeceleratingLimiter* ArServerModeRatioDrive::myLimiterLateralLeft [protected]

ArActionDeceleratingLimiter* ArServerModeRatioDrive::myLimiterLateralRight [protected]

ArActionMovementParameters* ArServerModeRatioDrive::myMovementParameters [protected]

bool ArServerModeRatioDrive::myNewDriveSafely [protected]

bool ArServerModeRatioDrive::myPrinting [protected]

ArActionRatioInput* ArServerModeRatioDrive::myRatioAction [protected]

ArActionGroup ArServerModeRatioDrive::myRatioDriveGroup [protected]

ArFunctorC<ArServerModeRatioDrive> ArServerModeRatioDrive::myRatioFireCB [protected]

ArRatioInputRobotJoydrive* ArServerModeRatioDrive::myRobotJoydrive [protected]

ArRobotJoyHandler* ArServerModeRatioDrive::myRobotJoyHandler [protected]

bool ArServerModeRatioDrive::myRobotJoystickOverridesLock [protected]

double ArServerModeRatioDrive::myRotRatio [protected]

ArCallbackList ArServerModeRatioDrive::mySafeDrivingCallbacks [protected]

bool ArServerModeRatioDrive::mySentRecenter [protected]

ArFunctor2C<ArServerModeRatioDrive, ArServerClient *, ArNetPacket *> ArServerModeRatioDrive::myServerGetSafeDriveCB [protected]

ArFunctor2C<ArServerModeRatioDrive, ArServerClient *, ArNetPacket *> ArServerModeRatioDrive::myServerRatioDriveCB [protected]

ArFunctorC<ArServerModeRatioDrive> ArServerModeRatioDrive::myServerSafeDrivingDisableCB [protected]

ArFunctorC<ArServerModeRatioDrive> ArServerModeRatioDrive::myServerSafeDrivingEnableCB [protected]

ArFunctor2C<ArServerModeRatioDrive, ArServerClient *, ArNetPacket *> ArServerModeRatioDrive::myServerSetSafeDriveCB [protected]

bool ArServerModeRatioDrive::myTakeControlOnJoystick [protected]

double ArServerModeRatioDrive::myThrottleRatio [protected]

double ArServerModeRatioDrive::myTimeout [protected]

double ArServerModeRatioDrive::myTransRatio [protected]

ArCallbackList ArServerModeRatioDrive::myUnsafeDrivingCallbacks [protected]

bool ArServerModeRatioDrive::myUseComputerJoystick [protected]

bool ArServerModeRatioDrive::myUseLocationDependentDevices [protected]

bool ArServerModeRatioDrive::myUseRobotJoystick [protected]

bool ArServerModeRatioDrive::myUseServerCommands [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:29 2009 for ArNetworking by  doxygen 1.4.7