Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
c39ac93c
Commit
c39ac93c
authored
6 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
device integrator cleanup initialization
parent
33a71c92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/drivers/device/integrator.cpp
+1
-9
1 addition, 9 deletions
src/lib/drivers/device/integrator.cpp
src/lib/drivers/device/integrator.h
+20
-18
20 additions, 18 deletions
src/lib/drivers/device/integrator.h
with
21 additions
and
27 deletions
src/lib/drivers/device/integrator.cpp
+
1
−
9
View file @
c39ac93c
...
...
@@ -41,23 +41,15 @@
*/
#include
"integrator.h"
#include
<drivers/drv_hrt.h>
Integrator
::
Integrator
(
uint64_t
auto_reset_interval
,
bool
coning_compensation
)
:
_auto_reset_interval
(
auto_reset_interval
),
_last_integration_time
(
0
),
_last_reset_time
(
0
),
_alpha
(
0.0
f
,
0.0
f
,
0.0
f
),
_last_alpha
(
0.0
f
,
0.0
f
,
0.0
f
),
_beta
(
0.0
f
,
0.0
f
,
0.0
f
),
_last_val
(
0.0
f
,
0.0
f
,
0.0
f
),
_last_delta_alpha
(
0.0
f
,
0.0
f
,
0.0
f
),
_coning_comp_on
(
coning_compensation
)
{
}
Integrator
::~
Integrator
()
=
default
;
bool
Integrator
::
put
(
uint64_t
timestamp
,
matrix
::
Vector3f
&
val
,
matrix
::
Vector3f
&
integral
,
uint64_t
&
integral_dt
)
{
...
...
This diff is collapsed.
Click to expand it.
src/lib/drivers/device/integrator.h
+
20
−
18
View file @
c39ac93c
...
...
@@ -49,7 +49,13 @@ class Integrator
{
public:
Integrator
(
uint64_t
auto_reset_interval
=
4000
/* 250 Hz */
,
bool
coning_compensation
=
false
);
virtual
~
Integrator
();
~
Integrator
()
=
default
;
// no copy, assignment, move, move assignment
Integrator
(
const
Integrator
&
)
=
delete
;
Integrator
&
operator
=
(
const
Integrator
&
)
=
delete
;
Integrator
(
Integrator
&&
)
=
delete
;
Integrator
&
operator
=
(
Integrator
&&
)
=
delete
;
/**
* Put an item into the integral.
...
...
@@ -105,26 +111,22 @@ public:
*
* @param auto_reset_interval New reset time interval for the integrator.
*/
void
set_autoreset_interval
(
uint64_t
auto_reset_interval
)
{
_auto_reset_interval
=
auto_reset_interval
;
}
void
set_autoreset_interval
(
uint64_t
auto_reset_interval
)
{
_auto_reset_interval
=
auto_reset_interval
;
}
private
:
uint64_t
_auto_reset_interval
;
/**< the interval after which the content will be published
uint64_t
_auto_reset_interval
{
0
}
;
/**< the interval after which the content will be published
and the integrator reset, 0 if no auto-reset */
uint64_t
_last_integration_time
;
/**< timestamp of the last integration step */
uint64_t
_last_reset_time
;
/**< last auto-announcement of integral value */
matrix
::
Vector3f
_alpha
;
/**< integrated value before coning corrections are applied */
matrix
::
Vector3f
_last_alpha
;
/**< previous value of _alpha */
matrix
::
Vector3f
_beta
;
/**< accumulated coning corrections */
matrix
::
Vector3f
_last_val
;
/**< previous input */
matrix
::
Vector3f
_last_delta_alpha
;
/**< integral from previous previous sampling interval */
bool
_coning_comp_on
;
/**< true to turn on coning corrections */
/* we don't want this class to be copied */
Integrator
(
const
Integrator
&
);
Integrator
operator
=
(
const
Integrator
&
);
uint64_t
_last_integration_time
{
0
};
/**< timestamp of the last integration step */
uint64_t
_last_reset_time
{
0
};
/**< last auto-announcement of integral value */
matrix
::
Vector3f
_alpha
{
0.0
f
,
0.0
f
,
0.0
f
};
/**< integrated value before coning corrections are applied */
matrix
::
Vector3f
_last_alpha
{
0.0
f
,
0.0
f
,
0.0
f
};
/**< previous value of _alpha */
matrix
::
Vector3f
_beta
{
0.0
f
,
0.0
f
,
0.0
f
};
/**< accumulated coning corrections */
matrix
::
Vector3f
_last_val
{
0.0
f
,
0.0
f
,
0.0
f
};
/**< previous input */
matrix
::
Vector3f
_last_delta_alpha
{
0.0
f
,
0.0
f
,
0.0
f
};
/**< integral from previous previous sampling interval */
bool
_coning_comp_on
{
false
};
/**< true to turn on coning corrections */
/* Do a reset.
*
...
...
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