TRC Library for FRC (2011) 2011
TRC Library Code Project

TrcJoystick Class Reference

#include <TrcJoystick.h>

List of all members.

Public Member Functions

 TrcJoystick (__in UINT32 port, __in ButtonNotify *notify=NULL)
 ~TrcJoystick (void)
float GetXWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD, __in JoystickHand hand=kRightHand)
float GetYWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD, __in JoystickHand hand=kRightHand)
float GetZWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD)
float GetTwistWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD)
float GetMagnitudeWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD)
float GetRadiansWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD)
float GetDegreesWithDeadband (__in float threshold=DEADBAND_INPUT_THRESHOLD)
void ButtonTask (void)

Detailed Description

This class defines and implements the TrcJoystick object. This object inherits the Joystick object from the WPI library. It added the support of detecting joystick button events and calling the notification object. It also added the deadband support for reading the analog joystick axes.

Definition at line 114 of file TrcJoystick.h.


Constructor & Destructor Documentation

TrcJoystick::TrcJoystick ( __in UINT32  port,
__in ButtonNotify notify = NULL 
) [inline]

Constructor: Create an instance of the TrcJoystick object.

Parameters:
portSpecifies the joystick port.
notifyPoints to the ButtonNotify object for button event notification callback.

Definition at line 130 of file TrcJoystick.h.

TrcJoystick::~TrcJoystick ( void  ) [inline]

Destructor: Destroy an instance of the TrcJoystick object.

Definition at line 149 of file TrcJoystick.h.


Member Function Documentation

void TrcJoystick::ButtonTask ( void  ) [inline]

This function is called periodically by the robot loop to check and process joystick button events.

Definition at line 321 of file TrcJoystick.h.

float TrcJoystick::GetDegreesWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD) [inline]

This function gets the direction value in degrees of the joystick vector with deadband.

Parameters:
thresholdSpecifies the deadband threshold.

Definition at line 301 of file TrcJoystick.h.

float TrcJoystick::GetMagnitudeWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD) [inline]

This function gets the magnitude value of the joystick vector between the X and Y axes with deadband.

Parameters:
thresholdSpecifies the deadband threshold.

Definition at line 255 of file TrcJoystick.h.

float TrcJoystick::GetRadiansWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD) [inline]

This function gets the direction value in radians of the joystick vector between the X and Y axes with deadband.

Parameters:
thresholdSpecifies the deadband threshold.

Definition at line 278 of file TrcJoystick.h.

float TrcJoystick::GetTwistWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD) [inline]

This function gets the twist value of the joystick with deadband.

Parameters:
thresholdSpecifies the deadband threshold.

Definition at line 233 of file TrcJoystick.h.

float TrcJoystick::GetXWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD,
__in JoystickHand  hand = kRightHand 
) [inline]

This function gets the X value of the joystick with deadband.

Parameters:
thresholdSpecifies the deadband threshold.
handSpecifies the handedness of the joystick (default to right hand).

Definition at line 166 of file TrcJoystick.h.

float TrcJoystick::GetYWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD,
__in JoystickHand  hand = kRightHand 
) [inline]

This function gets the Y value of the joystick with deadband.

Parameters:
thresholdSpecifies the deadband threshold.
handSpecifies the handedness of the joystick (default to right hand).

Definition at line 190 of file TrcJoystick.h.

float TrcJoystick::GetZWithDeadband ( __in float  threshold = DEADBAND_INPUT_THRESHOLD) [inline]

This function gets the Z value of the joystick with deadband.

Parameters:
thresholdSpecifies the deadband threshold.

Definition at line 212 of file TrcJoystick.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Defines