#include <KinectStick.h>
Public Member Functions | |
KinectStick (int id) | |
virtual float | GetX (JoystickHand hand=kRightHand) |
virtual float | GetY (JoystickHand hand=kRightHand) |
virtual float | GetZ () |
virtual float | GetTwist () |
virtual float | GetThrottle () |
virtual float | GetRawAxis (uint32_t axis) |
virtual bool | GetTrigger (JoystickHand hand=kRightHand) |
virtual bool | GetTop (JoystickHand hand=kRightHand) |
virtual bool | GetBumper (JoystickHand hand=kRightHand) |
virtual bool | GetRawButton (uint32_t button) |
Public Member Functions inherited from ErrorBase | |
virtual Error & | GetError () |
Retrieve the current error. Get the current error information associated with this sensor. | |
virtual const Error & | GetError () const |
virtual void | SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set error information associated with a C library call that set an error to the "errno" global variable. More... | |
virtual void | SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated from the nivision Imaq API. More... | |
virtual void | SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | CloneError (ErrorBase *rhs) const |
virtual void | ClearError () const |
Clear the current error information associated with this sensor. | |
virtual bool | StatusIsFatal () const |
Check if the current error code represents a fatal error. More... | |
Additional Inherited Members | |
Public Types inherited from GenericHID | |
enum | JoystickHand { kLeftHand = 0, kRightHand = 1 } |
Static Public Member Functions inherited from ErrorBase | |
static void | SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
static void | SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
static Error & | GetGlobalError () |
Protected Member Functions inherited from ErrorBase | |
ErrorBase () | |
Initialize the instance status to 0 for now. | |
Protected Attributes inherited from ErrorBase | |
Error | m_error |
Static Protected Attributes inherited from ErrorBase | |
static SEM_ID | _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE) |
static Error | _globalError |
Handles input from the Joystick data sent by the FRC Kinect Server when used with a Kinect device connected to the Driver Station. Each time a value is requested the most recent value is returned. Default gestures embedded in the FRC Kinect Server are described in the document Getting Started with Microsoft Kinect for FRC.
Definition at line 20 of file KinectStick.h.
|
explicit |
Kinect joystick constructor
id | value is either 1 or 2 for the left or right joystick decoded from gestures interpreted by the Kinect server on the Driver Station computer. |
Definition at line 28 of file KinectStick.cpp.
|
virtual |
Get the button value for the button set as the default bumper (button 4)
hand | Unused |
Implements GenericHID.
Definition at line 140 of file KinectStick.cpp.
|
virtual |
Get the value of the KinectStick axis.
axis | The axis to read [1-6]. |
Implements GenericHID.
Definition at line 103 of file KinectStick.cpp.
|
virtual |
Get the button value for buttons 1 through 12. The default gestures implement only 9 buttons.
The appropriate button is returned as a boolean value.
button | The button number to be read. |
Implements GenericHID.
Definition at line 155 of file KinectStick.cpp.
|
virtual |
Get the Throttle value of the KinectStick. This axis is unimplemented in the default gestures but can be populated by teams editing the Kinect Server.
Implements GenericHID.
Definition at line 92 of file KinectStick.cpp.
|
virtual |
Get the button value for the button set as the default top
hand | Unused |
Implements GenericHID.
Definition at line 129 of file KinectStick.cpp.
|
virtual |
Get the button value for the button set as the default trigger
hand | Unused |
Implements GenericHID.
Definition at line 118 of file KinectStick.cpp.
|
virtual |
Get the Twist value of the KinectStick. This axis is unimplemented in the default gestures but can be populated by teams editing the Kinect Server.
Implements GenericHID.
Definition at line 81 of file KinectStick.cpp.
|
virtual |
Get the X value of the KinectStick. This axis is unimplemented in the default gestures but can be populated by teams editing the Kinect Server.
hand | Unused |
Implements GenericHID.
Definition at line 47 of file KinectStick.cpp.
|
virtual |
Get the Y value of the KinectStick. This axis represents arm angle in the default gestures
hand | Unused |
Implements GenericHID.
Definition at line 58 of file KinectStick.cpp.
|
virtual |
Get the Z value of the KinectStick. This axis is unimplemented in the default gestures but can be populated by teams editing the Kinect Server.
hand | Unused |
Implements GenericHID.
Definition at line 70 of file KinectStick.cpp.