1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

HITL/SITL: Flightgear now works in SITL mode with the current stabilization algorithm which includes gyro rates. Upped the rate for attitudeactual and attituderaw to a value which makes the stabilization algo work properly, will cause trouble on slow machines.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2267 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-12-21 20:21:00 +00:00 committed by edouard
parent da3d4cdab8
commit 195c811c90
2 changed files with 12 additions and 6 deletions

View File

@ -172,8 +172,9 @@ void FGSimulator::transmitUpdate()
// Read joystick input
if(manCtrlData.Armed == ManualControlCommand::ARMED_TRUE)
{
// Note: Pitch sign is reversed in FG ?
ailerons = manCtrlData.Roll;
elevator = manCtrlData.Pitch;
elevator = -manCtrlData.Pitch;
rudder = manCtrlData.Yaw;
throttle = manCtrlData.Throttle;
}
@ -184,7 +185,7 @@ void FGSimulator::transmitUpdate()
actData = actDesired->getData();
ailerons = actData.Roll;
elevator = actData.Pitch;
elevator = -actData.Pitch;
rudder = actData.Yaw;
throttle = actData.Throttle;
}
@ -226,7 +227,7 @@ void FGSimulator::transmitUpdate()
if(!settings.manual)
{
actData.Roll = ailerons;
actData.Pitch = elevator;
actData.Pitch = -elevator;
actData.Yaw = rudder;
actData.Throttle = throttle;
//actData.NumLongUpdates = (float)udpCounterFGrecv;
@ -392,7 +393,7 @@ void FGSimulator::processUpdate(const QByteArray& inp)
rawData.gyros_filtered[0] = rollRate;
//rawData.gyros_filtered[1] = cos(DEG2RAD * roll) * pitchRate + sin(DEG2RAD * roll) * yawRate;
//rawData.gyros_filtered[2] = cos(DEG2RAD * roll) * yawRate - sin(DEG2RAD * roll) * pitchRate;
rawData.gyros_filtered[1] = -pitchRate;
rawData.gyros_filtered[1] = pitchRate;
rawData.gyros_filtered[2] = yawRate;
attRaw->setData(rawData);
attRaw->updated();

View File

@ -210,12 +210,17 @@ void Simulator::setupObjects()
{
setupInputObject(actDesired, 100);
setupOutputObject(altActual, 250);
setupOutputObject(attActual, 100);
setupOutputObject(attActual, 10);
//setupOutputObject(attActual, 100);
setupOutputObject(gpsPos, 250);
setupOutputObject(posActual, 250);
setupOutputObject(velActual, 250);
setupOutputObject(posHome, 1000);
setupOutputObject(attRaw, 100);
setupOutputObject(attRaw, 10);
//setupOutputObject(attRaw, 100);
}
void Simulator::setupInputObject(UAVObject* obj, int updatePeriod)