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
a677a084
Commit
a677a084
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
bug fixed in odom_icp
parent
1ba7d30c
No related branches found
No related tags found
1 merge request
!43
Devel
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_odom_icp.cpp
+14
-12
14 additions, 12 deletions
src/processor/processor_odom_icp.cpp
with
14 additions
and
12 deletions
src/processor/processor_odom_icp.cpp
+
14
−
12
View file @
a677a084
...
...
@@ -19,6 +19,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#include
"laser/internal/config.h"
#include
"laser/processor/processor_odom_icp.h"
#include
"laser/math/laser_tools.h"
#include
"laser/capture/capture_laser_2d.h"
...
...
@@ -139,21 +140,22 @@ unsigned int ProcessorOdomIcp::processKnown()
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
auto
r
i
_T_r
o
=
computeIsometry2d
(
odom_
incoming
_
,
odom_
orig
in_
);
auto
s
i
_T_s
o
=
r
l
_T_s
l
_
.
inverse
()
*
r
i
_T_r
o
*
r
o
_T_s
o
_
;
initial_guess
.
head
<
2
>
()
=
s
i
_T_s
o
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
s
i
_T_s
o
.
rotation
()).
angle
();
auto
r
o
_T_r
i
=
computeIsometry2d
(
odom_
origin
_
,
odom_
incom
in
g
_
);
auto
s
o
_T_s
i
=
r
o
_T_s
o
_
.
inverse
()
*
r
o
_T_r
i
*
r
l
_T_s
l
_
;
initial_guess
.
head
<
2
>
()
=
s
o
_T_s
i
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
s
o
_T_s
i
.
rotation
()).
angle
();
}
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
trf_origin_incoming_
=
icp_tools_ptr_
->
align
(
incoming
_ptr
->
getScan
(),
orig
in_ptr
->
getScan
(),
trf_origin_incoming_
=
icp_tools_ptr_
->
align
(
origin
_ptr
->
getScan
(),
incom
in
g
_ptr
->
getScan
(),
this
->
laser_scan_params_
,
params_odom_icp_
->
icp_params
,
initial_guess
);
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown odom_origin_: "
,
odom_origin_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown odom_incoming_: "
,
odom_incoming_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown trf_origin_last_.res_transf: "
,
trf_origin_last_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown initial guess: "
,
initial_guess
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown ICP transform: "
,
trf_origin_incoming_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown ICP cov:
\n
"
,
trf_origin_incoming_
.
res_covar
);
...
...
@@ -173,16 +175,16 @@ unsigned int ProcessorOdomIcp::processNew(const int& _max_features)
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
auto
r
i
_T_r
l
=
computeIsometry2d
(
odom_incoming_
,
odom_last_
);
auto
s
i
_T_s
l
=
rl_T_sl_
.
inverse
()
*
r
i
_T_r
l
*
rl_T_sl_
;
initial_guess
.
head
<
2
>
()
=
s
i
_T_s
l
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
s
i
_T_s
l
.
rotation
()).
angle
();
auto
r
l
_T_r
i
=
computeIsometry2d
(
odom_incoming_
,
odom_last_
);
auto
s
l
_T_s
i
=
rl_T_sl_
.
inverse
()
*
r
l
_T_r
i
*
rl_T_sl_
;
initial_guess
.
head
<
2
>
()
=
s
l
_T_s
i
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
s
l
_T_s
i
.
rotation
()).
angle
();
}
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
trf_last_incoming_
=
icp_tools_ptr_
->
align
(
incoming
_ptr
->
getScan
(),
last
_ptr
->
getScan
(),
trf_last_incoming_
=
icp_tools_ptr_
->
align
(
last
_ptr
->
getScan
(),
incoming
_ptr
->
getScan
(),
this
->
laser_scan_params_
,
params_odom_icp_
->
icp_params
,
initial_guess
);
...
...
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