Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
acbacef3
Commit
acbacef3
authored
Jul 30, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autopilot plugin and airframe loader: Move to new-style map approach
parent
2b83ce66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
96 deletions
+111
-96
AirframeComponentAirframes.cc
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
+96
-83
AirframeComponentAirframes.h
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.h
+5
-12
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+7
-0
PX4AutoPilotPlugin.h
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
+3
-1
No files found.
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
View file @
acbacef3
...
...
@@ -26,86 +26,99 @@
#include "AirframeComponentAirframes.h"
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoStandardPlane
[]
=
{
{
"Multiplex Easystar 1/2"
,
2100
},
{
"Generic AERT"
,
2101
},
{
"3DR Skywalker"
,
2102
},
{
"Skyhunter (1800 mm)"
,
2103
},
{
"Generic AETR"
,
2104
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoSimulation
[]
=
{
{
"Plane (HilStar, X-Plane)"
,
1000
},
{
"Plane (Rascal, FlightGear)"
,
1004
},
{
"Quad X HIL"
,
1001
},
{
"Quad + HIL"
,
1003
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoFlyingWing
[]
=
{
{
"Z-84 Wing Wing (845 mm)"
,
3033
},
{
"TBS Caipirinha (850 mm)"
,
3100
},
{
"Bormatec Camflyer Q (800 mm)"
,
3030
},
{
"FX-61 Phantom FPV (1550 mm)"
,
3031
},
{
"FX-79 Buffalo (2000 mm)"
,
3034
},
{
"Skywalker X5 (1180 mm)"
,
3032
},
{
"Viper v2 (3000 mm)"
,
3035
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorX
[]
=
{
{
"DJI F330 8
\"
Quad"
,
4010
},
{
"DJI F450 10
\"
Quad"
,
4011
},
{
"X frame Quad UAVCAN"
,
4012
},
{
"AR.Drone Frame Quad"
,
4008
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorPlus
[]
=
{
{
"Generic 10
\"
Quad +"
,
5001
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoHexaRotorX
[]
=
{
{
"Standard 10
\"
Hexa X"
,
6001
},
{
"Coaxial 10
\"
Hexa X"
,
11001
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoHexaRotorPlus
[]
=
{
{
"Standard 10
\"
Hexa"
,
7001
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoOctoRotorX
[]
=
{
{
"Standard 10
\"
Octo"
,
8001
},
{
"Coaxial 10
\"
Octo"
,
12001
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoOctoRotorPlus
[]
=
{
{
"Standard 10
\"
Octo"
,
9001
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeInfo_t
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorH
[]
=
{
{
"3DR Iris"
,
10016
},
{
"TBS Discovery"
,
10015
},
{
"SteadiDrone QU4D"
,
10017
},
{
NULL
,
0
}
};
const
AirframeComponentAirframes
::
AirframeType_t
AirframeComponentAirframes
::
rgAirframeTypes
[]
=
{
{
"Standard Airplane"
,
"qrc:/qmlimages/AirframeStandardPlane.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoStandardPlane
},
{
"Flying Wing"
,
"qrc:/qmlimages/AirframeFlyingWing.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoFlyingWing
},
{
"QuadRotor X"
,
"qrc:/qmlimages/AirframeQuadRotorX.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorX
},
{
"QuadRotor +"
,
"qrc:/qmlimages/AirframeQuadRotorPlus.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorPlus
},
{
"HexaRotor X"
,
"qrc:/qmlimages/AirframeHexaRotorX.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoHexaRotorX
},
{
"HexaRotor +"
,
"qrc:/qmlimages/AirframeHexaRotorPlus.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoHexaRotorPlus
},
{
"OctoRotor X"
,
"qrc:/qmlimages/AirframeOctoRotorX.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoOctoRotorX
},
{
"OctoRotor +"
,
"qrc:/qmlimages/AirframeOctoRotorPlus.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoOctoRotorPlus
},
{
"QuadRotor H"
,
"qrc:/qmlimages/AirframeQuadRotorH.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoQuadRotorH
},
{
"Simulation"
,
"qrc:/qmlimages/AirframeSimulation.png"
,
AirframeComponentAirframes
::
_rgAirframeInfoSimulation
},
{
NULL
,
NULL
,
NULL
}
};
QMap
<
QString
,
AirframeComponentAirframes
::
AirframeType_t
>
AirframeComponentAirframes
::
rgAirframeTypes
;
AirframeComponentAirframes
::
AirframeComponentAirframes
()
{
// Standard planes
AirframeType_t
standardPlane
=
{
"Standard Airplane"
,
"qrc:/qmlimages/AirframeStandardPlane.png"
,
};
AirframeInfo_t
easystar
=
{
"Multiplex Easystar 1/2"
,
2100
};
standardPlane
.
rgAirframeInfo
.
append
(
easystar
);
rgAirframeTypes
.
insert
(
"StandardPlane"
,
standardPlane
);
// Flying wings
}
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoStandardPlane[] = {
// { "Multiplex Easystar 1/2", 2100 },
// { "Generic AERT", 2101 },
// { "3DR Skywalker", 2102 },
// { "Skyhunter (1800 mm)", 2103 },
// { "Generic AETR", 2104 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoSimulation[] = {
// { "Plane (HilStar, X-Plane)", 1000 },
// { "Plane (Rascal, FlightGear)", 1004 },
// { "Quad X HIL", 1001 },
// { "Quad + HIL", 1003 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoFlyingWing[] = {
// { "Z-84 Wing Wing (845 mm)", 3033 },
// { "TBS Caipirinha (850 mm)", 3100 },
// { "Bormatec Camflyer Q (800 mm)", 3030 },
// { "FX-61 Phantom FPV (1550 mm)", 3031 },
// { "FX-79 Buffalo (2000 mm)", 3034 },
// { "Skywalker X5 (1180 mm)", 3032 },
// { "Viper v2 (3000 mm)", 3035 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorX[] = {
// { "DJI F330 8\" Quad", 4010 },
// { "DJI F450 10\" Quad", 4011 },
// { "X frame Quad UAVCAN", 4012 },
// { "AR.Drone Frame Quad", 4008 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorPlus[] = {
// { "Generic 10\" Quad +", 5001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoHexaRotorX[] = {
// { "Standard 10\" Hexa X", 6001 },
// { "Coaxial 10\" Hexa X", 11001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoHexaRotorPlus[] = {
// { "Standard 10\" Hexa", 7001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoOctoRotorX[] = {
// { "Standard 10\" Octo", 8001 },
// { "Coaxial 10\" Octo", 12001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoOctoRotorPlus[] = {
// { "Standard 10\" Octo", 9001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorH[] = {
// { "3DR Iris", 10016 },
// { "TBS Discovery", 10015 },
// { "SteadiDrone QU4D", 10017 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeType_t AirframeComponentAirframes::rgAirframeTypes[] = {
// { "Standard Airplane", "qrc:/qmlimages/AirframeStandardPlane.png", AirframeComponentAirframes::_rgAirframeInfoStandardPlane },
// { "Flying Wing", "qrc:/qmlimages/AirframeFlyingWing.png", AirframeComponentAirframes::_rgAirframeInfoFlyingWing },
// { "QuadRotor X", "qrc:/qmlimages/AirframeQuadRotorX.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorX },
// { "QuadRotor +", "qrc:/qmlimages/AirframeQuadRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorPlus },
// { "HexaRotor X", "qrc:/qmlimages/AirframeHexaRotorX.png", AirframeComponentAirframes::_rgAirframeInfoHexaRotorX },
// { "HexaRotor +", "qrc:/qmlimages/AirframeHexaRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoHexaRotorPlus },
// { "OctoRotor X", "qrc:/qmlimages/AirframeOctoRotorX.png", AirframeComponentAirframes::_rgAirframeInfoOctoRotorX },
// { "OctoRotor +", "qrc:/qmlimages/AirframeOctoRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoOctoRotorPlus },
// { "QuadRotor H", "qrc:/qmlimages/AirframeQuadRotorH.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorH },
// { "Simulation", "qrc:/qmlimages/AirframeSimulation.png", AirframeComponentAirframes::_rgAirframeInfoSimulation },
// { NULL, NULL, NULL }
//};
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.h
View file @
acbacef3
...
...
@@ -30,6 +30,7 @@
#include <QObject>
#include <QQuickItem>
#include <QList>
#include <QMap>
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
...
...
@@ -38,6 +39,8 @@
class
AirframeComponentAirframes
{
public:
AirframeComponentAirframes
();
typedef
struct
{
const
char
*
name
;
int
autostartId
;
...
...
@@ -46,23 +49,13 @@ public:
typedef
struct
{
const
char
*
name
;
const
char
*
imageResource
;
const
AirframeInfo_t
*
rgAirframeInfo
;
QList
<
AirframeInfo_t
>
rgAirframeInfo
;
}
AirframeType_t
;
public:
static
const
AirframeType_t
rgAirframeTypes
[]
;
static
QMap
<
QString
,
AirframeType_t
>
rgAirframeTypes
;
private:
static
const
AirframeInfo_t
_rgAirframeInfoStandardPlane
[];
static
const
AirframeInfo_t
_rgAirframeInfoFlyingWing
[];
static
const
AirframeInfo_t
_rgAirframeInfoQuadRotorX
[];
static
const
AirframeInfo_t
_rgAirframeInfoQuadRotorPlus
[];
static
const
AirframeInfo_t
_rgAirframeInfoOctoRotorX
[];
static
const
AirframeInfo_t
_rgAirframeInfoOctoRotorPlus
[];
static
const
AirframeInfo_t
_rgAirframeInfoHexaRotorX
[];
static
const
AirframeInfo_t
_rgAirframeInfoHexaRotorPlus
[];
static
const
AirframeInfo_t
_rgAirframeInfoQuadRotorH
[];
static
const
AirframeInfo_t
_rgAirframeInfoSimulation
[];
};
#endif
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
acbacef3
...
...
@@ -25,6 +25,7 @@
#include "AutoPilotPluginManager.h"
#include "UASManager.h"
#include "PX4ParameterLoader.h"
#include "PX4AirframeLoader.h"
#include "FlightModesComponentController.h"
#include "AirframeComponentController.h"
#include "QGCMessageBox.h"
...
...
@@ -81,13 +82,18 @@ PX4AutoPilotPlugin::PX4AutoPilotPlugin(UASInterface* uas, QObject* parent) :
connect
(
_parameterFacts
,
&
PX4ParameterLoader
::
parametersReady
,
this
,
&
PX4AutoPilotPlugin
::
_pluginReadyPreChecks
);
connect
(
_parameterFacts
,
&
PX4ParameterLoader
::
parameterListProgress
,
this
,
&
PX4AutoPilotPlugin
::
parameterListProgress
);
_airframeFacts
=
new
PX4AirframeLoader
(
this
,
uas
,
this
);
Q_CHECK_PTR
(
_airframeFacts
);
PX4ParameterLoader
::
loadParameterFactMetaData
();
PX4AirframeLoader
::
loadAirframeFactMetaData
();
}
PX4AutoPilotPlugin
::~
PX4AutoPilotPlugin
()
{
delete
_parameterFacts
;
delete
_airframeFacts
;
}
QList
<
AutoPilotPluginManager
::
FullMode_t
>
PX4AutoPilotPlugin
::
getModes
(
void
)
...
...
@@ -259,6 +265,7 @@ QString PX4AutoPilotPlugin::getShortModeText(uint8_t baseMode, uint32_t customMo
void
PX4AutoPilotPlugin
::
clearStaticData
(
void
)
{
PX4ParameterLoader
::
clearStaticData
();
PX4AirframeLoader
::
clearStaticData
();
}
const
QVariantList
&
PX4AutoPilotPlugin
::
vehicleComponents
(
void
)
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
View file @
acbacef3
...
...
@@ -28,6 +28,7 @@
#include "AutoPilotPluginManager.h"
#include "UASInterface.h"
#include "PX4ParameterLoader.h"
#include "PX4AirframeLoader.h"
#include "AirframeComponent.h"
#include "RadioComponent.h"
#include "FlightModesComponent.h"
...
...
@@ -72,7 +73,8 @@ private:
// Overrides from AutoPilotPlugin
virtual
ParameterLoader
*
_getParameterLoader
(
void
)
{
return
_parameterFacts
;
}
PX4ParameterLoader
*
_parameterFacts
;
PX4ParameterLoader
*
_parameterFacts
;
PX4AirframeLoader
*
_airframeFacts
;
QVariantList
_components
;
AirframeComponent
*
_airframeComponent
;
RadioComponent
*
_radioComponent
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment