From 56aca6a8ec5960a39541377c61e7629bbf1e0056 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 22 Mar 2011 12:59:17 -0500 Subject: [PATCH] Make fake telemetry show rotating attitude. --- .../org/openpilot/androidgcs/OPTelemetryService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java b/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java index 5af7c7d60..43cc13b04 100644 --- a/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java +++ b/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java @@ -200,8 +200,19 @@ public class OPTelemetryService extends Service { //toastMessage("Started fake telemetry thread"); UAVDataObject systemStats = (UAVDataObject) objMngr.getObject("SystemStats"); + UAVDataObject attitudeActual = (UAVDataObject) objMngr.getObject("AttitudeActual"); + double roll = 0; + double pitch = 0; + double yaw = 0; while( !terminate ) { + attitudeActual.getField("Roll").setDouble(roll); + attitudeActual.getField("Pitch").setDouble(pitch); + attitudeActual.getField("Yaw").setDouble(yaw); + roll = (roll + 10) % 180; + pitch = (pitch + 10) % 180; + yaw = (yaw + 10) % 360; systemStats.updated(); + attitudeActual.updated(); try { Thread.sleep(1000); } catch (InterruptedException e) {