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
cffcb346
Commit
cffcb346
authored
Jun 07, 2012
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mavlink/qgroundcontrol
parents
9aab0f81
784e8144
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
40 deletions
+47
-40
qgroundcontrol.pro
qgroundcontrol.pro
+2
-2
UAS.cc
src/uas/UAS.cc
+2
-2
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+3
-3
Pixhawk3DWidget.cc
src/ui/map3D/Pixhawk3DWidget.cc
+5
-5
PixhawkCheetahNode.cc
src/ui/map3D/PixhawkCheetahNode.cc
+22
-15
PixhawkCheetahNode.h
src/ui/map3D/PixhawkCheetahNode.h
+13
-13
No files found.
qgroundcontrol.pro
View file @
cffcb346
...
...
@@ -347,7 +347,7 @@ contains(DEPENDENCIES_PRESENT, osg) {
src
/
ui
/
map3D
/
Q3DWidget
.
h
\
src
/
ui
/
map3D
/
GCManipulator
.
h
\
src
/
ui
/
map3D
/
ImageWindowGeode
.
h
\
src
/
ui
/
map3D
/
PixhawkCheetah
Ge
ode
.
h
\
src
/
ui
/
map3D
/
PixhawkCheetah
N
ode
.
h
\
src
/
ui
/
map3D
/
Pixhawk3DWidget
.
h
\
src
/
ui
/
map3D
/
Q3DWidgetFactory
.
h
\
src
/
ui
/
map3D
/
WebImageCache
.
h
\
...
...
@@ -492,7 +492,7 @@ contains(DEPENDENCIES_PRESENT, osg) {
src
/
ui
/
map3D
/
Q3DWidget
.
cc
\
src
/
ui
/
map3D
/
ImageWindowGeode
.
cc
\
src
/
ui
/
map3D
/
GCManipulator
.
cc
\
src
/
ui
/
map3D
/
PixhawkCheetah
Ge
ode
.
cc
\
src
/
ui
/
map3D
/
PixhawkCheetah
N
ode
.
cc
\
src
/
ui
/
map3D
/
Pixhawk3DWidget
.
cc
\
src
/
ui
/
map3D
/
Q3DWidgetFactory
.
cc
\
src
/
ui
/
map3D
/
WebImageCache
.
cc
\
...
...
src/uas/UAS.cc
View file @
cffcb346
...
...
@@ -249,9 +249,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
switch
(
message
.
compid
)
{
case
MAV_COMP_ID_IMU
:
case
MAV_COMP_ID_IMU
_2
:
// Prefer IMU 2 over IMU 1 (FIXME)
componentID
[
message
.
msgid
]
=
MAV_COMP_ID_IMU
;
componentID
[
message
.
msgid
]
=
MAV_COMP_ID_IMU
_2
;
break
;
default:
// Do nothing
...
...
src/uas/UASWaypointManager.cc
View file @
cffcb346
...
...
@@ -132,7 +132,7 @@ void UASWaypointManager::handleGlobalPositionChanged(UASInterface* mav, double l
void
UASWaypointManager
::
handleWaypointCount
(
quint8
systemId
,
quint8
compId
,
quint16
count
)
{
if
(
current_state
==
WP_GETLIST
&&
systemId
==
current_partner_systemid
&&
(
compId
==
current_partner_compid
||
compId
==
MAV_COMP_ID_ALL
)
)
{
if
(
current_state
==
WP_GETLIST
&&
systemId
==
current_partner_systemid
)
{
protocol_timer
.
start
(
PROTOCOL_TIMEOUT_MS
);
current_retries
=
PROTOCOL_MAX_RETRIES
;
...
...
@@ -172,7 +172,7 @@ void UASWaypointManager::handleWaypointCount(quint8 systemId, quint8 compId, qui
void
UASWaypointManager
::
handleWaypoint
(
quint8
systemId
,
quint8
compId
,
mavlink_mission_item_t
*
wp
)
{
if
(
systemId
==
current_partner_systemid
&&
(
compId
==
current_partner_compid
||
compId
==
MAV_COMP_ID_ALL
)
&&
current_state
==
WP_GETLIST_GETWPS
&&
wp
->
seq
==
current_wp_id
)
{
if
(
systemId
==
current_partner_systemid
&&
current_state
==
WP_GETLIST_GETWPS
&&
wp
->
seq
==
current_wp_id
)
{
protocol_timer
.
start
(
PROTOCOL_TIMEOUT_MS
);
current_retries
=
PROTOCOL_MAX_RETRIES
;
...
...
@@ -241,7 +241,7 @@ void UASWaypointManager::handleWaypointAck(quint8 systemId, quint8 compId, mavli
void
UASWaypointManager
::
handleWaypointRequest
(
quint8
systemId
,
quint8
compId
,
mavlink_mission_request_t
*
wpr
)
{
if
(
systemId
==
current_partner_systemid
&&
(
compId
==
current_partner_compid
||
compId
==
MAV_COMP_ID_ALL
)
&&
(
(
current_state
==
WP_SENDLIST
&&
wpr
->
seq
==
0
)
||
(
current_state
==
WP_SENDLIST_SENDWPS
&&
(
wpr
->
seq
==
current_wp_id
||
wpr
->
seq
==
current_wp_id
+
1
))))
{
if
(
systemId
==
current_partner_systemid
&&
((
current_state
==
WP_SENDLIST
&&
wpr
->
seq
==
0
)
||
(
current_state
==
WP_SENDLIST_SENDWPS
&&
(
wpr
->
seq
==
current_wp_id
||
wpr
->
seq
==
current_wp_id
+
1
))))
{
protocol_timer
.
start
(
PROTOCOL_TIMEOUT_MS
);
current_retries
=
PROTOCOL_MAX_RETRIES
;
...
...
src/ui/map3D/Pixhawk3DWidget.cc
View file @
cffcb346
...
...
@@ -41,7 +41,7 @@
#include <osgText/Text>
#include "../MainWindow.h"
#include "PixhawkCheetah
Ge
ode.h"
#include "PixhawkCheetah
N
ode.h"
#include "TerrainParamDialog.h"
#include "UASManager.h"
...
...
@@ -150,7 +150,7 @@ Pixhawk3DWidget::systemCreated(UASInterface *uas)
this
,
SLOT
(
addOverlay
(
UASInterface
*
)));
#endif
// mSystemContainerMap[systemId].gpsLocalOrigin() = QVector3D(47.
419182, 8.566980
, 428);
// mSystemContainerMap[systemId].gpsLocalOrigin() = QVector3D(47.
397786, 8.544476
, 428);
initializeSystem
(
systemId
,
uas
->
getColor
());
emit
systemCreatedSignal
(
uas
);
...
...
@@ -1304,7 +1304,7 @@ Pixhawk3DWidget::addModels(QVector< osg::ref_ptr<osg::Node> >& models,
QStringList
files
=
directory
.
entryList
(
QStringList
(
"*.osg"
),
QDir
::
Files
);
// add Pixhawk Bravo model
models
.
push_back
(
PixhawkCheetah
Ge
ode
::
create
(
systemColor
));
models
.
push_back
(
PixhawkCheetah
N
ode
::
create
(
systemColor
));
// add sphere of 0.05m radius
osg
::
ref_ptr
<
osg
::
Sphere
>
sphere
=
new
osg
::
Sphere
(
osg
::
Vec3f
(
0.0
f
,
0.0
f
,
0.0
f
),
0.05
f
);
...
...
@@ -2301,8 +2301,8 @@ Pixhawk3DWidget::updateImagery(double originX, double originY,
minResolution
=
0.5
;
break
;
case
Imagery
:
:
OFFLINE_SATELLITE
:
minResolution
=
0.
2
5
;
maxResolution
=
0.
2
5
;
minResolution
=
0.5
;
maxResolution
=
0.5
;
break
;
default:
{}
...
...
src/ui/map3D/PixhawkCheetah
Ge
ode.cc
→
src/ui/map3D/PixhawkCheetah
N
ode.cc
View file @
cffcb346
...
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
* @file
* @brief Generates a OpenSceneGraph
ge
ode which renders a
* @brief Generates a OpenSceneGraph
n
ode which renders a
* Pixhawk Cheetah MAV.
*
* @author Lionel Heng <hengli@student.ethz.ch>
...
...
@@ -31,7 +31,9 @@ This file is part of the QGROUNDCONTROL project
*/
#include <osg/Geometry>
#include "PixhawkCheetahGeode.h"
#include <osg/PositionAttitudeTransform>
#include "PixhawkCheetahNode.h"
struct sample_MATERIAL {
GLfloat ambient[3];
...
...
@@ -59335,15 +59337,15 @@ void SelectMaterial(int i)
};
osg::ref_ptr<osg::
Geode> PixhawkCheetahGe
ode::mInstance;
osg::ref_ptr<osg::
Node> PixhawkCheetahN
ode::mInstance;
PixhawkCheetah
Geode::PixhawkCheetahGe
ode()
PixhawkCheetah
Node::PixhawkCheetahN
ode()
{
}
osg::ref_ptr<osg::
Ge
ode>
PixhawkCheetah
Ge
ode::instance(void)
osg::ref_ptr<osg::
N
ode>
PixhawkCheetah
N
ode::instance(void)
{
if (!mInstance.valid())
{
...
...
@@ -59354,13 +59356,18 @@ PixhawkCheetahGeode::instance(void)
return mInstance;
}
osg::ref_ptr<osg::
Ge
ode>
PixhawkCheetah
Ge
ode::create(const QColor& color)
osg::ref_ptr<osg::
N
ode>
PixhawkCheetah
N
ode::create(const QColor& color)
{
osg::ref_ptr<osg::PositionAttitudeTransform> pat(new osg::PositionAttitudeTransform);
pat->setScale(osg::Vec3(0.5f, 0.5f, 0.5f));
osg::ref_ptr<osg::Geode> geode(new osg::Geode());
geode->setName("Pixhawk Bravo");
osg::ref_ptr<osg::Geometry> geometry(new osg::Geometry());
geode->addDrawable(geometry.get());
geode->addDrawable(geometry);
pat->addChild(geode);
osg::ref_ptr<osg::Vec3Array> osgVertices(new osg::Vec3Array);
osg::ref_ptr<osg::Vec3Array> osgNormals(new osg::Vec3Array);
...
...
@@ -59392,18 +59399,18 @@ PixhawkCheetahGeode::create(const QColor& color)
face->push_back(i * 3 + j);
}
geometry->addPrimitiveSet(face
.get()
);
geometry->addPrimitiveSet(face);
}
geometry->setVertexArray(osgVertices
.get()
);
geometry->setNormalArray(osgNormals
.get()
);
geometry->setTexCoordArray(0, osgTextures
.get()
);
geometry->setVertexArray(osgVertices);
geometry->setNormalArray(osgNormals);
geometry->setTexCoordArray(0, osgTextures);
osg::ref_ptr<osg::Vec4Array> colors(new osg::Vec4Array);
colors->push_back(osg::Vec4(color.redF(), color.greenF(), color.blueF(), 1.0f));
geometry->setColorArray(colors
.get()
);
geometry->setColorArray(colors);
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
return
geode
;
return
pat
;
};
src/ui/map3D/PixhawkCheetah
Ge
ode.h
→
src/ui/map3D/PixhawkCheetah
N
ode.h
View file @
cffcb346
...
...
@@ -23,48 +23,48 @@ This file is part of the QGROUNDCONTROL project
/**
* @file
* @brief Definition of the class PixhawkCheetah
Ge
ode.
* @brief Definition of the class PixhawkCheetah
N
ode.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef PIXHAWKCHEETAH
GE
ODE_H_
#define PIXHAWKCHEETAH
GE
ODE_H_
#ifndef PIXHAWKCHEETAH
N
ODE_H_
#define PIXHAWKCHEETAH
N
ODE_H_
#include <osg/Geode>
#include <QColor>
/**
* @brief The PixhawkCheetah
Ge
ode class.
* Generates an OpenSceneGraph
ge
ode which renders a Pixhawk Cheetah MAV.
* @brief The PixhawkCheetah
N
ode class.
* Generates an OpenSceneGraph
n
ode which renders a Pixhawk Cheetah MAV.
**/
class
PixhawkCheetah
Ge
ode
class
PixhawkCheetah
N
ode
{
public:
/**
* Constructor.
*/
PixhawkCheetah
Ge
ode
();
PixhawkCheetah
N
ode
();
/**
* Get a single instance of the
ge
ode.
* Get a single instance of the
n
ode.
*/
static
osg
::
ref_ptr
<
osg
::
Ge
ode
>
instance
(
void
);
static
osg
::
ref_ptr
<
osg
::
N
ode
>
instance
(
void
);
/**
* @brief Creates an OpenSceneGraph
ge
ode which renders a Pixhawk Cheetah MAV.
* @brief Creates an OpenSceneGraph
n
ode which renders a Pixhawk Cheetah MAV.
* @param red Red intensity of the MAV model.
* @param green Green intensity of the MAV model.
* @param blue Blue intensity of the MAV model.
*
* @return A smart pointer to the
ge
ode.
* @return A smart pointer to the
n
ode.
**/
static
osg
::
ref_ptr
<
osg
::
Ge
ode
>
create
(
const
QColor
&
color
);
static
osg
::
ref_ptr
<
osg
::
N
ode
>
create
(
const
QColor
&
color
);
private:
static
osg
::
ref_ptr
<
osg
::
Ge
ode
>
mInstance
;
static
osg
::
ref_ptr
<
osg
::
N
ode
>
mInstance
;
};
#endif
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