Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 2.4 KB

README.md

File metadata and controls

66 lines (51 loc) · 2.4 KB

Abstraction Controller Server

This project aims to provide a generic abstraction of any existing controller. The client-side code should keep a minimum size, as it only sees a generic joystick : the server, on which all the drivers are installed, retrieves and translates all the data from the controller into buttons and axes.

Currently, the only implemented controller is the Leap Motion. We are working right now on at least three other controllers.

Prerequisites

Installation

  • Clone the project
  • cd Abstraction-ControllerServer
  • make

Usage

  • Server side
    • Connect your Leap Motion
      • Linux : run sudo leapd
      • Mac OS : just run Leap Motion
    • ./bin/LeapServer <nb_client> <port>
  • Client side
    • C/C++

      #include "socklib.h" // disponible dans /include
      
      int main() {
           int socketClient = CreeSocketClient ("127.0.0.1", "2222");
      
           if (socketClient == -1) {
                fprintf(stderr,"erreur de connexion sur la socket");
                exit (1)
           }
      
           //bla bla
      
           return 0;
      }
      
    • JAVA

      import java.net.*;
      import java.io.*;
      
      public class Client {
          public static void main(String[] args) {
              try {
                  Socket socket = new Socket ("127.0.0.1", 2222);
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
      }