Upgrading eclipse; minor adjustments to Guidance
Benjamin Bardin
10 years ago
2 | 2 | <classpathentry excluding="org/haldean/blob/JavaImage.java|org/haldean/blob/SegmentTest.java|org/haldean/chopper/pilot/nav/NavListTest.java|org/haldean/chopper/pilot/nav/NavVelTest.java|org/haldean/chopper/pilot/test/|org/haldean/chopper/server/" kind="src" path="src"/> |
3 | 3 | <classpathentry kind="src" path="gen"/> |
4 | 4 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> |
5 | <classpathentry kind="lib" path="/home/benjamin/workspace/droidcopter/jars/AndroidBluetoothLibrary.jar"/> | |
6 | <classpathentry kind="output" path="bin"/> | |
5 | <classpathentry exported="true" kind="lib" path="/home/benjamin/workspace/droidcopter/jars/AndroidBluetoothLibrary.jar"/> | |
6 | <classpathentry kind="lib" path="libs/AmarinoLibrary.jar"/> | |
7 | <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | |
8 | <classpathentry kind="output" path="bin/classes"/> | |
7 | 9 | </classpath> |
0 | # This file is automatically generated by Android Tools. | |
1 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! | |
2 | # | |
3 | # This file must be checked in Version Control Systems. | |
4 | # | |
5 | # To customize properties used by the Ant build system use, | |
6 | # "build.properties", and override values to adapt the script to your | |
7 | # project structure. | |
8 | ||
9 | # Indicates whether an apk should be generated for each density. | |
10 | split.density=false | |
11 | # Project target. | |
12 | target=android-10 |
3 | 3 | <classpathentry excluding="org/haldean/chopper/pilot/" including="org/haldean/chopper/pilot/test/" kind="src" path="gen"/> |
4 | 4 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> |
5 | 5 | <classpathentry combineaccessrules="false" kind="src" path="/Pilot"/> |
6 | <classpathentry kind="output" path="bin"/> | |
6 | <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | |
7 | <classpathentry kind="output" path="bin/classes"/> | |
7 | 8 | </classpath> |
Binary diff not shown
0 | # This file is automatically generated by Android Tools. | |
1 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! | |
2 | # | |
3 | # This file must be checked in Version Control Systems. | |
4 | # | |
5 | # To customize properties used by the Ant build system use, | |
6 | # "build.properties", and override values to adapt the script to your | |
7 | # project structure. | |
8 | ||
9 | # Project target. | |
10 | target=android-10 |
756 | 756 | |
757 | 757 | /* ---------- use setForeground() but be also backward compatible ---------- */ |
758 | 758 | |
759 | @SuppressWarnings("unchecked") | |
759 | ||
760 | @SuppressWarnings("rawtypes") | |
760 | 761 | private static final Class[] mStartForegroundSignature = new Class[] { |
761 | 762 | int.class, Notification.class}; |
762 | @SuppressWarnings("unchecked") | |
763 | @SuppressWarnings("rawtypes") | |
763 | 764 | private static final Class[] mStopForegroundSignature = new Class[] { |
764 | 765 | boolean.class}; |
765 | 766 |
430 | 430 | setReadingField(ROLL, orientation[2] * -180.0 / Math.PI); |
431 | 431 | break; |
432 | 432 | case Sensor.TYPE_ROTATION_VECTOR: |
433 | Log.v(TAG, "my grav time: " + ((time - grav_time)/1000000)); | |
433 | //Log.v(TAG, "my grav time: " + ((time - grav_time)/1000000)); | |
434 | 434 | grav_time = time; |
435 | 435 | String timestring = Long.toString(time/1000000); |
436 | 436 | try { |
125 | 125 | //Temporary: need real tuning values at some point. Crap. |
126 | 126 | for (int i = 0; i < 3; i++) |
127 | 127 | mGain[i][0] = .01; |
128 | mGain[3][0] = .01; | |
128 | //mGain[3][0] = .01; | |
129 | 129 | |
130 | 130 | try { |
131 | 131 | if (mEnableLogging) |
261 | 261 | } |
262 | 262 | if (parts[1].equals("MANUAL")) { |
263 | 263 | //autoPilot(false); |
264 | @SuppressWarnings("unused") | |
264 | 265 | String log = "manual mode: "; |
265 | 266 | if (parts.length > 2) { |
266 | 267 | double[] newTarget = new double[4]; |
271 | 272 | //Log.v(TAG, log); |
272 | 273 | newTarget[0] *= Angler.MAX_ANGLE; |
273 | 274 | newTarget[1] *= Angler.MAX_ANGLE; |
274 | newTarget[2] *= 3.0; | |
275 | // newTarget[2] *= 3.0; | |
275 | 276 | synchronized (mAngleTarget) { |
276 | 277 | System.arraycopy(newTarget, 0, mAngleTarget, 0, 4); |
277 | 278 | } |
307 | 308 | |
308 | 309 | double[] errors = new double[4]; |
309 | 310 | synchronized (mAngleTarget) { |
310 | logArray("mAngleTarget", mAngleTarget); | |
311 | //logArray("mAngleTarget", mAngleTarget); | |
311 | 312 | errors[0] = mAngleTarget[0] - mRollDeg; |
312 | 313 | errors[1] = mAngleTarget[1] - mPitchDeg; |
313 | 314 | errors[2] = mAngleTarget[2] - mStatus.getGpsField(dALT); |
314 | 315 | errors[3] = mAngleTarget[3] - mAzimuth; |
315 | logArray("errors", errors); | |
316 | } | |
317 | ||
316 | //logArray("errors", errors); | |
317 | } | |
318 | ||
319 | @SuppressWarnings("unused") | |
318 | 320 | String errs = "errors: "; |
319 | 321 | for (int i = 0; i < 4; i++) { |
320 | 322 | errs += errors[i] + ": "; |
366 | 368 | // Constrain control vars: |
367 | 369 | mControlVars[0] = constrainValue(mControlVars[0], -1, 1); |
368 | 370 | mControlVars[1] = constrainValue(mControlVars[1], -1, 1); |
369 | mControlVars[2] = constrainValue(mControlVars[2], 0, 4); | |
371 | mControlVars[2] = constrainValue(mControlVars[2], 0, 1); | |
370 | 372 | mControlVars[3] = constrainValue(mControlVars[3], -2, 2); |
371 | 373 | |
372 | 374 | /*String vars = "Control vars: "; |
383 | 385 | //Log.v(TAG, "motors: " + mMotorSpeed[0] + ", " + mMotorSpeed[1] + ", " + mMotorSpeed[2] + ", " + mMotorSpeed[3]); |
384 | 386 | //Sleep a while |
385 | 387 | long timetonext = (1000 / PIDREPS) - (System.currentTimeMillis() - starttime); |
386 | Log.v(TAG, "time to next: " + timetonext); | |
388 | //Log.v(TAG, "time to next: " + timetonext); | |
387 | 389 | int currentMode = mGuidanceMode.get(); |
388 | 390 | if ((currentMode == MANUAL) || (currentMode == AUTOPILOT)) { |
389 | 391 | if (timetonext > 0) |
413 | 415 | if (cosGrad != 0) { |
414 | 416 | z = mControlVars[2] / cosGrad; |
415 | 417 | } else { |
416 | z = mControlVars[2]; | |
418 | z = mControlVars[2]; // Chopper is vertical, we got other problems. | |
417 | 419 | } |
418 | 420 | double t = mControlVars[3]; |
419 | 421 | |
421 | 423 | mMotorSpeed[1] = Math.sqrt(constrainValue(t + 2*y + z, 0, 1)); |
422 | 424 | mMotorSpeed[2] = Math.sqrt(constrainValue(-t - 2*x + z, 0, 1)); |
423 | 425 | mMotorSpeed[3] = Math.sqrt(constrainValue(-t + 2*x + z, 0, 1)); |
426 | logArray("motorSpeeds", mMotorSpeed); | |
424 | 427 | } |
425 | 428 | |
426 | 429 | private void updateAngleTarget() { |