git.haldean.org droidcopter / 4f36743
Fixed eclipse project inclusion/exclusion rules. Benjamin Bardin 10 years ago
4 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
00 <?xml version="1.0" encoding="UTF-8"?>
11 <classpath>
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/server/" kind="src" path="src"/>
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"/>
33 <classpathentry kind="src" path="gen"/>
44 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
55 <classpathentry kind="lib" path="/home/benjamin/workspace/droidcopter/jars/AndroidBluetoothLibrary.jar"/>
00 <?xml version="1.0" encoding="UTF-8"?>
11 <classpath>
2 <classpathentry kind="src" path="src"/>
3 <classpathentry kind="src" path="gen"/>
2 <classpathentry excluding="org/haldean/chopper/pilot" including="org/haldean/chopper/pilot/test/" kind="src" path="src"/>
3 <classpathentry excluding="org/haldean/chopper/pilot/" including="org/haldean/chopper/pilot/test/" kind="src" path="gen"/>
44 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
55 <classpathentry combineaccessrules="false" kind="src" path="/Pilot"/>
66 <classpathentry kind="output" path="bin"/>
4343 * @author Will Brown
4444 */
4545 public final class ChopperStatusImpl implements Runnable, SensorEventListener, Constants, LocationListener, ChopperStatus {
46 public static final String logfilename = "sensors.txt";
46 public static final String logfilename = "orientation_timestamps.txt";
4747 public static BufferedWriter logwriter;
4848
4949 /** Parameter to specify GPS minimum update distance, with the usual trade-off between accuracy and power consumption.
252252 /* Gets a sensor manager */
253253 final SensorManager sensors = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
254254 List<Sensor> sensorList = sensors.getSensorList(Sensor.TYPE_ALL);
255 for (Sensor sensor : sensorList) {
255 /*for (Sensor sensor : sensorList) {
256256 try {
257257 if (logwriter != null) {
258258 logwriter.write("\nName : " + sensor.getName() + "\n");
268268 } catch (IOException e) {
269269 e.printStackTrace();
270270 }
271 }
271 }*/
272272 /* Registers this class as a sensor listener for every necessary sensor. */
273273 //sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
274274 //sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_LIGHT), SensorManager.SENSOR_DELAY_NORMAL);
279279 //sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_PROXIMITY), SensorManager.SENSOR_DELAY_NORMAL);
280280 //sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_TEMPERATURE), SensorManager.SENSOR_DELAY_NORMAL);
281281 //sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_GRAVITY), SensorManager.SENSOR_DELAY_FASTEST);
282 sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR), SensorManager.SENSOR_DELAY_GAME);
282 sensors.registerListener(this, sensors.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR), SensorManager.SENSOR_DELAY_FASTEST);
283283 Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
284284
285285
315315 public void onLocationChanged(Location loc) {
316316 if (loc != null && mGps != null) {
317317 if (!loc.hasAltitude()) {
318 // loc.setAltitude(300.0);
319318 Log.w(TAG, "No altitude fix");
320319 }
321320 double newalt = loc.getAltitude();
423422 case Sensor.TYPE_ROTATION_VECTOR:
424423 Log.v(TAG, "my grav time: " + ((time - grav_time)/1000000));
425424 grav_time = time;
426 String timestring = Long.toString(time);
425 String timestring = Long.toString(time/1000000);
427426 try {
428427 if (logwriter != null) {
429428 logwriter.write(timestring + "\n");