mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Merge branch 'revo-next' of ssh://git.openpilot.org/revo into revo-next
This commit is contained in:
commit
99165abaf7
@ -565,11 +565,14 @@ void flightDataModel::readFromFile(QString fileName)
|
|||||||
//TODO warning message
|
//TODO warning message
|
||||||
removeRows(0,rowCount());
|
removeRows(0,rowCount());
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
file.open(QIODevice::ReadOnly);
|
||||||
QDomDocument doc("PathPlan");
|
QDomDocument doc("PathPlan");
|
||||||
if (!doc.setContent(file.readAll())) {
|
QByteArray array=file.readAll();
|
||||||
|
QString error;
|
||||||
|
if (!doc.setContent(array,&error)) {
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText(tr("File Parsing Failed."));
|
msgBox.setText(tr("File Parsing Failed."));
|
||||||
msgBox.setInformativeText(tr("This file is not a correct XML file"));
|
msgBox.setInformativeText(QString(tr("This file is not a correct XML file:%0")).arg(error));
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
return;
|
return;
|
||||||
@ -616,7 +619,7 @@ void flightDataModel::readFromFile(QString fileName)
|
|||||||
else if(field.attribute("name")=="altitude")
|
else if(field.attribute("name")=="altitude")
|
||||||
data->altitude=field.attribute("value").toDouble();
|
data->altitude=field.attribute("value").toDouble();
|
||||||
else if(field.attribute("name")=="velocity")
|
else if(field.attribute("name")=="velocity")
|
||||||
data->velocity=field.attribute("value").toDouble();
|
data->velocity=field.attribute("value").toFloat();
|
||||||
else if(field.attribute("name")=="mode")
|
else if(field.attribute("name")=="mode")
|
||||||
data->mode=field.attribute("value").toInt();
|
data->mode=field.attribute("value").toInt();
|
||||||
else if(field.attribute("name")=="mode_param0")
|
else if(field.attribute("name")=="mode_param0")
|
||||||
|
@ -143,7 +143,8 @@ void modelUavoProxy::objectsToModel()
|
|||||||
myModel->setData(index,wpfields.Velocity);
|
myModel->setData(index,wpfields.Velocity);
|
||||||
distance=sqrt(wpfields.Position[Waypoint::POSITION_NORTH]*wpfields.Position[Waypoint::POSITION_NORTH]+
|
distance=sqrt(wpfields.Position[Waypoint::POSITION_NORTH]*wpfields.Position[Waypoint::POSITION_NORTH]+
|
||||||
wpfields.Position[Waypoint::POSITION_EAST]*wpfields.Position[Waypoint::POSITION_EAST]);
|
wpfields.Position[Waypoint::POSITION_EAST]*wpfields.Position[Waypoint::POSITION_EAST]);
|
||||||
bearing=acos(wpfields.Position[Waypoint::POSITION_NORTH]/wpfields.Position[Waypoint::POSITION_EAST])*180/M_PI;
|
bearing=atan2(wpfields.Position[Waypoint::POSITION_EAST],wpfields.Position[Waypoint::POSITION_NORTH])*180/M_PI;
|
||||||
|
|
||||||
if(bearing!=bearing)
|
if(bearing!=bearing)
|
||||||
bearing=0;
|
bearing=0;
|
||||||
index=myModel->index(x,flightDataModel::DISRELATIVE);
|
index=myModel->index(x,flightDataModel::DISRELATIVE);
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="GroundTruth" singleinstance="true" settings="false">
|
<object name="GroundTruth" singleinstance="true" settings="false">
|
||||||
<description>Ground truth data output by a simulator.</description>
|
<description>Ground truth data output by a simulator.</description>
|
||||||
<field name="AccelerationXYZ" units="m/s^2" type="float" elements="3"/>
|
<field name="AccelerationXYZ" units="m/s^2" type="float" elements="3"/>
|
||||||
<field name="PositionNED" units="m" type="float" elements="3"/>
|
<field name="PositionNED" units="m" type="float" elements="3"/>
|
||||||
<field name="VelocityNED" units="m/s" type="float" elements="3"/>
|
<field name="VelocityNED" units="m/s" type="float" elements="3"/>
|
||||||
<field name="RPY" units="deg" type="float" elements="3"/>
|
<field name="RPY" units="deg" type="float" elements="3"/>
|
||||||
<field name="AngularRates" units="deg/s" type="float" elements="3"/>
|
<field name="AngularRates" units="deg/s" type="float" elements="3"/>
|
||||||
<field name="TrueAirspeed" units="m/s" type="float" elements="1"/>
|
<field name="TrueAirspeed" units="m/s" type="float" elements="1"/>
|
||||||
<field name="CalibratedAirspeed" units="m/s" type="float" elements="1"/>
|
<field name="CalibratedAirspeed" units="m/s" type="float" elements="1"/>
|
||||||
<field name="AngleOfAttack" units="deg" type="float" elements="1"/>
|
<field name="AngleOfAttack" units="deg" type="float" elements="1"/>
|
||||||
<field name="AngleOfSlip" units="deg" type="float" elements="1"/>
|
<field name="AngleOfSlip" units="deg" type="float" elements="1"/>
|
||||||
<access gcs="readwrite" flight="readonly"/>
|
<access gcs="readwrite" flight="readonly"/>
|
||||||
<telemetrygcs acked="false" updatemode="periodic" period="1000"/>
|
<telemetrygcs acked="false" updatemode="periodic" period="1000"/>
|
||||||
<telemetryflight acked="false" updatemode="manual" period="50000"/>
|
<telemetryflight acked="false" updatemode="manual" period="50000"/>
|
||||||
<logging updatemode="manual" period="0"/>
|
<logging updatemode="manual" period="0"/>
|
||||||
</object>
|
</object>
|
||||||
</xml>
|
</xml>
|
||||||
|
Loading…
Reference in New Issue
Block a user