Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
KinectStick.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) FIRST 2011. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5
/*----------------------------------------------------------------------------*/
6
7
#ifndef __KINECT_STICK_H__
8
#define __KINECT_STICK_H__
9
10
#include "ErrorBase.h"
11
#include "GenericHID.h"
12
20
class
KinectStick
:
public
GenericHID
,
public
ErrorBase
21
{
22
public
:
23
explicit
KinectStick
(
int
id
);
24
virtual
float
GetX
(JoystickHand hand = kRightHand);
25
virtual
float
GetY
(JoystickHand hand = kRightHand);
26
virtual
float
GetZ
();
27
virtual
float
GetTwist
();
28
virtual
float
GetThrottle
();
29
virtual
float
GetRawAxis
(uint32_t axis);
30
31
virtual
bool
GetTrigger
(JoystickHand hand = kRightHand);
32
virtual
bool
GetTop
(JoystickHand hand = kRightHand);
33
virtual
bool
GetBumper
(JoystickHand hand = kRightHand);
34
virtual
bool
GetRawButton
(uint32_t button);
35
36
private
:
37
void
GetData();
38
float
ConvertRawToFloat(int8_t charValue);
39
40
typedef
union
41
{
42
struct
43
{
44
uint8_t size;
45
uint8_t id;
46
struct
47
{
48
unsigned
char
axis[6];
49
unsigned
short
buttons;
50
} rawSticks[2];
51
} formatted;
52
char
data[18];
53
} KinectStickData;
54
55
int
m_id;
56
static
uint32_t _recentPacketNumber;
57
static
KinectStickData _sticks;
58
};
59
60
#endif
61
KinectStick
Definition:
KinectStick.h:20
KinectStick::GetY
virtual float GetY(JoystickHand hand=kRightHand)
Definition:
KinectStick.cpp:58
KinectStick::GetZ
virtual float GetZ()
Definition:
KinectStick.cpp:70
KinectStick::GetRawAxis
virtual float GetRawAxis(uint32_t axis)
Definition:
KinectStick.cpp:103
KinectStick::GetBumper
virtual bool GetBumper(JoystickHand hand=kRightHand)
Definition:
KinectStick.cpp:140
ErrorBase
Definition:
ErrorBase.h:37
KinectStick::GetTwist
virtual float GetTwist()
Definition:
KinectStick.cpp:81
KinectStick::GetTop
virtual bool GetTop(JoystickHand hand=kRightHand)
Definition:
KinectStick.cpp:129
GenericHID
Definition:
GenericHID.h:14
KinectStick::GetRawButton
virtual bool GetRawButton(uint32_t button)
Definition:
KinectStick.cpp:155
KinectStick::KinectStick
KinectStick(int id)
Definition:
KinectStick.cpp:28
KinectStick::GetTrigger
virtual bool GetTrigger(JoystickHand hand=kRightHand)
Definition:
KinectStick.cpp:118
KinectStick::GetX
virtual float GetX(JoystickHand hand=kRightHand)
Definition:
KinectStick.cpp:47
KinectStick::GetThrottle
virtual float GetThrottle()
Definition:
KinectStick.cpp:92
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.