Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ set(SRC_IDF
source/idf/ThrustMaster2.cpp
source/idf/ThrustMasterBase.cpp
source/idf/ThrustMaster.cpp
source/idf/ThrustMasterAvaBase.cpp
source/idf/VirpilMT50CM3.cpp
source/idf/VirpilConstellationAlpha.cpp
source/idf/UsbChProPedals.cpp
Expand Down Expand Up @@ -104,6 +105,7 @@ set(SRC_IDF
source/idf/UsbSpaceMouse.cpp
source/idf/UsbSpaceNavigator.cpp
source/idf/UsbTeensyduino.cpp
source/idf/UsbThrustMasterAvaBase.cpp
source/idf/UsbVirpilConstellationAlpha.cpp
source/idf/UsbWingMan.cpp
source/idf/UsbXBox.cpp
Expand Down
3 changes: 3 additions & 0 deletions apps/configurator/configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "idf/UsbSpaceMouse.hh"
#include "idf/UsbSpaceNavigator.hh"
#include "idf/UsbTeensyduino.hh"
#include "idf/UsbThrustMasterAvaBase.hh"
#include "idf/UsbVirpilConstellationAlpha.hh"
#include "idf/UsbWingMan.hh"
#include "idf/UsbXBox.hh"
Expand Down Expand Up @@ -83,6 +84,7 @@ void run() {
idf::UsbSpaceMouse spaceMouse;
idf::UsbSpaceNavigator spaceNavigator;
idf::UsbTeensyduino teensyduino;
idf::UsbThrustMasterAvaBase tmAvaBase;
idf::UsbVirpilConstellationAlpha constellation;
idf::UsbWingMan wingMan;
idf::UsbXBox xBox;
Expand All @@ -109,6 +111,7 @@ void run() {
devices.push_back(&spaceMouse);
devices.push_back(&spaceNavigator);
devices.push_back(&teensyduino);
devices.push_back(&tmAvaBase);
devices.push_back(&constellation);
devices.push_back(&wingMan);
devices.push_back(&xBox);
Expand Down
21 changes: 21 additions & 0 deletions include/idf/SingleCameraController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ LIBRARY DEPENDENCIES: (
#include "idf/SaitekX56Stick.hh"
#include "idf/SaitekX56Throttle.hh"
#include "idf/SpaceBase.hh"
#include "idf/ThrustMasterAvaBase.hh"
#include "idf/ThrustMasterBase.hh"
#include "idf/XBoxOne.hh"
#include "idf/VirpilConstellationAlpha.hh"
Expand Down Expand Up @@ -279,6 +280,26 @@ class SingleCameraController : public CameraController {
*/
static SingleCameraController* createInstance(const VirpilConstellationAlpha& virpil);

/**
* creates a new SingleCameraController mapped to @a ThrustMasterAvaBase base using appropriate
* defaults. The AVA Base has 32 discrete generic buttons, X, Y, Z, Rx, Ry, Rz, Slider, Dial
* single directional Hat inputs. But, due to the interchangable grips, generally only a subset
* of these inputs will be functional, and many functions will be mapped to the generic buttons.
* eg for the F-16C Viper grip there are three 4-way hats which are just mapped to 4 buttons
* each and it lacks a twist axis (Z).
*
* HID inherited some legacy norms, such as Joysticks using X and Y for the normal pivot axes, and
* Z to the twist axis, instead of using Rx, Ry and Rz. As such, the Rotational Axes are used for
* other analog inputs. Often a secondary thumbstick or throttle or slider or dial of some kind.
*
* Thus, this mapping will only use the most common and universally typical inputs.
*
* @param ava the inputs to use in the default mapping
*
* @return a new Thrust Master AVA based flight controller
*/
static SingleCameraController* createInstance(const ThrustMasterAvaBase& ava);

/**
* creates a new SingleCameraController mapped to @a HidGenericJoystick using appropriate
* defaults. Since this is a generic mapping without specific knowledge of the
Expand Down
22 changes: 22 additions & 0 deletions include/idf/SingleFlightController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LIBRARY DEPENDENCIES: (
#include "idf/SaitekX52.hh"
#include "idf/SaitekX56Stick.hh"
#include "idf/SpaceBase.hh"
#include "idf/ThrustMasterAvaBase.hh"
#include "idf/ThrustMasterBase.hh"
#include "idf/XBoxOne.hh"
#include "idf/VirpilConstellationAlpha.hh"
Expand Down Expand Up @@ -293,6 +294,27 @@ class SingleFlightController : public FlightController {
*/
static SingleFlightController* createInstance(const VirpilConstellationAlpha& virpil);

/**
* creates a new SingleFlightController mapped to @a ThrustMasterAvaBase base using appropriate
* defaults. The AVA Base has 32 discrete generic buttons, X, Y, Z, Rx, Ry, Rz, Slider, Dial
* single directional Hat inputs. But, due to the interchangable grips, generally only a subset
* of these inputs will be functional, and many functions will be mapped to the generic buttons.
* eg for the F-16C Viper grip there are three 4-way hats which are just mapped to 4 buttons
* each and it lacks a twist axis (Z).
*
* HID inherited some legacy norms, such as Joysticks using X and Y for the normal pivot axes, and
* Z to the twist axis, instead of using Rx, Ry and Rz. As such, the Rotational Axes are used for
* other analog inputs. Often a secondary thumbstick or throttle or slider or dial of some kind.
*
* Thus, this mapping will only use the most common and universally typical inputs.
*
* @param ava the inputs to use in the default mapping
*
* @return a new Thrust Master AVA based flight controller
*/
static SingleFlightController* createInstance(const ThrustMasterAvaBase& ava);


/**
* creates a new SingleFlightController mapped to @a HidGenericJoystick using appropriate
* defaults. Since this is a generic mapping without specific knowledge of the
Expand Down
23 changes: 22 additions & 1 deletion include/idf/SingleRoboticsController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LIBRARY DEPENDENCIES: (
#include "idf/SpaceMouse.hh"
#include "idf/ThrustMaster.hh"
#include "idf/ThrustMaster2.hh"
#include "idf/ThrustMasterAvaBase.hh"
#include "idf/XBoxOne.hh"
#include "idf/VirpilConstellationAlpha.hh"
#include "idf/VirtualLayout.hh"
Expand Down Expand Up @@ -343,7 +344,7 @@ class SingleRoboticsController : public RoboticsController {
*
* @param dacoThc the inputs to use in the default mapping
*
* @return a new DacoThc-based camera controller
* @return a new DacoThc-based robotics controller
*/
static SingleRoboticsController* createInstance(const DacoThc& dacoThc);

Expand All @@ -357,6 +358,26 @@ class SingleRoboticsController : public RoboticsController {
*/
static SingleRoboticsController* createInstance(const VirpilConstellationAlpha& virpil);

/**
* creates a new SingleRoboticsController mapped to @a ThrustMasterAvaBase base using appropriate
* defaults. The AVA Base has 32 discrete generic buttons, X, Y, Z, Rx, Ry, Rz, Slider, Dial
* single directional Hat inputs. But, due to the interchangable grips, generally only a subset
* of these inputs will be functional, and many functions will be mapped to the generic buttons.
* eg for the F-16C Viper grip there are three 4-way hats which are just mapped to 4 buttons
* each and it lacks a twist axis (Z).
*
* HID inherited some legacy norms, such as Joysticks using X and Y for the normal pivot axes, and
* Z to the twist axis, instead of using Rx, Ry and Rz. As such, the Rotational Axes are used for
* other analog inputs. Often a secondary thumbstick or throttle or slider or dial of some kind.
*
* Thus, this mapping will only use the most common and universally typical inputs.
*
* @param ava the inputs to use in the default mapping
*
* @return a new Thrust Master AVA based flight controller
*/
static SingleRoboticsController* createInstance(const ThrustMasterAvaBase& ava);

/**
* creates a new SingleRoboticsController mapped to @a HidGenericJoystick using appropriate
* defaults. Since this is a generic mapping without specific knowledge of the
Expand Down
198 changes: 198 additions & 0 deletions include/idf/ThrustMasterAvaBase.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
/*
PURPOSE:
LIBRARY DEPENDENCIES: (
(idf/ThrustMasterAvaBase.cpp)
)
*/

/**
* @trick_parse{everything}
* @trick_link_dependency{idf/ThrustMasterAvaBase.cpp}
*/

#ifndef THRUSTMASTER_AVA_BASE_HH
#define THRUSTMASTER_AVA_BASE_HH

#include "idf/InputLayout.hh"
#include "idf/SingleInput.hh"

namespace idf {

/**
* %ThrustMaster AVA Base hand controller's input layout. This device has
* interchangeable grips, and not all grips have all inputs. e.g. While this
* class lists Twist, F/B Thumbstick Pivot, L/R Thumbstick Pivot, and 32 buttons,
* the compatible F-16 stick lacks Twist and the thumbstick Pivots, and has only
* 18 buttons. Of those buttons, 12 are physically implemented as three
* different 4-way hat switches. Thus, the standard IDF provided Controllers
* (ie FlightController) will only have the most basic and essential inputs.
*
* @author Philip Kunz
*/
class ThrustMasterAvaBase : public virtual InputLayout {

public:

/** constructor */
ThrustMasterAvaBase();

/** destructor */
virtual ~ThrustMasterAvaBase() {};

/** forward-backward pivoting, uses HID X-axis (legacy HID consideration) */
SingleInput forwardBackwardPivot;

/** forward-backward pivoting, uses HID Y-axis (legacy HID consideration) */
SingleInput leftRightPivot;

/** twisting, uses HID Z-axis (legacy HID consideration) */
SingleInput twist;

/** input from Ry axis, likely a thumbstick */
SingleInput forwardBackwardThumbstickPivot;

/** input from Rx axis, likely a thumbstick */
SingleInput leftRightThumbstickPivot;

/** input from Rz axis. Sometimes throttle slider, analog brakes or a dial */
SingleInput rotationZ;

/** the hat's northern trigger */
SingleInput hatNorth;

/** the hat's north-eastern trigger */
SingleInput hatNorthEast;

/** the hat's eastern trigger */
SingleInput hatEast;

/** the hat's south-eastern trigger */
SingleInput hatSouthEast;

/** the hat's southern trigger */
SingleInput hatSouth;

/** the hat's south-western trigger */
SingleInput hatSouthWest;

/** the hat's western trigger */
SingleInput hatWest;

/** the hat's north-western trigger */
SingleInput hatNorthWest;

/** slider */
SingleInput slider;

/** dial */
SingleInput dial;

/** the trigger, or button1 */
SingleInput trigger;

/** button 2 */
SingleInput button2;

/** button 3 */
SingleInput button3;

/** button 4 */
SingleInput button4;

/** button 5 */
SingleInput button5;

/** button 6 */
SingleInput button6;

/** button 7 */
SingleInput button7;

/** button 8 */
SingleInput button8;

/** button 9 */
SingleInput button9;

/** button 10 */
SingleInput button10;

/** button 11 */
SingleInput button11;

/** button 12 */
SingleInput button12;

/** button 13 */
SingleInput button13;

/** button 14 */
SingleInput button14;

/** button 15 */
SingleInput button15;

/** button 16 */
SingleInput button16;

/** button 17 */
SingleInput button17;

/** button 18 */
SingleInput button18;

/** button 19 */
SingleInput button19;

/** button 20 */
SingleInput button20;

/** button 21 */
SingleInput button21;

/** button 22 */
SingleInput button22;

/** button 23 */
SingleInput button23;

/** button 24 */
SingleInput button24;

/** button 25 */
SingleInput button25;

/** button 26 */
SingleInput button26;

/** button 27 */
SingleInput button27;

/** button 28 */
SingleInput button28;

/** button 29 */
SingleInput button29;

/** button 30 */
SingleInput button30;

/** button 31 */
SingleInput button31;

/** button 32 */
SingleInput button32;

protected:

virtual const std::vector<Configurable>& getConfigurables();

private:

ThrustMasterAvaBase& operator=(const ThrustMasterAvaBase&);

};

} // namespace idf

#endif
35 changes: 35 additions & 0 deletions include/idf/UsbThrustMasterAvaBase.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
PURPOSE:
LIBRARY DEPENDENCIES: (
(idf/UsbThrustMasterAvaBase.cpp)
)
*/

/**
* @trick_parse{everything}
* @trick_link_dependency{idf/UsbThrustMasterAvaBase.cpp}
*/

#ifndef USB_THRUSTMASTER_AVA_BASE_HH
#define USB_THRUSTMASTER_AVA_BASE_HH

#include "idf/UsbDevice.hh"
#include "idf/ThrustMasterAvaBase.hh"

namespace idf {

/** USB ThrustMasterAvaBase joystick */
class UsbThrustMasterAvaBase : public UsbDevice, public virtual ThrustMasterAvaBase {

public:

/** constructor */
UsbThrustMasterAvaBase();

virtual void decode(const std::vector<unsigned char>& data);

};

} // name space idf

#endif
Loading
Loading