Code Monkey home page Code Monkey logo

spacenav-rtt's Introduction

spacenav-rtt

SpaceNav (3Dconnection) Driver for Linux (Xenomai) using OROCOS-RTT

spacenav-rtt's People

Contributors

xwavex avatar

Watchers

 avatar  avatar

Forkers

ubi-agni

spacenav-rtt's Issues

Automatically retrieve the right input file to open

https://github.com/xwavex/spacenav-rsb/blob/ca9522f63b18cbaa1d1b7aaf22456003df4bdf0e/src/spacenav-rsb.cpp#L190

Use functionality inspired by:

// try to find 3DConnexion SpaceNavigator first
    int i = 0;
    int fd = -1;
    char *fname = NULL;
    struct input_id ID;

    fname = (char *)malloc(1000 * sizeof(char));
    while (i < 32)
    {
        sprintf(fname, "/dev/input/event%d", i++);
        fd = open(fname, O_RDWR | O_NONBLOCK);
        if (fd > 0)
        {
            ioctl(fd, EVIOCGID, &ID);        // get device ID
            if (                            // For a nice list see http://spacemice.org/index.php?title=Dev
                ((ID.vendor == 0x046d) && // Logitech's Vendor ID, used by 3DConnexion until they got their own.
                    (
                        (ID.product == 0xc603) || // SpaceMouse (untested)
                        (ID.product == 0xc605) || // CADMan (untested)
                        (ID.product == 0xc606) || // SpaceMouse Classic (untested)
                        (ID.product == 0xc621) || // SpaceBall 5000
                        (ID.product == 0xc623) || // SpaceTraveler (untested)
                        (ID.product == 0xc625) || // SpacePilot (untested)
                        (ID.product == 0xc626) || // SpaceNavigators
                        (ID.product == 0xc627) || // SpaceExplorer (untested)
                        (ID.product == 0xc628) || // SpaceNavigator for Notebooks (untested)
                        (ID.product == 0xc629) || // SpacePilot Pro (untested)
                        (ID.product == 0xc62b) || // SpaceMousePro
                        0
                    )
                ) ||
                ((ID.vendor == 0x256F) && // 3Dconnexion's Vendor ID
                    (
                        (ID.product == 0xc62E) || // SpaceMouse Wireless (cable) (untested)
                        (ID.product == 0xc62F) || // SpaceMouse Wireless (receiver) (untested)
                        (ID.product == 0xc631) || // Spacemouse Wireless (untested)
                        (ID.product == 0xc632) || // SpacemousePro Wireless (untested)
                        0
                    )
                ))
            {
                printf("Using evdev device: %s\n", fname);
                break;
            } else {
                close(fd);
                fd = -1;
            }
        }
    }

    if(fd > 0)
    {


    }

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.