GT RoboCup SSL
Soccer software, robot firmware
SpaceNavJoystick Class Reference

Joystick class for using a SpaceNavigator 3d mouse for controlling the robots. More...

Public Member Functions

bool valid () const override
 Returns whether or not we can connect to the spacenav driver. More...
 
void reset () override
 Resets any stored values. More...
 
void update () override
 Instructs the joystick to updates its values.
 
JoystickControlValues getJoystickControlValues () override
 Returns the control values from this joystick. More...
 
- Public Member Functions inherited from Joystick
int getRobotId ()
 
void setRobotId (int rId)
 

Static Public Member Functions

static void createConfiguration (Configuration *cfg)
 
- Static Public Member Functions inherited from Joystick
static void createConfiguration (Configuration *cfg)
 

Static Public Attributes

static ConfigDoubleDribblerPositiveDeadzone
 
static ConfigDoubleDribblerNegativeDeadzone
 
- Static Public Attributes inherited from Joystick
static ConfigDoubleJoystickRotationMaxSpeed
 
static ConfigDoubleJoystickRotationMaxDampedSpeed
 
static ConfigDoubleJoystickTranslationMaxSpeed
 
static ConfigDoubleJoystickTranslationMaxDampedSpeed
 

Protected Member Functions

void open ()
 
void close ()
 
- Protected Member Functions inherited from Joystick
QMutex & mutex ()
 

Protected Attributes

bool _daemonConnected
 
bool _daemonTried
 
JoystickControlValues _controlValues
 
RJ::Time _lastDribbleTime
 
- Protected Attributes inherited from Joystick
int robotId
 

Detailed Description

Joystick class for using a SpaceNavigator 3d mouse for controlling the robots.

Control mappings:

  • Translation - just as you'd expect. Moving the know forward and sideways corresponds directly with robot movement
  • Rotation - again as you'd expect. Rotating the knob rotates the robot
  • Kick - left mouse button
  • Chip - right mouse button
  • Dribbler - push down on the knob to increase speed, pull up on it to decrease speed

Note: usage of this joystick requires the spacenavd userspace driver daemon to be running.

+ Inheritance diagram for SpaceNavJoystick:
+ Collaboration diagram for SpaceNavJoystick:

Member Function Documentation

◆ getJoystickControlValues()

JoystickControlValues SpaceNavJoystick::getJoystickControlValues ( )
overridevirtual

Returns the control values from this joystick.

Note: The controls should be scaled between 0 and 1. The processor handles scaling to real world values.

Returns
The control values for this joystick

Implements Joystick.

◆ reset()

void SpaceNavJoystick::reset ( )
overridevirtual

Resets any stored values.

Joysticks are reset whenever the robot they're controlling is switched

Implements Joystick.

◆ valid()

bool SpaceNavJoystick::valid ( ) const
overridevirtual

Returns whether or not we can connect to the spacenav driver.

Unfortunately there is no api available for detecting whether or not there is a SpaceNavigator connected - we can only tell whether or not we can connect to the daemon. This is less than ideal, but it's what we've got.

Returns
A boolean indicating if the joystick is valid

Implements Joystick.


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