package nl.ru.ai.projects.parrot.dronecontrol.groundstation;
static {
System.loadLibrary("GroundStation");
}
private static native float getYaw0();
private static SDLDroneJoystick instance = null;
public synchronized static SDLDroneJoystick
getInstance() {
if (instance == null) {
if (initJoystick0(0)) {
instance = new SDLDroneJoystick();
}
}
return instance;
}
private boolean destroyed = false;
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
shutdown();
}
});
}
if (destroyed) {
return;
}
destroyed = true;
System.out.println("Invoking joystick destruction");
shutdownJoystick0();
System.out.println("Joystick destroyed");
}
@Override
if (destroyed) {
return false;
}
return getOptionButton0(i);
}
@Override
if (destroyed) {
return 0;
}
return getPitch0();
}
@Override
public synchronized float getYaw() {
if (destroyed) {
return 0;
}
return getYaw0();
}
@Override
if (destroyed) {
return 0;
}
return getRoll0();
}
@Override
if (destroyed) {
return 0;
}
return getHeight0();
}
@Override
if (destroyed) {
return false;
}
return getStartMode0();
}
@Override
if (destroyed) {
return false;
}
return getEmergencyMode0();
}
}