Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Baitboat
Commits
c3d6ed1e
Commit
c3d6ed1e
authored
11 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Replay: add constraint on EKF4 data packet values
parent
d8574274
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tools/Replay/Replay.pde
+12
-9
12 additions, 9 deletions
Tools/Replay/Replay.pde
with
12 additions
and
9 deletions
Tools/Replay/Replay.pde
+
12
−
9
View file @
c3d6ed1e
...
...
@@ -49,6 +49,9 @@
#include
<errno.h>
#include
<fenv.h>
#define INT16_MIN -32768
#define INT16_MAX 32767
#include
"LogReader.h"
const
AP_HAL
::
HAL
&
hal
=
AP_HAL_BOARD_DRIVER
;
...
...
@@ -509,15 +512,15 @@ void loop()
innovVT
);
// define messages for EKF4 data packet
int16_t
sqrtvarV
=
(
int16_t
)(
100
*
velVar
);
int16_t
sqrtvarP
=
(
int16_t
)(
100
*
posVar
);
int16_t
sqrtvarH
=
(
int16_t
)(
100
*
hgtVar
);
int16_t
sqrtvarMX
=
(
int16_t
)(
100
*
magVar
.
x
);
int16_t
sqrtvarMY
=
(
int16_t
)(
100
*
magVar
.
y
);
int16_t
sqrtvarMZ
=
(
int16_t
)(
100
*
magVar
.
z
);
int16_t
sqrtvarVT
=
(
int16_t
)(
100
*
tasVar
);
int16_t
offsetNorth
=
(
int8_t
)(
offset
.
x
);
int16_t
offsetEast
=
(
int8_t
)(
offset
.
y
);
int16_t
sqrtvarV
=
(
int16_t
)(
constrain_float
(
100
*
velVar
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarP
=
(
int16_t
)(
constrain_float
(
100
*
posVar
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarH
=
(
int16_t
)(
constrain_float
(
100
*
hgtVar
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarMX
=
(
int16_t
)(
constrain_float
(
100
*
magVar
.
x
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarMY
=
(
int16_t
)(
constrain_float
(
100
*
magVar
.
y
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarMZ
=
(
int16_t
)(
constrain_float
(
100
*
magVar
.
z
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
sqrtvarVT
=
(
int16_t
)(
constrain_float
(
100
*
tasVar
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
offsetNorth
=
(
int8_t
)(
constrain_float
(
offset
.
x
,
INT16_MIN
,
INT16_MAX
)
);
int16_t
offsetEast
=
(
int8_t
)(
constrain_float
(
offset
.
y
,
INT16_MIN
,
INT16_MAX
)
);
// print EKF4 data packet
fprintf
(
ekf4f
,
"%.3f %d %d %d %d %d %d %d %d %d %d
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment