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
61f66c9d
Commit
61f66c9d
authored
May 31, 2012
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed scaling factor of Pixhawk Cheetah model.
parent
8507c30b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
34 deletions
+41
-34
qgroundcontrol.pro
qgroundcontrol.pro
+2
-2
UAS.cc
src/uas/UAS.cc
+2
-2
Pixhawk3DWidget.cc
src/ui/map3D/Pixhawk3DWidget.cc
+2
-2
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 @
61f66c9d
...
...
@@ -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 @
61f66c9d
...
...
@@ -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/ui/map3D/Pixhawk3DWidget.cc
View file @
61f66c9d
...
...
@@ -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"
...
...
@@ -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
);
...
...
src/ui/map3D/PixhawkCheetah
Ge
ode.cc
→
src/ui/map3D/PixhawkCheetah
N
ode.cc
View file @
61f66c9d
...
...
@@ -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 @
61f66c9d
...
...
@@ -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