Aria
2.8.0
|
Interfaces to a joystick on the robot's microcontroller. More...
#include <ArRobotJoyHandler.h>
Public Member Functions | |
void | addToConfig (ArConfig *config, const char *section) |
Adds to a section in a config. | |
ArRobotJoyHandler (ArRobot *robot) | |
Constructor. | |
bool | getButton1 (void) |
Gets the first button. | |
bool | getButton2 (void) |
Gets the second button. | |
ArTime | getDataReceivedTime (void) |
Gets the time we last got information back. | |
void | getDoubles (double *x, double *y, double *z) |
Gets the adjusted reading, as floats. | |
int | getRawThrottle (void) |
Gets the throttle value (only use for information, or with the robot locked, getDoubles is preferred) | |
int | getRawX (void) |
Gets the X value (only use for information, or with the robot locked, getDoubles is preferred) | |
int | getRawY (void) |
Gets the Y value (only use for information, or with the robot locked, getDoubles is preferred) | |
bool | gotData (void) |
If we've ever gotten a packet back. | |
~ArRobotJoyHandler () | |
Destructor. | |
Protected Member Functions | |
void | connectCallback (void) |
bool | handleJoystickPacket (ArRobotPacket *packet) |
Protected Attributes | |
bool | myButton1 |
bool | myButton2 |
ArFunctorC< ArRobotJoyHandler > | myConnectCB |
ArTime | myDataReceived |
bool | myGotData |
ArRetFunctor1C< bool, ArRobotJoyHandler, ArRobotPacket * > | myHandleJoystickPacketCB |
double | myJoyX |
int | myJoyXCenter |
double | myJoyY |
int | myJoyYCenter |
int | myRawThrottle |
int | myRawX |
int | myRawY |
ArRobot * | myRobot |
ArTime | myStarted |
double | myThrottle |
Interfaces to a joystick on the robot's microcontroller.
This is largely meant to be about the same as the normal joy handler but gets the data back from the robot about the joystick, but this sameness is why it reports things as it does.
Also note that x is usually rotational velocity (since it right/left), whereas Y is translational (since it is up/down).