Now you can download a copy of these docs so you can use them offline! Download now
KinectStick Class Reference

#include <KinectStick.h>

Inheritance diagram for KinectStick:
Collaboration diagram for KinectStick:

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 ErrorGetError ()
 Retrieve the current error. Get the current error information associated with this sensor.
 
virtual const ErrorGetError () 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 ErrorGetGlobalError ()
 
- 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
 

Detailed Description

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.

Constructor & Destructor Documentation

KinectStick::KinectStick ( int  id)
explicit

Kinect joystick constructor

Parameters
idvalue 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.

Member Function Documentation

bool KinectStick::GetBumper ( JoystickHand  hand = kRightHand)
virtual

Get the button value for the button set as the default bumper (button 4)

Parameters
handUnused
Returns
The state of the button.

Implements GenericHID.

Definition at line 140 of file KinectStick.cpp.

float KinectStick::GetRawAxis ( uint32_t  axis)
virtual

Get the value of the KinectStick axis.

Parameters
axisThe axis to read [1-6].
Returns
The value of the axis

Implements GenericHID.

Definition at line 103 of file KinectStick.cpp.

bool KinectStick::GetRawButton ( uint32_t  button)
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.

Parameters
buttonThe button number to be read.
Returns
The state of the button.

Implements GenericHID.

Definition at line 155 of file KinectStick.cpp.

float KinectStick::GetThrottle ( )
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.

Returns
The Throttle value of the KinectStick

Implements GenericHID.

Definition at line 92 of file KinectStick.cpp.

bool KinectStick::GetTop ( JoystickHand  hand = kRightHand)
virtual

Get the button value for the button set as the default top

Parameters
handUnused
Returns
The state of the button.

Implements GenericHID.

Definition at line 129 of file KinectStick.cpp.

bool KinectStick::GetTrigger ( JoystickHand  hand = kRightHand)
virtual

Get the button value for the button set as the default trigger

Parameters
handUnused
Returns
The state of the button.

Implements GenericHID.

Definition at line 118 of file KinectStick.cpp.

float KinectStick::GetTwist ( )
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.

Returns
The Twist value of the KinectStick

Implements GenericHID.

Definition at line 81 of file KinectStick.cpp.

float KinectStick::GetX ( JoystickHand  hand = kRightHand)
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.

Parameters
handUnused
Returns
The X value of the KinectStick

Implements GenericHID.

Definition at line 47 of file KinectStick.cpp.

float KinectStick::GetY ( JoystickHand  hand = kRightHand)
virtual

Get the Y value of the KinectStick. This axis represents arm angle in the default gestures

Parameters
handUnused
Returns
The Y value of the KinectStick

Implements GenericHID.

Definition at line 58 of file KinectStick.cpp.

float KinectStick::GetZ ( )
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.

Parameters
handUnused
Returns
The Z value of the KinectStick

Implements GenericHID.

Definition at line 70 of file KinectStick.cpp.


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

Generated on Sat Apr 26 2014 12:26:46 for WPILibC++ by doxygen 1.8.6