From: Martin Vajnar Date: Tue, 27 Aug 2013 13:14:45 +0000 (+0200) Subject: ROBOT_DEMO: fix wake lock and revert speed computation change X-Git-Tag: v0.3.4~44 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/commitdiff_plain/f116dfa3384626441832ac5ecef7b4851d01cf0b ROBOT_DEMO: fix wake lock and revert speed computation change --- diff --git a/orte/Robot_Demo/src/org/ocera/orte/demo/MainActivity.java b/orte/Robot_Demo/src/org/ocera/orte/demo/MainActivity.java index 008f245..f74ab0f 100644 --- a/orte/Robot_Demo/src/org/ocera/orte/demo/MainActivity.java +++ b/orte/Robot_Demo/src/org/ocera/orte/demo/MainActivity.java @@ -159,8 +159,7 @@ public class MainActivity extends Activity { mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); mWakeLock = mPowerManager.newWakeLock( PowerManager.SCREEN_BRIGHT_WAKE_LOCK - | PowerManager.ACQUIRE_CAUSES_WAKEUP - | PowerManager.ON_AFTER_RELEASE, + | PowerManager.ACQUIRE_CAUSES_WAKEUP, getClass().getName()); mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); diff --git a/orte/Robot_Demo/src/org/ocera/orte/demo/MotionSpeedPublish.java b/orte/Robot_Demo/src/org/ocera/orte/demo/MotionSpeedPublish.java index e8b07f8..b6e475f 100644 --- a/orte/Robot_Demo/src/org/ocera/orte/demo/MotionSpeedPublish.java +++ b/orte/Robot_Demo/src/org/ocera/orte/demo/MotionSpeedPublish.java @@ -14,7 +14,7 @@ public class MotionSpeedPublish implements Runnable { public static final int VMAX = 16000; public static final double r = 0.15; - public final float alpha = 0.8f; + public final float alpha = 0.75f; private short[] speed = new short[2]; private boolean isCancelled = true; @@ -60,8 +60,8 @@ public class MotionSpeedPublish implements Runnable { } omega *= 2; - speed[0] = (short)(-(v + (v>0 ? -r*omega : r*omega))*VMAX); - speed[1] = (short)(-(v - (v>0 ? -r*omega : r*omega))*VMAX); + speed[0] = (short)(-((v + r*omega))*VMAX); + speed[1] = (short)(-(v - r*omega)*VMAX); } public void start() {