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
e485007a
Commit
e485007a
authored
Sep 02, 2015
by
Eddy Scott
Committed by
Lorenz Meier
Oct 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem with defining std as variance^2 instead of variance^(1/2)
parent
93928a62
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
112 deletions
+128
-112
UAS.cc
src/uas/UAS.cc
+25
-9
gaussian_noise.cpp
tools/RandomNumberVerification/gaussian_noise.cpp
+2
-2
generate_noise_csv
tools/RandomNumberVerification/generate_noise_csv
+0
-0
generated_noise.csv
tools/RandomNumberVerification/generated_noise.csv
+100
-100
verify_noise_characteristics.m
...s/RandomNumberVerification/verify_noise_characteristics.m
+1
-1
No files found.
src/uas/UAS.cc
View file @
e485007a
...
...
@@ -135,19 +135,35 @@ UAS::UAS(MAVLinkProtocol* protocol, Vehicle* vehicle) : UASInterface(),
// Initialize HIL sensor noise variances to 0. If user wants corrupted sensor values they will need to set them
// Note variances calculated from flight case from this log: http://dash.oznet.ch/view/MRjW8NUNYQSuSZkbn8dEjY
// TODO: calibrate stand-still pixhawk variances
xacc_var
(
1.2914
f
),
/*
xacc_var(0.6457f),
yacc_var(0.7048f),
zacc_var
(
1.9577
f
),
zacc_var(
0.97885
f),
rollspeed_var(0.8126f),
pitchspeed_var(0.6145f),
yawspeed_var(0.5852f),
xmag_var
(
0.4786
f
),
ymag_var
(
0.4566
f
),
zmag_var
(
0.3333
f
),
abs_pressure_var
(
1.1604
f
),
diff_pressure_var
(
1.1604
f
),
pressure_alt_var
(
1.1604
f
),
temperature_var
(
1.4290
f
),
xmag_var(0.2393f),
ymag_var(0.2283f),
zmag_var(0.1665f),
abs_pressure_var(0.5802f),
diff_pressure_var(0.5802f),
pressure_alt_var(0.5802f),
temperature_var(0.7145f),
*/
xacc_var
(
0.0
f
),
yacc_var
(
0.0
f
),
zacc_var
(
0.0
f
),
rollspeed_var
(
0.0
f
),
pitchspeed_var
(
0.0
f
),
yawspeed_var
(
0.0
f
),
xmag_var
(
0.0
f
),
ymag_var
(
0.0
f
),
zmag_var
(
0.0
f
),
abs_pressure_var
(
0.0
f
),
diff_pressure_var
(
0.0
f
),
pressure_alt_var
(
0.0
f
),
temperature_var
(
0.0
f
),
#ifndef __mobile__
simulation
(
0
),
...
...
tools/RandomNumberVerification/gaussian_noise.cpp
View file @
e485007a
...
...
@@ -58,8 +58,8 @@ float generateGaussianNoise(float mu, float variance)
while
(
u1
<=
epsilon
);
//Have a catch to ensure non-zero for log()
z0
=
sqrt
(
-
2.0
*
log
(
u1
))
*
cos
(
two_pi
*
u2
);
//calculate normally distributed variable with mu = 0, var = 1
float
noise
=
z0
*
(
variance
*
variance
)
+
mu
;
//calculate normally distributed variable with mu = mu, std = var^2
return
noise
float
noise
=
z0
*
sqrt
(
variance
)
+
mu
;
//calculate normally distributed variable with mu = mu, std = var^2
return
noise
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
tools/RandomNumberVerification/generate_noise_csv
View file @
e485007a
No preview for this file type
tools/RandomNumberVerification/generated_noise.csv
View file @
e485007a
This diff is collapsed.
Click to expand it.
tools/RandomNumberVerification/verify_noise_characteristics.m
View file @
e485007a
...
...
@@ -39,7 +39,7 @@ clc
system
(
'g++ gaussian_noise.cpp -o generate_noise_csv'
);
mu_des
=
0.0
;
std_des
=
0.02
;
var_des
=
0.2
;
%sqrt(std_des)
;
var_des
=
std_des
^
2
;
num_samples
=
10000
;
num_runs
=
100
;
if
exist
(
'generated_noise.csv'
,
'file'
)
...
...
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