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
a193cbb8
Commit
a193cbb8
authored
12 years ago
by
rmackay9
Browse files
Options
Downloads
Patches
Plain Diff
AP_InertialNav: Jason's bug fix to inertial nav velocity and position calculations
parent
ee50e637
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
libraries/AP_InertialNav/AP_InertialNav.cpp
+7
-3
7 additions, 3 deletions
libraries/AP_InertialNav/AP_InertialNav.cpp
with
7 additions
and
3 deletions
libraries/AP_InertialNav/AP_InertialNav.cpp
+
7
−
3
View file @
a193cbb8
...
@@ -55,6 +55,7 @@ void AP_InertialNav::update(float dt)
...
@@ -55,6 +55,7 @@ void AP_InertialNav::update(float dt)
{
{
Vector3f
acc_corr
=
accel_correction
.
get
();
Vector3f
acc_corr
=
accel_correction
.
get
();
Vector3f
accel_ef
;
Vector3f
accel_ef
;
Vector3f
velocity_increase
;
// discard samples where dt is too large
// discard samples where dt is too large
if
(
dt
>
0.1
)
{
if
(
dt
>
0.1
)
{
...
@@ -84,11 +85,14 @@ void AP_InertialNav::update(float dt)
...
@@ -84,11 +85,14 @@ void AP_InertialNav::update(float dt)
// get earth frame accelerometer correction
// get earth frame accelerometer correction
accel_correction_ef
=
dcm
*
acc_corr
;
accel_correction_ef
=
dcm
*
acc_corr
;
// calculate velocity
by
adding new acceleration from accelerometers
// calculate velocity
increase
adding new acceleration from accelerometers
_
velocity
+
=
(
-
accel_ef
+
accel_correction_ef
)
*
dt
;
velocity
_increase
=
(
-
accel_ef
+
accel_correction_ef
)
*
dt
;
// calculate new estimate of position
// calculate new estimate of position
_position_base
+=
_velocity
*
dt
;
_position_base
+=
(
_velocity
+
velocity_increase
*
0.5
)
*
dt
;
// calculate new velocity
_velocity
+=
velocity_increase
;
// store 3rd order estimate (i.e. estimated vertical position) for future use
// store 3rd order estimate (i.e. estimated vertical position) for future use
_hist_position_estimate_z
.
add
(
_position_base
.
z
);
_hist_position_estimate_z
.
add
(
_position_base
.
z
);
...
...
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