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
e6cb18a3
Commit
e6cb18a3
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
New between() with return value
parent
721b382f
No related branches found
No related tags found
1 merge request
!123
Calibration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/imu_tools.h
+11
-6
11 additions, 6 deletions
src/imu_tools.h
src/test/gtest_imu_tools.cpp
+8
-3
8 additions, 3 deletions
src/test/gtest_imu_tools.cpp
with
19 additions
and
9 deletions
src/imu_tools.h
+
11
−
6
View file @
e6cb18a3
...
...
@@ -155,6 +155,16 @@ inline void between(const MatrixBase<D1>& d1,
diff_v
=
dq1
.
conjugate
()
*
(
dv2
-
dv1
);
}
template
<
typename
D1
,
typename
D2
>
inline
Matrix
<
typename
D1
::
Scalar
,
10
,
1
>
between
(
const
MatrixBase
<
D1
>&
d1
,
const
MatrixBase
<
D2
>&
d2
,
Scalar
dt
)
{
Matrix
<
typename
D1
::
Scalar
,
10
,
1
>
d_bet
;
between
(
d1
,
d2
,
dt
,
d_bet
);
return
d_bet
;
}
template
<
typename
Derived
>
Matrix
<
typename
Derived
::
Scalar
,
9
,
1
>
lift
(
const
MatrixBase
<
Derived
>&
delta_in
)
{
...
...
@@ -202,15 +212,10 @@ inline void compare(const MatrixBase<D1>& d1,
const
MatrixBase
<
D2
>&
d2
,
MatrixBase
<
D3
>&
err
)
{
Matrix
<
typename
D3
::
Scalar
,
10
,
1
>
delta_err
;
between
(
d1
,
d2
,
0.0
,
delta_err
);
err
=
lift
(
delta_err
);
err
=
lift
(
between
(
d1
,
d2
,
0.0
)
);
}
}
// namespace imu
}
// namespace wolf
...
...
This diff is collapsed.
Click to expand it.
src/test/gtest_imu_tools.cpp
+
8
−
3
View file @
e6cb18a3
...
...
@@ -25,7 +25,7 @@ TEST(IMU_tools, identity)
TEST
(
IMU_tools
,
inverse
)
{
VectorXs
d
(
10
),
id
(
10
),
iid
(
10
),
iiid
(
10
);
VectorXs
d
(
10
),
id
(
10
),
iid
(
10
),
iiid
(
10
)
,
I
(
10
)
;
Vector4s
qv
;
Scalar
dt
=
0.1
;
...
...
@@ -33,10 +33,15 @@ TEST(IMU_tools, inverse)
d
<<
0
,
1
,
2
,
qv
,
7
,
8
,
9
;
id
=
imu
::
inverse
(
d
,
dt
);
imu
::
inverse
(
id
,
-
dt
,
iid
);
// Observe -dt is reversed !!
iiid
=
imu
::
inverse
(
iid
,
dt
);
imu
::
compose
(
id
,
d
,
dt
,
I
);
ASSERT_MATRIX_APPROX
(
I
,
imu
::
identity
(),
1e-10
);
imu
::
compose
(
d
,
id
,
-
dt
,
I
);
// Observe -dt is reversed !!
ASSERT_MATRIX_APPROX
(
I
,
imu
::
identity
(),
1e-10
);
imu
::
inverse
(
id
,
-
dt
,
iid
);
// Observe -dt is reversed !!
ASSERT_MATRIX_APPROX
(
d
,
iid
,
1e-10
);
iiid
=
imu
::
inverse
(
iid
,
dt
);
ASSERT_MATRIX_APPROX
(
id
,
iiid
,
1e-10
);
}
...
...
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