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

OP-475: Update HITL for the FlightStatus object

This commit is contained in:
James Cotton 2011-05-08 16:04:26 -05:00
parent 61007fd0eb
commit 785054a694
3 changed files with 6 additions and 3 deletions

View File

@ -155,17 +155,17 @@ void FGSimulator::processReadyRead()
void FGSimulator::transmitUpdate()
{
ActuatorDesired::DataFields actData;
FlightStatus::DataFields flightStatusData = flightStatus->getData();
ManualControlCommand::DataFields manCtrlData = manCtrlCommand->getData();
float ailerons = -1;
float elevator = -1;
float rudder = -1;
float throttle = -1;
if(manCtrlData.FlightMode == ManualControlCommand::FLIGHTMODE_MANUAL)
if(flightStatusData.FlightMode == FlightStatus::FLIGHTMODE_MANUAL)
{
// Read joystick input
if(manCtrlData.Armed == ManualControlCommand::ARMED_TRUE)
if(flightStatusData.Armed == FlightStatus::ARMED_ARMED)
{
// Note: Pitch sign is reversed in FG ?
ailerons = manCtrlData.Roll;

View File

@ -125,6 +125,7 @@ void Simulator::onStart()
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
actDesired = ActuatorDesired::GetInstance(objManager);
manCtrlCommand = ManualControlCommand::GetInstance(objManager);
flightStatus = FlightStatus::GetInstance(objManager);
posHome = HomeLocation::GetInstance(objManager);
velActual = VelocityActual::GetInstance(objManager);
posActual = PositionActual::GetInstance(objManager);

View File

@ -46,6 +46,7 @@
#include "homelocation.h"
#include "attituderaw.h"
#include "gcstelemetrystats.h"
#include "flightstatus.h"
#include "utils/coordinateconversions.h"
@ -170,6 +171,7 @@ protected:
ActuatorDesired* actDesired;
ManualControlCommand* manCtrlCommand;
FlightStatus* flightStatus;
BaroAltitude* altActual;
AttitudeActual* attActual;
VelocityActual* velActual;