Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
72a63c3b
Commit
72a63c3b
authored
8 years ago
by
Dinesh Atchuthan
Browse files
Options
Downloads
Patches
Plain Diff
constraint_imu.h -> expectation(...) created
parent
cb2993dc
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
src/constraint_imu.h
+45
-0
45 additions, 0 deletions
src/constraint_imu.h
with
45 additions
and
0 deletions
src/constraint_imu.h
+
45
−
0
View file @
72a63c3b
...
@@ -28,6 +28,23 @@ class ConstraintIMU : public ConstraintSparse<9, 3, 4, 3, 3, 3, 3, 4, 3>
...
@@ -28,6 +28,23 @@ class ConstraintIMU : public ConstraintSparse<9, 3, 4, 3, 3, 3, 3, 4, 3>
virtual
JacobianMethod
getJacobianMethod
()
const
;
virtual
JacobianMethod
getJacobianMethod
()
const
;
/* Function expectation(...)
* params :
* Vector3s _p1 : position in imu frame
* Vector4s _q1 : orientation quaternion in imu frame
* Vector3s _v1 : velocity in imu frame
* Vector3s _ab : accelerometer bias in imu frame
* Vector3s _wb : gyroscope bias in imu frame
* Vector3s _p2 : position in current frame
* Vector4s _q2 : orientation quaternion in current frame
* Vector3s _v2 : velocity in current frame
* Matrix<10,1, wolf::Scalar> _expectation : to retrieve resulting expectation (PVQ)
*/
template
<
typename
T
>
void
expectation
(
const
T
*
const
_p1
,
const
T
*
const
_q1
,
const
T
*
const
_v1
,
const
T
*
const
_ab
,
const
T
*
_wb
,
const
T
*
const
_p2
,
const
T
*
const
_q2
,
const
T
*
const
_v2
,
//const T* const _lmk_hmg,
T
*
_expectation
)
const
;
public:
public:
static
wolf
::
ConstraintBasePtr
create
(
FeatureIMUPtr
_feature_ptr
,
NodeBasePtr
_correspondant_ptr
);
static
wolf
::
ConstraintBasePtr
create
(
FeatureIMUPtr
_feature_ptr
,
NodeBasePtr
_correspondant_ptr
);
...
@@ -128,6 +145,34 @@ inline bool ConstraintIMU::operator ()(const T* const _p1, const T* const _q1, c
...
@@ -128,6 +145,34 @@ inline bool ConstraintIMU::operator ()(const T* const _p1, const T* const _q1, c
return
true
;
return
true
;
}
}
template
<
typename
T
>
inline
void
ConstraintIMU
::
expectation
(
const
T
*
const
_p1
,
const
T
*
const
_q1
,
const
T
*
const
_v1
,
const
T
*
const
_ab
,
const
T
*
_wb
,
const
T
*
const
_p2
,
const
T
*
const
_q2
,
const
T
*
const
_v2
,
//const T* const _lmk_hmg,
T
*
_expectation
)
const
{
// MAPS
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
p1
(
_p1
);
Eigen
::
Map
<
const
Eigen
::
Quaternion
<
T
>
>
q1
(
_q1
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
v1
(
_v1
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
ab
(
_ab
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
wb
(
_wb
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
p2
(
_p2
);
Eigen
::
Map
<
const
Eigen
::
Quaternion
<
T
>
>
q2
(
_q2
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
v2
(
_v2
);
Eigen
::
Map
<
Eigen
::
Matrix
<
T
,
10
,
1
>
>
expectation
(
_expectation
);
// Predict delta: d_pred = x2 (-) x1
Eigen
::
Matrix
<
T
,
3
,
1
>
dp_predict
=
q1
.
conjugate
()
*
(
p2
-
p1
-
v1
*
(
T
)
dt_
-
(
T
)
0.5
*
g_
.
cast
<
T
>
()
*
(
T
)
dt_2_
);
Eigen
::
Matrix
<
T
,
3
,
1
>
dv_predict
=
q1
.
conjugate
()
*
(
v2
-
v1
-
g_
.
cast
<
T
>
()
*
(
T
)
dt_
);
Eigen
::
Quaternion
<
T
>
dq_predict
=
q1
.
conjugate
()
*
q2
;
expectation
.
head
(
3
)
=
dp_predict
;
expectation
.
segment
(
3
,
4
)
=
dq_predict
;
expectation
.
tail
(
3
)
=
dv_predict
;
}
inline
JacobianMethod
ConstraintIMU
::
getJacobianMethod
()
const
inline
JacobianMethod
ConstraintIMU
::
getJacobianMethod
()
const
{
{
return
JAC_AUTO
;
return
JAC_AUTO
;
...
...
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