mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +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:
parent
da3d4cdab8
commit
195c811c90
@ -172,8 +172,9 @@ void FGSimulator::transmitUpdate()
|
|||||||
// Read joystick input
|
// Read joystick input
|
||||||
if(manCtrlData.Armed == ManualControlCommand::ARMED_TRUE)
|
if(manCtrlData.Armed == ManualControlCommand::ARMED_TRUE)
|
||||||
{
|
{
|
||||||
|
// Note: Pitch sign is reversed in FG ?
|
||||||
ailerons = manCtrlData.Roll;
|
ailerons = manCtrlData.Roll;
|
||||||
elevator = manCtrlData.Pitch;
|
elevator = -manCtrlData.Pitch;
|
||||||
rudder = manCtrlData.Yaw;
|
rudder = manCtrlData.Yaw;
|
||||||
throttle = manCtrlData.Throttle;
|
throttle = manCtrlData.Throttle;
|
||||||
}
|
}
|
||||||
@ -184,7 +185,7 @@ void FGSimulator::transmitUpdate()
|
|||||||
actData = actDesired->getData();
|
actData = actDesired->getData();
|
||||||
|
|
||||||
ailerons = actData.Roll;
|
ailerons = actData.Roll;
|
||||||
elevator = actData.Pitch;
|
elevator = -actData.Pitch;
|
||||||
rudder = actData.Yaw;
|
rudder = actData.Yaw;
|
||||||
throttle = actData.Throttle;
|
throttle = actData.Throttle;
|
||||||
}
|
}
|
||||||
@ -226,7 +227,7 @@ void FGSimulator::transmitUpdate()
|
|||||||
if(!settings.manual)
|
if(!settings.manual)
|
||||||
{
|
{
|
||||||
actData.Roll = ailerons;
|
actData.Roll = ailerons;
|
||||||
actData.Pitch = elevator;
|
actData.Pitch = -elevator;
|
||||||
actData.Yaw = rudder;
|
actData.Yaw = rudder;
|
||||||
actData.Throttle = throttle;
|
actData.Throttle = throttle;
|
||||||
//actData.NumLongUpdates = (float)udpCounterFGrecv;
|
//actData.NumLongUpdates = (float)udpCounterFGrecv;
|
||||||
@ -392,7 +393,7 @@ void FGSimulator::processUpdate(const QByteArray& inp)
|
|||||||
rawData.gyros_filtered[0] = rollRate;
|
rawData.gyros_filtered[0] = rollRate;
|
||||||
//rawData.gyros_filtered[1] = cos(DEG2RAD * roll) * pitchRate + sin(DEG2RAD * roll) * yawRate;
|
//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[2] = cos(DEG2RAD * roll) * yawRate - sin(DEG2RAD * roll) * pitchRate;
|
||||||
rawData.gyros_filtered[1] = -pitchRate;
|
rawData.gyros_filtered[1] = pitchRate;
|
||||||
rawData.gyros_filtered[2] = yawRate;
|
rawData.gyros_filtered[2] = yawRate;
|
||||||
attRaw->setData(rawData);
|
attRaw->setData(rawData);
|
||||||
attRaw->updated();
|
attRaw->updated();
|
||||||
|
@ -210,12 +210,17 @@ void Simulator::setupObjects()
|
|||||||
{
|
{
|
||||||
setupInputObject(actDesired, 100);
|
setupInputObject(actDesired, 100);
|
||||||
setupOutputObject(altActual, 250);
|
setupOutputObject(altActual, 250);
|
||||||
setupOutputObject(attActual, 100);
|
setupOutputObject(attActual, 10);
|
||||||
|
//setupOutputObject(attActual, 100);
|
||||||
setupOutputObject(gpsPos, 250);
|
setupOutputObject(gpsPos, 250);
|
||||||
setupOutputObject(posActual, 250);
|
setupOutputObject(posActual, 250);
|
||||||
setupOutputObject(velActual, 250);
|
setupOutputObject(velActual, 250);
|
||||||
setupOutputObject(posHome, 1000);
|
setupOutputObject(posHome, 1000);
|
||||||
setupOutputObject(attRaw, 100);
|
setupOutputObject(attRaw, 10);
|
||||||
|
//setupOutputObject(attRaw, 100);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Simulator::setupInputObject(UAVObject* obj, int updatePeriod)
|
void Simulator::setupInputObject(UAVObject* obj, int updatePeriod)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user