#include <arpirobot/devices/gamepad/Gamepad.hpp>
|
void | begin () override |
|
bool | isEnabled () override |
|
bool | shouldMatchRobotState () override |
|
bool | shouldDisableWithWatchdog () override |
|
void | enable () override |
|
void | disable () override |
|
|
bool | initialized = false |
|
std::string | deviceName |
|
Gamepad receiving data from drive station
◆ Gamepad()
arpirobot::Gamepad::Gamepad |
( |
int |
controllerNum | ) |
|
- Parameters
-
controllerNum | The controller number for this controller. Top controller in DS is zero |
◆ clearAxisTransform()
void arpirobot::Gamepad::clearAxisTransform |
( |
int |
axisNum | ) |
|
Remove a transform from an axis
- Parameters
-
axisNum | The axis number to clear a transform from |
◆ getAxis()
double arpirobot::Gamepad::getAxis |
( |
int |
axisNum, |
|
|
double |
deadband = 0 |
|
) |
| |
Get an axis for this controller
- Parameters
-
axisNum | The axis number |
deadband | A minimum threshold for axis values. Values below this will be returned as zero. |
- Returns
- The axis value after applying the deadband and (if required) an axis transform
◆ getButton()
bool arpirobot::Gamepad::getButton |
( |
int |
buttonNum | ) |
|
Get a button for the controller
- Parameters
-
buttonNum | The button number |
- Returns
- true if pressed, else false
◆ getControllerNum()
int arpirobot::Gamepad::getControllerNum |
( |
| ) |
|
Get the controller number for this gamepad
- Returns
- The controller number
◆ getDpad()
int arpirobot::Gamepad::getDpad |
( |
int |
dpadNum | ) |
|
Get the value of a dpad
- Parameters
-
- Returns
- 0 if center, 1 for up through 8 going clockwise
◆ setAxisTransform() [1/2]
void arpirobot::Gamepad::setAxisTransform |
( |
int |
axisNum, |
|
|
BaseAxisTransform & |
transform |
|
) |
| |
Set the axis transform for a given axis
- Parameters
-
axisNum | The axis number to apply a transform to. Referenced object must remain in scope until cleared. |
transform | The transform |
◆ setAxisTransform() [2/2]
void arpirobot::Gamepad::setAxisTransform |
( |
int |
axisNum, |
|
|
std::shared_ptr< BaseAxisTransform > |
transform |
|
) |
| |
Set the axis transform for a given axis
- Parameters
-
axisNum | The axis number to apply a transform to. Can use with std::make_shared |
transform | The transform |
The documentation for this class was generated from the following file: