Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
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
Ardupilot
Commits
f4490b62
Commit
f4490b62
authored
13 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
DCM: prevent a segmentation fault when compass is not enabled
when compass is disabled _compass is NULL
parent
62221735
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_DCM/AP_DCM.cpp
+8
-3
8 additions, 3 deletions
libraries/AP_DCM/AP_DCM.cpp
with
8 additions
and
3 deletions
libraries/AP_DCM/AP_DCM.cpp
+
8
−
3
View file @
f4490b62
...
...
@@ -195,7 +195,9 @@ AP_DCM::accel_adjust(void)
void
AP_DCM
::
matrix_reset
(
void
)
{
_compass
->
null_offsets_disable
();
if
(
_compass
!=
NULL
)
{
_compass
->
null_offsets_disable
();
}
_dcm_matrix
.
a
.
x
=
1.0
f
;
_dcm_matrix
.
a
.
y
=
0.0
f
;
_dcm_matrix
.
a
.
z
=
0.0
f
;
...
...
@@ -208,8 +210,11 @@ AP_DCM::matrix_reset(void)
_omega_I
.
x
=
0.0
f
;
_omega_I
.
y
=
0.0
f
;
_omega_I
.
z
=
0.0
f
;
_compass
->
null_offsets_enable
();
// This call is needed to restart the nulling
// Otherwise the reset in the DCM matrix can mess up the nulling
if
(
_compass
!=
NULL
)
{
_compass
->
null_offsets_enable
();
// This call is needed to restart the nulling
// Otherwise the reset in the DCM matrix can mess up
// the nulling
}
}
/*************************************************
...
...
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