Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
mobile_robotics
wolf_projects
wolf_lib
plugins
imu
Commits
55e2a639
Commit
55e2a639
authored
2 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Rename list_fac_inactive_bootstrap_ --> bootstrap_factor_list_
parent
2e8c29ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!54
devel->main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/imu/processor/processor_imu.h
+1
-1
1 addition, 1 deletion
include/imu/processor/processor_imu.h
src/processor/processor_imu.cpp
+24
-24
24 additions, 24 deletions
src/processor/processor_imu.cpp
with
25 additions
and
25 deletions
include/imu/processor/processor_imu.h
+
1
−
1
View file @
55e2a639
...
@@ -149,7 +149,7 @@ class ProcessorImu : public ProcessorMotion{
...
@@ -149,7 +149,7 @@ class ProcessorImu : public ProcessorMotion{
protected
:
protected
:
ParamsProcessorImuPtr
params_motion_Imu_
;
ParamsProcessorImuPtr
params_motion_Imu_
;
std
::
list
<
FactorBasePtr
>
list_fac_inactive_bootstrap
_
;
///< List of all IMU factors created while IMU is bootstrapping
std
::
list
<
FactorBasePtr
>
bootstrap_factor_list
_
;
///< List of all IMU factors created while IMU is bootstrapping
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
src/processor/processor_imu.cpp
+
24
−
24
View file @
55e2a639
...
@@ -34,7 +34,7 @@ ProcessorImu::ProcessorImu(ParamsProcessorImuPtr _params_motion_imu) :
...
@@ -34,7 +34,7 @@ ProcessorImu::ProcessorImu(ParamsProcessorImuPtr _params_motion_imu) :
params_motion_Imu_
(
_params_motion_imu
)
params_motion_Imu_
(
_params_motion_imu
)
{
{
bootstrapping_
=
params_motion_Imu_
->
bootstrap_enable
;
bootstrapping_
=
params_motion_Imu_
->
bootstrap_enable
;
list_fac_inactive_bootstrap
_
.
clear
();
bootstrap_factor_list
_
.
clear
();
}
}
ProcessorImu
::~
ProcessorImu
()
ProcessorImu
::~
ProcessorImu
()
...
@@ -126,7 +126,7 @@ FactorBasePtr ProcessorImu::emplaceFactor(FeatureBasePtr _feature_motion, Captur
...
@@ -126,7 +126,7 @@ FactorBasePtr ProcessorImu::emplaceFactor(FeatureBasePtr _feature_motion, Captur
if
(
bootstrapping_
)
if
(
bootstrapping_
)
{
{
fac_imu
->
setStatus
(
FAC_INACTIVE
);
fac_imu
->
setStatus
(
FAC_INACTIVE
);
list_fac_inactive_bootstrap
_
.
push_back
(
fac_imu
);
bootstrap_factor_list
_
.
push_back
(
fac_imu
);
}
}
return
fac_imu
;
return
fac_imu
;
...
@@ -276,12 +276,12 @@ void ProcessorImu::bootstrap()
...
@@ -276,12 +276,12 @@ void ProcessorImu::bootstrap()
VectorXd
delta_int
=
bootstrapDelta
();
VectorXd
delta_int
=
bootstrapDelta
();
// compute local g and transformation to global g
// compute local g and transformation to global g
double
dt
=
t_current
-
first_capture
->
getTimeStamp
();
//
double
dt
=
t_current
-
first_capture
->
getTimeStamp
();
//
const
auto
&
dv
=
delta_int
.
segment
(
7
,
3
);
//
const
auto
&
dv
=
delta_int
.
segment
(
7
,
3
);
//
Vector3d
g_l
=
-
(
q_l_s
*
dv
/
dt
);
// See eq. (20)
Vector3d
g_l
=
-
(
q_l_s
*
dv
/
dt
);
// See eq. (20)
const
auto
&
g_w
=
gravity
();
//
const
auto
&
g_w
=
gravity
();
//
const
auto
&
p_w_l
=
Vector3d
::
Zero
();
// will pivot around the origin
const
auto
&
p_w_l
=
Vector3d
::
Zero
();
// will pivot around the origin
Quaterniond
q_w_l
=
Quaterniond
::
FromTwoVectors
(
g_l
,
g_w
);
//
Quaterniond
q_w_l
=
Quaterniond
::
FromTwoVectors
(
g_l
,
g_w
);
//
transfo_w_l
.
at
(
'P'
)
=
p_w_l
;
//
transfo_w_l
.
at
(
'P'
)
=
p_w_l
;
//
transfo_w_l
.
at
(
'O'
)
=
q_w_l
.
coeffs
();
//
transfo_w_l
.
at
(
'O'
)
=
q_w_l
.
coeffs
();
//
...
@@ -300,10 +300,10 @@ void ProcessorImu::bootstrap()
...
@@ -300,10 +300,10 @@ void ProcessorImu::bootstrap()
// - zero-displaecement odom3d factors (between KFs)
// - zero-displaecement odom3d factors (between KFs)
// Activate factors that were inactive during bootstrap
// Activate factors that were inactive during bootstrap
while
(
not
list_fac_inactive_bootstrap
_
.
empty
())
while
(
not
bootstrap_factor_list
_
.
empty
())
{
{
list_fac_inactive_bootstrap
_
.
front
()
->
setStatus
(
FAC_ACTIVE
);
bootstrap_factor_list
_
.
front
()
->
setStatus
(
FAC_ACTIVE
);
list_fac_inactive_bootstrap
_
.
pop_front
();
bootstrap_factor_list
_
.
pop_front
();
}
}
// Clear bootstrapping flag. This marks the end of the bootstrapping process
// Clear bootstrapping flag. This marks the end of the bootstrapping process
...
@@ -325,12 +325,12 @@ void ProcessorImu::bootstrap()
...
@@ -325,12 +325,12 @@ void ProcessorImu::bootstrap()
VectorXd
delta_int
=
bootstrapDelta
();
VectorXd
delta_int
=
bootstrapDelta
();
// compute local g and transformation to global g
// compute local g and transformation to global g
double
dt
=
t_current
-
first_capture
->
getTimeStamp
();
//
double
dt
=
t_current
-
first_capture
->
getTimeStamp
();
//
const
auto
&
dv_l
=
delta_int
.
segment
(
7
,
3
);
//
const
auto
&
dv_l
=
delta_int
.
segment
(
7
,
3
);
//
Vector3d
g_l
=
-
(
q_l_s
*
dv_l
/
dt
);
// See eq. (20)
Vector3d
g_l
=
-
(
q_l_s
*
dv_l
/
dt
);
// See eq. (20)
const
auto
&
g_w
=
gravity
();
//
const
auto
&
g_w
=
gravity
();
//
const
auto
&
p_w_l
=
Vector3d
::
Zero
();
// will pivot around the origin
const
auto
&
p_w_l
=
Vector3d
::
Zero
();
// will pivot around the origin
Quaterniond
q_w_l
=
Quaterniond
::
FromTwoVectors
(
g_l
,
g_w
);
//
Quaterniond
q_w_l
=
Quaterniond
::
FromTwoVectors
(
g_l
,
g_w
);
//
transfo_w_l
.
at
(
'P'
)
=
p_w_l
;
//
transfo_w_l
.
at
(
'P'
)
=
p_w_l
;
//
transfo_w_l
.
at
(
'O'
)
=
q_w_l
.
coeffs
();
//
transfo_w_l
.
at
(
'O'
)
=
q_w_l
.
coeffs
();
//
...
@@ -345,10 +345,10 @@ void ProcessorImu::bootstrap()
...
@@ -345,10 +345,10 @@ void ProcessorImu::bootstrap()
}
}
// Activate factors that were inactive during bootstrap
// Activate factors that were inactive during bootstrap
while
(
not
list_fac_inactive_bootstrap
_
.
empty
())
while
(
not
bootstrap_factor_list
_
.
empty
())
{
{
list_fac_inactive_bootstrap
_
.
front
()
->
setStatus
(
FAC_ACTIVE
);
bootstrap_factor_list
_
.
front
()
->
setStatus
(
FAC_ACTIVE
);
list_fac_inactive_bootstrap
_
.
pop_front
();
bootstrap_factor_list
_
.
pop_front
();
}
}
// Clear bootstrapping flag. This marks the end of the bootstrapping process
// Clear bootstrapping flag. This marks the end of the bootstrapping process
...
@@ -380,10 +380,10 @@ void ProcessorImu::bootstrapEnable(bool _bootstrap_enable)
...
@@ -380,10 +380,10 @@ void ProcessorImu::bootstrapEnable(bool _bootstrap_enable)
CaptureBasePtr
ProcessorImu
::
bootstrapOrigin
()
const
CaptureBasePtr
ProcessorImu
::
bootstrapOrigin
()
const
{
{
if
(
list_fac_inactive_bootstrap
_
.
empty
())
if
(
bootstrap_factor_list
_
.
empty
())
return
origin_ptr_
;
return
origin_ptr_
;
else
else
return
std
::
static_pointer_cast
<
CaptureMotion
>
(
list_fac_inactive_bootstrap
_
.
front
()
->
getCapture
())
return
std
::
static_pointer_cast
<
CaptureMotion
>
(
bootstrap_factor_list
_
.
front
()
->
getCapture
())
->
getOriginCapture
();
->
getOriginCapture
();
}
}
...
@@ -393,7 +393,7 @@ VectorXd ProcessorImu::bootstrapDelta() const
...
@@ -393,7 +393,7 @@ VectorXd ProcessorImu::bootstrapDelta() const
// first, integrate all deltas in previous factors
// first, integrate all deltas in previous factors
VectorXd
delta_int
=
deltaZero
();
VectorXd
delta_int
=
deltaZero
();
double
dt
;
double
dt
;
for
(
const
auto
&
fac
:
list_fac_inactive_bootstrap
_
)
for
(
const
auto
&
fac
:
bootstrap_factor_list
_
)
// here, we take advantage of the list of IMU factors to recover all deltas
// here, we take advantage of the list of IMU factors to recover all deltas
{
{
dt
=
fac
->
getCapture
()
->
getTimeStamp
()
-
fac
->
getCaptureOther
()
->
getTimeStamp
();
dt
=
fac
->
getCapture
()
->
getTimeStamp
()
-
fac
->
getCaptureOther
()
->
getTimeStamp
();
...
@@ -416,7 +416,7 @@ bool ProcessorImu::recomputeStates() const
...
@@ -416,7 +416,7 @@ bool ProcessorImu::recomputeStates() const
std
::
static_pointer_cast
<
const
ProcessorMotion
>
(
shared_from_this
())))
std
::
static_pointer_cast
<
const
ProcessorMotion
>
(
shared_from_this
())))
{
{
WOLF_DEBUG
(
"Recomputing IMU keyframe states..."
);
WOLF_DEBUG
(
"Recomputing IMU keyframe states..."
);
for
(
const
auto
&
fac
:
list_fac_inactive_bootstrap
_
)
for
(
const
auto
&
fac
:
bootstrap_factor_list
_
)
{
{
const
auto
&
ftr
=
fac
->
getFeature
();
const
auto
&
ftr
=
fac
->
getFeature
();
const
auto
&
cap
=
std
::
static_pointer_cast
<
CaptureMotion
>
(
ftr
->
getCapture
());
const
auto
&
cap
=
std
::
static_pointer_cast
<
CaptureMotion
>
(
ftr
->
getCapture
());
...
...
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