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
7f9de5e1
Commit
7f9de5e1
authored
Sep 09, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up coordinate frame of HSI
parent
9a2bd0d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
HSIDisplay.cc
src/ui/HSIDisplay.cc
+6
-7
No files found.
src/ui/HSIDisplay.cc
View file @
7f9de5e1
...
...
@@ -58,8 +58,8 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
posXSet
(
0.0
f
),
posYSet
(
0.0
f
),
posZSet
(
0.0
f
),
attXSaturation
(
0.
5
f
),
attYSaturation
(
0.
5
f
),
attXSaturation
(
0.
2
f
),
attYSaturation
(
0.
2
f
),
attYawSaturation
(
0.5
f
),
posXSaturation
(
0.05
f
),
posYSaturation
(
0.05
f
),
...
...
@@ -474,7 +474,7 @@ QPointF HSIDisplay::metricWorldToBody(QPointF world)
{
// First translate to body-centered coordinates
// Rotate around -yaw
float
angle
=
yaw
+
M_PI
;
float
angle
=
-
yaw
-
M_PI
;
QPointF
result
(
cos
(
angle
)
*
(
x
-
world
.
x
())
-
sin
(
angle
)
*
(
y
-
world
.
y
()),
sin
(
angle
)
*
(
x
-
world
.
x
())
+
cos
(
angle
)
*
(
y
-
world
.
y
()));
return
result
;
}
...
...
@@ -944,7 +944,7 @@ void HSIDisplay::drawPositionDirection(float xRef, float yRef, float radius, con
{
if
(
xyControlKnown
&&
xyControlEnabled
)
{
// Draw the needle
const
float
maxWidth
=
radius
/
10
.0
f
;
const
float
maxWidth
=
radius
/
5
.0
f
;
const
float
minWidth
=
maxWidth
*
0.3
f
;
float
angle
=
atan2
(
posXSet
,
-
posYSet
);
...
...
@@ -984,10 +984,9 @@ void HSIDisplay::drawAttitudeDirection(float xRef, float yRef, float radius, con
const
float
maxWidth
=
radius
/
10.0
f
;
const
float
minWidth
=
maxWidth
*
0.3
f
;
float
angle
=
atan2
(
attXSet
,
attYSet
);
angle
-=
(
float
)
M_PI
/
2.0
f
;
float
angle
=
atan2
(
attYSet
,
-
attXSet
);
radius
*=
sqrt
(
pow
(
attXSet
,
2
)
+
pow
(
attYSet
,
2
))
/
sqrt
(
attXSaturation
+
attYSaturation
);
radius
*=
sqrt
(
attXSet
*
attXSet
+
attYSet
*
attYSet
)
/
sqrt
(
attXSaturation
*
attXSaturation
+
attYSaturation
*
attYSaturation
);
QPolygonF
p
(
6
);
...
...
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