13 #include <QtCore/QObject> 14 #include <QtGamepad/QGamepad> 35 auto gamepadList = QGamepadManager::instance()->connectedGamepads();
36 if (gamepadList.empty()) {
38 "[ERROR: GameController] No controller was connected! All joystick " 39 "commands will be zero!\n");
41 if (gamepadList.size() > 1) {
43 "[ERROR: GameController] There are %d joysticks connected. Using " 47 printf(
"[GameController] Found 1 joystick\n");
50 _qGamepad =
new QGamepad(*gamepadList.begin());
80 gamepadCommand.
zero();
Vec2< float > rightStickAnalog
void updateGamepadCommand(GamepadCommand &gamepadCommand)
GameController(QObject *parent=0)
typename Eigen::Matrix< T, 2, 1 > Vec2
Vec2< float > leftStickAnalog
Code to read the Logitech F310 Game Controller Creates a DriverCommand object to be sent to the robot...