mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Refactored variable names to be more helpful.
This commit is contained in:
parent
6b3cb29ea1
commit
f3e1e768ad
@ -385,7 +385,7 @@ margin:1px;</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
@ -210,9 +210,9 @@ void XplaneSimulator::processUpdate(const QByteArray& dataBuf)
|
||||
float accX = 0;
|
||||
float accY = 0;
|
||||
float accZ = 0;
|
||||
float rollRate=0;
|
||||
float pitchRate=0;
|
||||
float yawRate=0;
|
||||
float rollRate_rad=0;
|
||||
float pitchRate_rad=0;
|
||||
float yawRate_rad=0;
|
||||
|
||||
QString str;
|
||||
QByteArray& buf = const_cast<QByteArray&>(dataBuf);
|
||||
@ -269,10 +269,10 @@ void XplaneSimulator::processUpdate(const QByteArray& dataBuf)
|
||||
velZ = *((float*)(buf.data()+4*5));
|
||||
break;
|
||||
|
||||
case XplaneSimulator::AngularVelocities:
|
||||
pitchRate = *((float*)(buf.data()+4*1));
|
||||
rollRate = *((float*)(buf.data()+4*2));
|
||||
yawRate = *((float*)(buf.data()+4*3));
|
||||
case XplaneSimulator::AngularVelocities: //In [rad/s]
|
||||
pitchRate_rad = *((float*)(buf.data()+4*1));
|
||||
rollRate_rad = *((float*)(buf.data()+4*2));
|
||||
yawRate_rad = *((float*)(buf.data()+4*3));
|
||||
break;
|
||||
|
||||
case XplaneSimulator::Gload:
|
||||
@ -380,8 +380,8 @@ void XplaneSimulator::processUpdate(const QByteArray& dataBuf)
|
||||
//memset(&rawData, 0, sizeof(AttitudeRaw::DataFields));
|
||||
//rawData = attRaw->getData();
|
||||
//rawData.gyros[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] = cos(DEG2RAD * roll) * pitchRate_rad + sin(DEG2RAD * roll) * yawRate_rad;
|
||||
//rawData.gyros_filtered[2] = cos(DEG2RAD * roll) * yawRate_rad - sin(DEG2RAD * roll) * pitchRate_rad;
|
||||
//rawData.gyros[1] = pitchRate;
|
||||
//rawData.gyros[2] = yawRate;
|
||||
//rawData.accels[0] = accX;
|
||||
@ -391,9 +391,9 @@ void XplaneSimulator::processUpdate(const QByteArray& dataBuf)
|
||||
Gyros::DataFields gyroData;
|
||||
memset(&gyroData, 0, sizeof(Gyros::DataFields));
|
||||
#define Pi 3.141529654
|
||||
gyroData.x = rollRate*180/Pi;
|
||||
gyroData.y = pitchRate*180/Pi;
|
||||
gyroData.z = yawRate*180/Pi;
|
||||
gyroData.x = rollRate_rad*180/Pi;
|
||||
gyroData.y = pitchRate_rad*180/Pi;
|
||||
gyroData.z = yawRate_rad*180/Pi;
|
||||
gyros->setData(gyroData);
|
||||
|
||||
Accels::DataFields accelData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user