mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Make fake telemetry show rotating attitude.
This commit is contained in:
parent
5669a3fc33
commit
56aca6a8ec
@ -200,8 +200,19 @@ public class OPTelemetryService extends Service {
|
|||||||
|
|
||||||
//toastMessage("Started fake telemetry thread");
|
//toastMessage("Started fake telemetry thread");
|
||||||
UAVDataObject systemStats = (UAVDataObject) objMngr.getObject("SystemStats");
|
UAVDataObject systemStats = (UAVDataObject) objMngr.getObject("SystemStats");
|
||||||
|
UAVDataObject attitudeActual = (UAVDataObject) objMngr.getObject("AttitudeActual");
|
||||||
|
double roll = 0;
|
||||||
|
double pitch = 0;
|
||||||
|
double yaw = 0;
|
||||||
while( !terminate ) {
|
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();
|
systemStats.updated();
|
||||||
|
attitudeActual.updated();
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user