Giter Site home page Giter Site logo

idf's Introduction

Input Device Framework

IDF is a software library that provides an infrastructure for interfacing software with physical input devices. Examples of common devices include hand controllers, joysticks, foot pedals, computer mice, game controllers, etc. Conceptually, the framework can be extended to support any device that produces digital output. IDF additionally presents, and is itself an implementation of, a design methodology that encourages application developers to program against domain-specific interfaces rather than particular hardware devices. This abstraction frees the application from the details of communicating with the underlying devices, resulting in robust and flexible code that is device-agnostic. IDF ensures that devices meet application interface requirements, supports many-to-many relationships between application interfaces and devices, allows for flexible and dynamic interpretation of device inputs, and provides methods for transforming and combining inputs.

The Problem

Software often requires input from external physical devices. The range of devices, data formats, and mediums of communication are virtually limitless. There thus exists a need for a method by which to deliver data to applications in a consistent, well-defined manner, and in an application-defined format. The vast array of ways that devices output data necessitates a separation between the application, which is concerned only with what the data represents, and the devices themselves, which have no notion of how their data is to be used. There must then be a way to bridge this disconnect without burdening either side with details of the other. Barring such a tool, applications may be written against specific devices, but this pollutes the program's primary functionality with a secondary task and forces the application interface to conform to the device's output format. As the consumer of the data, it is preferable for the application to define its own context-specific interface through which the data is received. Changes in the device, data format, or communication medium should not alter the application interface.

A Solution

IDF serves to completely separate the "business" logic of a program from the logic responsible for reading raw input from physical devices. Beyond simply isolating the code, it further aims to abstract each side from the other, so that both pieces can be developed fully independently. Its goal is to enable application developers to write robust, flexible code with clearly delineated interface points which are defined in a domain and context most meaningful to the application.

Architecture

Simulation Interface Layer

This layer defines the point at which external inputs enter the application's primary functional logic. It is here that a developer decides what kind of inputs his system will accept, and in what format it will accept them. Once this interface is established, the developer encodes it as a "controller" by extending IDF and specializing it for this particular application. Devices that wish to service this interface must meet this controller's contract. This layer is the only one with which the primary functional logic should interact.

Hardware Interface Layer

This layer represents the physical input devices and is responsible for all aspects of communication with the hardware, primarily reading and decoding raw data. Devices are classified by their communication medium, and a representation exists for each specific device supported.

Input Abstraction Layer

This layer provides a means by which to tie the above two layers together. It represents device input layouts without regard to their particular medium of communication. A device's available data, represented in this layer, is populated by the Hardware Interface Layer as it is received from the physical device. This data can then be presented to a controller from the Simulation Interface Layer, provided that it can be made to meet that controller's contract.

Wiki

See the wiki for installation instructions and lots of additional information.

License

IDF is released under the NASA Open Source Agreement, Version 1.3.

idf's People

Contributors

ch3pjw avatar dbankieris avatar genti337 avatar htnguye3 avatar john-tiberius avatar jwpetti1 avatar prkunz avatar stephenmontgomerysmith avatar ulvgard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

idf's Issues

core.mk causes S_main to be linked needlessly

By adding a non-existent file as a dependency of $(S_MAIN), it causes $(S_MAIN)'s rule to always be executed, which links the S_main executable, even if trickified_idf.o didn't change.

Add support for 3Dconnexion SpaceMouse Compact

3Dconnexion appears to have re-branded the Space Navigator and Space Explorer under a unified SpaceMouse name. The SpaceMouse Compact looks to be the Space Navigator with new vendor and product IDs.

Move to Python3

Apple removed Python2.7 from new Mac OS update. This breaks anything that doesn't explicitly use Python3

A fix seems to be to change the first line of IDF/bin/idf-config to
#!/usr/bin/env python3

Deadbands apply to raw values

For both Input and Output, a Deadband applies to the "raw" value. This is cumbersome when one wants to apply a percentage-based deadband, which is probably the more common use case.

Add Support for Saitek X-56 HOTAS

Add support for the Saitek Pro Flight X-56 Rhino HOTAS controller. This includes both a Throttle and stick as separate USB devices

Trick examples don't build sometimes

In 3rdParty/trick/makefiles/core.mk, the core and Trickified libraries should be dependencies of $(S_MAIN), not all, as they must be built before S_main is linked.

Run CI on OSX

Looks like Travis CI can test on OSX as well. Let's try!

fix Saitek X52 Flight mapping

The basic SingleFlightController mapping for the X52 is off. Specifically,

  • X should be mapped to Hat2UpDownPivot
  • Z should be mapped to ButtonA and ButtonB

USB paths on Macs don't work

libc++abi.dylib: terminating with uncaught exception of type idf::IOException: Failed to open Space Navigator: Failed to resolve USB_046d_c628_0x7ff5a8a89350: No such file or directory

Add support for specifying an interface number

Devices with multiple interfaces show up as multiple entries in hidapi. For instance, the Hagstrom KE-USB36FS is both a keyboard and a mouse. We need to be able to specify which interface UsbHagstromKEUSB36FS binds to. Currently, we bind to whichever interface happens to be enumerated first, which isn't always the one we want.

IDF can't find Playstation 4 controllers anymore

With the recent addition of support for specifying interface numbers, there's a new way IDF can fail to find devices. UsbDevice initializes the interfaceNumber to 0, but the PS4 controller has only interface 3.

Add lossless updates

InputDevice::update processes all pending packets, which may lose information if inputs are applied and removed between calls. Add a lossless version that processes only a single packet.

Add UsbIndustrialProducts2

I'm not sure why this class doesn't exist yet. I should have created it to go along with the IndustrialProducts2 InputLayout class.

-Wimplicit-conversion-floating-point-to-bool generates warnings

clang version 3.4.2

IDF/include/idf/Server.hh:270:39: warning: implicit conversion turns
      floating-point number into bool: 'double' to 'const bool'
      [-Wimplicit-conversion-floating-point-to-bool]
            result = function(result, unpack((*i)->getCommands().*field));
                     ~~~~~~~~         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IDF/source/idf/RemoteRoboticsController.cpp:33:12: note: in instantiation of
      function template specialization
      'idf::Server<idf::RoboticsControllerCommands>::accumulateClientValues<bool, std::logical_or<bool>
      >' requested here
    return accumulateClientValues(&RoboticsControllerCommands::trigger, std::logical_or<bool>());

The compiler is alerting us that unpack returns a double, but logical_or's arguments are bools. double can be implicitly converted to bool, but such conversions, when accidental, can be difficult to debug. In this case, it's what we want. Server::accumulateClientValues needs to explicitly cast the result of unpack to the expected type.

IDF library should be compiled with -fPIC

I want to include the IDF library in a shared library. To do so I needed to add -fPIC to the CPPFLAGS in the top level Makefile. BTW: CPPFLAGS should be CXXFLAGS. CXXFLAGS are for the compiler, CPPFLAGS are for the preprocessor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.