private CmdData process(Odometry odometry) {
        comm.send(odometry);
        JXInputManager.updateFeatures();
//        double e = -ax_y.getValue();
        double e = 0;
        if (Math.abs(e) < 0.1) {
            e = 0.0;
        }
//        double a = ax_x.getValue();
        double a = 0;
        if (Math.abs(a) < 0.1) {
            a = 0;
        }
//        double t = ax_t.getValue();
        double t = 0;

        // Throttle PI
        if (t > 0.1 || odometry.altitude > 5) {
            pid_t.setRef(set_speed * (1 + t));
            t = pid_t.update(odometry.speed);
        } else {
            t = 1;
        }

        if (odometry.hasGPS) {
            Vec2d location = new Vec2d(odometry.gpsLatitude - destination.x, odometry.gpsLongitude - destination.y);
            if (location.length() < 0.001) {
                comm.destinationReached();
            }
            c_heading = location.angle();
        }
        double c_err = 0;
        if (odometry.altitude > 5) {
            // Heading need to adjust for roll around, so we work on heading error:
            c_err = (odometry.compass - c_heading) * 180 / Math.PI;
            if (c_err > 180) {
                c_err -= 360;
            } else if (c_err < -180) {
                c_err += 360;
            }
            double c = pid_c.update(c_err);
            pid_a.setRef(c * max_roll);
            a = pid_a.update(odometry.roll * 180 / Math.PI);

            // Altitude adjustment
            pid_h.setRef(destination.z);
            double h = pid_h.update(odometry.altitude);
//            e = -0.1 * h;
            pid_e.setRef(-max_pitch * h);
            e = pid_e.update(odometry.pitch * 180 / Math.PI);
            // Compensatre for roll
            e -= pitch_ff * odometry.roll * odometry.roll;
        } else {
//             Takeoff
            pid_e.setRef(-max_pitch);
            e = pid_e.update(odometry.pitch * 180 / Math.PI);
        }

        CmdData cmd = new CmdData(
                a,// Aileron
                e,// Elevator
                0, // Unused
                t // Throttle
                );

        return cmd;
    }