Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
laser
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
laser
Commits
1ba7d30c
Commit
1ba7d30c
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
hotfix: odometry_ is private now in MotionProvider
parent
afd2bae6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!42
devel->main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_odom_icp.cpp
+20
-16
20 additions, 16 deletions
src/processor/processor_odom_icp.cpp
with
20 additions
and
16 deletions
src/processor/processor_odom_icp.cpp
+
20
−
16
View file @
1ba7d30c
...
...
@@ -258,9 +258,9 @@ void ProcessorOdomIcp::advanceDerived()
odom_last_
=
odom_incoming_
;
// init odometry
_
if
(
o
dometry
_
.
empty
())
o
dometry
_
=
getProblem
()
->
stateZero
(
"PO"
);
// init odometry
if
(
getO
dometry
()
.
empty
())
setO
dometry
(
getProblem
()
->
stateZero
(
"PO"
)
)
;
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
...
...
@@ -271,12 +271,13 @@ void ProcessorOdomIcp::advanceDerived()
Isometry2d
rl_T_ri
=
rl_T_sl_
*
so_T_sl
.
inverse
()
*
so_T_si
*
rl_T_sl_
.
inverse
();
// 2D
auto
odometry
=
getOdometry
();
if
(
getProblem
()
->
getDim
()
==
2
)
{
auto
m_T_rl
=
laser
::
trf2isometry
(
odometry
_
[
'P'
],
odometry
_
[
'O'
]);
auto
m_T_rl
=
laser
::
trf2isometry
(
odometry
[
'P'
],
odometry
[
'O'
]);
auto
m_T_ri
=
m_T_rl
*
rl_T_ri
;
odometry
_
[
'P'
]
=
m_T_ri
.
translation
();
odometry
_
[
'O'
]
=
Vector1d
(
Rotation2Dd
(
m_T_ri
.
rotation
()).
angle
());
odometry
[
'P'
]
=
m_T_ri
.
translation
();
odometry
[
'O'
]
=
Vector1d
(
Rotation2Dd
(
m_T_ri
.
rotation
()).
angle
());
}
// 3D
else
...
...
@@ -285,10 +286,11 @@ void ProcessorOdomIcp::advanceDerived()
convert2dTo3d
(
rl_T_ri
,
rl_T3d_ri
);
SE3
::
compose
(
odometry
_
[
'P'
],
odometry
_
[
'O'
],
SE3
::
compose
(
odometry
[
'P'
],
odometry
[
'O'
],
rl_T3d_ri
.
head
<
3
>
(),
rl_T3d_ri
.
tail
<
4
>
(),
odometry
_
[
'P'
],
odometry
_
[
'O'
]);
odometry
[
'P'
],
odometry
[
'O'
]);
}
setOdometry
(
odometry
);
// advance transforms
trf_origin_last_
=
trf_origin_incoming_
;
...
...
@@ -299,24 +301,25 @@ void ProcessorOdomIcp::resetDerived()
// Using processing_step_ to ensure that origin, last and incoming are different
if
(
processing_step_
!=
FIRST_TIME_WITH_KEYFRAME
&&
processing_step_
!=
FIRST_TIME_WITHOUT_KEYFRAME
)
{
// init odometry
_
if
(
o
dometry
_
.
empty
())
o
dometry
_
=
getProblem
()
->
stateZero
(
"PO"
);
// init odometry
if
(
getO
dometry
()
.
empty
())
setO
dometry
(
getProblem
()
->
stateZero
(
"PO"
)
)
;
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
// computing odometry
auto
odometry
=
getOdometry
();
auto
so_T_si
=
laser
::
trf2isometry
(
trf_origin_incoming_
.
res_transf
);
auto
so_T_sl
=
laser
::
trf2isometry
(
trf_origin_last_
.
res_transf
);
Isometry2d
rl_T_ri
=
rl_T_sl_
*
so_T_sl
.
inverse
()
*
so_T_si
*
rl_T_sl_
.
inverse
();
// 2D
if
(
getProblem
()
->
getDim
()
==
2
)
{
auto
m_T_rl
=
laser
::
trf2isometry
(
odometry
_
[
'P'
],
odometry
_
[
'O'
]);
auto
m_T_rl
=
laser
::
trf2isometry
(
odometry
[
'P'
],
odometry
[
'O'
]);
auto
m_T_ri
=
m_T_rl
*
rl_T_ri
;
odometry
_
[
'P'
]
=
m_T_ri
.
translation
();
odometry
_
[
'O'
]
=
Vector1d
(
Rotation2Dd
(
m_T_ri
.
rotation
()).
angle
());
odometry
[
'P'
]
=
m_T_ri
.
translation
();
odometry
[
'O'
]
=
Vector1d
(
Rotation2Dd
(
m_T_ri
.
rotation
()).
angle
());
}
// 3D
else
...
...
@@ -325,10 +328,11 @@ void ProcessorOdomIcp::resetDerived()
convert2dTo3d
(
rl_T_ri
,
rl_T3d_ri
);
SE3
::
compose
(
odometry
_
[
'P'
],
odometry
_
[
'O'
],
SE3
::
compose
(
odometry
[
'P'
],
odometry
[
'O'
],
rl_T3d_ri
.
head
<
3
>
(),
rl_T3d_ri
.
tail
<
4
>
(),
odometry
_
[
'P'
],
odometry
_
[
'O'
]);
odometry
[
'P'
],
odometry
[
'O'
]);
}
setOdometry
(
odometry
);
// advance transforms
trf_origin_last_
=
trf_last_incoming_
;
...
...
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