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:
parent
61007fd0eb
commit
785054a694
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user