Aria: ArRatioInputJoydrive Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArRatioInputJoydrive Class Reference

`#include <ArRatioInputJoydrive.h>`

List of all members.

## Detailed Description

Use computer joystick to control an ArActionRatioInput and drive the robot.

This class obtains data from a joystick attached to the computer and provides it to an ArActionRatioInput which drives the robot. (See ArRatioInputRobotJoydrive for a similar class that uses the robot's built in joystick interface.) A callback is attached to the ArActionRatioInput object which reads joystick information and sets requested drive rations on the ArActionRatioInput

If the joystick button is pressed, then input values are set in the ArActionRatioDrive action object to request motion. If the button is not pressed, then either the robot will be stopped via the action (if stopIfNoButtonPressed is true), or no action will be requested and lower priority actions can take over (if stopIfNoButtonPressed is false)

You may need to calibrate the joystick for it to work right, for details about this see ArJoyHandler.

This class creates its own ArJoyHandler object to get input from the joystick, or uses the global ArJoyHandler object in the global Aria class if present. Then it will scale the speed between 0 and the given max for velocity and turning, up and down on the joystick go forwards/backwards while right and left go right and left.

NOTE: The joystick does not save calibration information, so you may need to calibrate the joystick before each time you use it. To do this, press the button for at least a half a second while the joystick is in the middle. Then let go of the button and hold the joystick in the upper left for at least a half second and then in the lower right corner for at least a half second. See also ArJoyHandler.

See also:
  ArRatioInputRobotJoydrive

  ArActionRatioInput

  ArJoyHandler

## Public Member Functions
| ArRatioInputJoydrive (ArRobot *robot, ArActionRatioInput *input, int priority=50, bool stopIfNoButtonPressed=false, bool useOSCalForJoystick=true)
| Constructor.
ArJoyHandler * | getJoyHandler (void)
| Gets the joyHandler.
bool | getStopIfNoButtonPressed (void)
| Get if we'll stop if no button is pressed, otherwise just do nothing.
bool | getUseOSCal (void)
| Gets whether OSCalibration is being used for the joystick or not.
bool | joystickInited (void)
| Whether the joystick is initalized or not.
void | setStopIfNoButtonPressed (bool stopIfNoButtonPressed)
| Set if we'll stop if no button is pressed, otherwise just do nothing.
void | setUseOSCal (bool useOSCal)
| Sets whether to use OSCalibration the joystick or not.
virtual | ~ArRatioInputJoydrive ()
| Destructor.
## Protected Member Functions
void | fireCallback (void)
## Protected Attributes
ArFunctorC< ArRatioInputJoydrive > | myFireCB
bool | myFiredLast
ArActionRatioInput * | myInput
ArJoyHandler * | myJoyHandler
bool | myPreviousUseOSCal
bool | myPrinting
ArRobot * | myRobot
bool | myStopIfNoButtonPressed
bool | myUseOSCal

The documentation for this class was generated from the following file:

- ArRatioInputJoydrive.h