1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

removed surplus NEDposition uavobject

This commit is contained in:
Corvus Corax 2012-11-06 10:13:09 +01:00
parent 3c8ffa9773
commit 5981d9acd6
8 changed files with 20 additions and 41 deletions

View File

@ -63,7 +63,6 @@
#include "gyrosbias.h" #include "gyrosbias.h"
#include "homelocation.h" #include "homelocation.h"
#include "magnetometer.h" #include "magnetometer.h"
#include "nedposition.h"
#include "positionactual.h" #include "positionactual.h"
#include "revocalibration.h" #include "revocalibration.h"
#include "revosettings.h" #include "revosettings.h"
@ -128,7 +127,6 @@ int32_t AttitudeInitialize(void)
{ {
AttitudeActualInitialize(); AttitudeActualInitialize();
AttitudeSettingsInitialize(); AttitudeSettingsInitialize();
NEDPositionInitialize();
PositionActualInitialize(); PositionActualInitialize();
VelocityActualInitialize(); VelocityActualInitialize();
RevoSettingsInitialize(); RevoSettingsInitialize();
@ -455,13 +453,6 @@ static int32_t updateAttitudeComplementary(bool first_run)
GPSPositionGet(&gpsPosition); GPSPositionGet(&gpsPosition);
getNED(&gpsPosition, NED); getNED(&gpsPosition, NED);
NEDPositionData nedPosition;
NEDPositionGet(&nedPosition);
nedPosition.North = NED[0];
nedPosition.East = NED[1];
nedPosition.Down = NED[2];
NEDPositionSet(&nedPosition);
PositionActualData positionActual; PositionActualData positionActual;
PositionActualGet(&positionActual); PositionActualGet(&positionActual);
positionActual.North = NED[0]; positionActual.North = NED[0];
@ -776,14 +767,6 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode)
(1.0f - BARO_OFFSET_LOWPASS_ALPHA ) (1.0f - BARO_OFFSET_LOWPASS_ALPHA )
* ( -NED[2] - baroData.Altitude ); * ( -NED[2] - baroData.Altitude );
// Store this for inspecting offline
NEDPositionData nedPos;
NEDPositionGet(&nedPos);
nedPos.North = NED[0];
nedPos.East = NED[1];
nedPos.Down = NED[2];
NEDPositionSet(&nedPos);
} else if (!outdoor_mode) { } else if (!outdoor_mode) {
INSSetPosVelVar(1e2f, 1e2f); INSSetPosVelVar(1e2f, 1e2f);
vel[0] = vel[1] = vel[2] = 0; vel[0] = vel[1] = vel[2] = 0;

View File

@ -60,7 +60,6 @@
#include "fixedwingpathfollowersettings.h" #include "fixedwingpathfollowersettings.h"
#include "fixedwingpathfollowerstatus.h" #include "fixedwingpathfollowerstatus.h"
#include "homelocation.h" #include "homelocation.h"
#include "nedposition.h"
#include "stabilizationdesired.h" #include "stabilizationdesired.h"
#include "stabilizationsettings.h" #include "stabilizationsettings.h"
#include "systemsettings.h" #include "systemsettings.h"

View File

@ -60,9 +60,9 @@
#include "pathstatus.h" #include "pathstatus.h"
#include "gpsvelocity.h" #include "gpsvelocity.h"
#include "gpsposition.h" #include "gpsposition.h"
#include "homelocation.h"
#include "vtolpathfollowersettings.h" #include "vtolpathfollowersettings.h"
#include "nedaccel.h" #include "nedaccel.h"
#include "nedposition.h"
#include "stabilizationdesired.h" #include "stabilizationdesired.h"
#include "stabilizationsettings.h" #include "stabilizationsettings.h"
#include "systemsettings.h" #include "systemsettings.h"
@ -75,6 +75,7 @@
#define STACK_SIZE_BYTES 1548 #define STACK_SIZE_BYTES 1548
#define TASK_PRIORITY (tskIDLE_PRIORITY+2) #define TASK_PRIORITY (tskIDLE_PRIORITY+2)
#define F_PI 3.14159265358979323846f #define F_PI 3.14159265358979323846f
#define DEG2RAD (F_PI/180.0f)
// Private types // Private types
@ -348,11 +349,24 @@ void updateEndpointVelocity()
break; break;
case VTOLPATHFOLLOWERSETTINGS_POSITIONSOURCE_GPSPOS: case VTOLPATHFOLLOWERSETTINGS_POSITIONSOURCE_GPSPOS:
{ {
NEDPositionData nedPosition; // this used to work with the NEDposition UAVObject
NEDPositionGet(&nedPosition); // however this UAVObject has been removed
northPos = nedPosition.North; GPSPositionData gpsPosition;
eastPos = nedPosition.East; GPSPositionGet(&gpsPosition);
downPos = nedPosition.Down; HomeLocationData homeLocation;
HomeLocationGet(&homeLocation);
float lat = homeLocation.Latitude / 10.0e6f * DEG2RAD;
float alt = homeLocation.Altitude;
float T[3] = { alt+6.378137E6f,
cosf(lat)*(alt+6.378137E6f),
-1.0f};
float NED[3] = {T[0] * ((gpsPosition.Latitude - homeLocation.Latitude) / 10.0e6f * DEG2RAD),
T[1] * ((gpsPosition.Longitude - homeLocation.Longitude) / 10.0e6f * DEG2RAD),
T[2] * ((gpsPosition.Altitude + gpsPosition.GeoidSeparation - homeLocation.Altitude))};
northPos = NED[0];
eastPos = NED[1];
downPos = NED[2];
} }
break; break;
default: default:

View File

@ -63,7 +63,6 @@ UAVOBJSRCFILENAMES += manualcontrolsettings
UAVOBJSRCFILENAMES += mixersettings UAVOBJSRCFILENAMES += mixersettings
UAVOBJSRCFILENAMES += mixerstatus UAVOBJSRCFILENAMES += mixerstatus
UAVOBJSRCFILENAMES += nedaccel UAVOBJSRCFILENAMES += nedaccel
UAVOBJSRCFILENAMES += nedposition
UAVOBJSRCFILENAMES += objectpersistence UAVOBJSRCFILENAMES += objectpersistence
UAVOBJSRCFILENAMES += overosyncstats UAVOBJSRCFILENAMES += overosyncstats
UAVOBJSRCFILENAMES += overosyncsettings UAVOBJSRCFILENAMES += overosyncsettings

View File

@ -63,7 +63,6 @@ UAVOBJSRCFILENAMES += manualcontrolsettings
UAVOBJSRCFILENAMES += mixersettings UAVOBJSRCFILENAMES += mixersettings
UAVOBJSRCFILENAMES += mixerstatus UAVOBJSRCFILENAMES += mixerstatus
UAVOBJSRCFILENAMES += nedaccel UAVOBJSRCFILENAMES += nedaccel
UAVOBJSRCFILENAMES += nedposition
UAVOBJSRCFILENAMES += objectpersistence UAVOBJSRCFILENAMES += objectpersistence
UAVOBJSRCFILENAMES += overosyncstats UAVOBJSRCFILENAMES += overosyncstats
UAVOBJSRCFILENAMES += overosyncsettings UAVOBJSRCFILENAMES += overosyncsettings

View File

@ -61,7 +61,6 @@ UAVOBJSRCFILENAMES += manualcontrolsettings
UAVOBJSRCFILENAMES += mixersettings UAVOBJSRCFILENAMES += mixersettings
UAVOBJSRCFILENAMES += mixerstatus UAVOBJSRCFILENAMES += mixerstatus
UAVOBJSRCFILENAMES += nedaccel UAVOBJSRCFILENAMES += nedaccel
UAVOBJSRCFILENAMES += nedposition
UAVOBJSRCFILENAMES += objectpersistence UAVOBJSRCFILENAMES += objectpersistence
UAVOBJSRCFILENAMES += overosyncstats UAVOBJSRCFILENAMES += overosyncstats
UAVOBJSRCFILENAMES += pathaction UAVOBJSRCFILENAMES += pathaction

View File

@ -87,7 +87,6 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
$$UAVOBJECT_SYNTHETICS/flightplancontrol.h \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.h \
$$UAVOBJECT_SYNTHETICS/watchdogstatus.h \ $$UAVOBJECT_SYNTHETICS/watchdogstatus.h \
$$UAVOBJECT_SYNTHETICS/nedaccel.h \ $$UAVOBJECT_SYNTHETICS/nedaccel.h \
$$UAVOBJECT_SYNTHETICS/nedposition.h \
$$UAVOBJECT_SYNTHETICS/sonaraltitude.h \ $$UAVOBJECT_SYNTHETICS/sonaraltitude.h \
$$UAVOBJECT_SYNTHETICS/flightstatus.h \ $$UAVOBJECT_SYNTHETICS/flightstatus.h \
$$UAVOBJECT_SYNTHETICS/hwsettings.h \ $$UAVOBJECT_SYNTHETICS/hwsettings.h \
@ -167,7 +166,6 @@ SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
$$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \
$$UAVOBJECT_SYNTHETICS/watchdogstatus.cpp \ $$UAVOBJECT_SYNTHETICS/watchdogstatus.cpp \
$$UAVOBJECT_SYNTHETICS/nedaccel.cpp \ $$UAVOBJECT_SYNTHETICS/nedaccel.cpp \
$$UAVOBJECT_SYNTHETICS/nedposition.cpp \
$$UAVOBJECT_SYNTHETICS/sonaraltitude.cpp \ $$UAVOBJECT_SYNTHETICS/sonaraltitude.cpp \
$$UAVOBJECT_SYNTHETICS/uavobjectsinit.cpp \ $$UAVOBJECT_SYNTHETICS/uavobjectsinit.cpp \
$$UAVOBJECT_SYNTHETICS/flightstatus.cpp \ $$UAVOBJECT_SYNTHETICS/flightstatus.cpp \

View File

@ -1,12 +0,0 @@
<xml>
<object name="NEDPosition" singleinstance="true" settings="false">
<description>Contains the current position relative to @ref HomeLocation</description>
<field name="North" units="m" type="float" elements="1"/>
<field name="East" units="m" type="float" elements="1"/>
<field name="Down" units="m" type="float" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<logging updatemode="periodic" period="1000"/>
</object>
</xml>