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
770db33f
Commit
770db33f
authored
1 month ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
improved processor odom icp
parent
1874c01a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!39
Draft: Resolve "Adapt to new sensor constructors in core"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_odom_icp.cpp
+31
-8
31 additions, 8 deletions
src/processor/processor_odom_icp.cpp
with
31 additions
and
8 deletions
src/processor/processor_odom_icp.cpp
+
31
−
8
View file @
770db33f
...
@@ -77,13 +77,30 @@ void ProcessorOdomIcp::preProcess()
...
@@ -77,13 +77,30 @@ void ProcessorOdomIcp::preProcess()
(
"Capture type mismatch. "
+
getName
()
+
" can only process captures of type CaptureLaser2d"
).
c_str
());
(
"Capture type mismatch. "
+
getName
()
+
" can only process captures of type CaptureLaser2d"
).
c_str
());
if
(
initial_guess_
==
"odom"
)
if
(
initial_guess_
==
"odom"
)
odom_incoming_
=
getProblem
()
->
getOdometry
(
"PO"
).
vector
(
"PO"
);
{
auto
odom_incoming_composite
=
getProblem
()
->
getOdometry
(
"PO"
);
if
(
odom_incoming_composite
.
has
(
"PO"
))
odom_incoming_
=
odom_incoming_composite
.
vector
(
"PO"
);
else
odom_incoming_
=
odom_last_
;
// if no odometry available, use identity as initial guess
}
else
if
(
initial_guess_
==
"state"
)
else
if
(
initial_guess_
==
"state"
)
{
{
odom_incoming_
=
getProblem
()
->
getState
(
"PO"
).
vector
(
"PO"
);
auto
state_incoming_composite
=
getProblem
()
->
getState
(
"PO"
);
if
(
state_incoming_composite
.
has
(
"PO"
))
if
(
last_ptr_
)
odom_last_
=
getProblem
()
->
getState
(
last_ptr_
->
getTimeStamp
(),
"PO"
).
vector
(
"PO"
);
odom_incoming_
=
state_incoming_composite
.
vector
(
"PO"
);
if
(
origin_ptr_
)
odom_origin_
=
getProblem
()
->
getState
(
origin_ptr_
->
getTimeStamp
(),
"PO"
).
vector
(
"PO"
);
else
odom_incoming_
=
odom_last_
;
if
(
last_ptr_
)
{
auto
state_last_composite
=
getProblem
()
->
getState
(
last_ptr_
->
getTimeStamp
(),
"PO"
);
if
(
state_last_composite
.
has
(
"PO"
))
odom_last_
=
state_last_composite
.
vector
(
"PO"
);
}
if
(
origin_ptr_
)
{
auto
state_origin_composite
=
getProblem
()
->
getState
(
origin_ptr_
->
getTimeStamp
(),
"PO"
);
if
(
state_origin_composite
.
has
(
"PO"
))
odom_origin_
=
state_origin_composite
.
vector
(
"PO"
);
}
}
}
}
}
...
@@ -121,7 +138,7 @@ void ProcessorOdomIcp::updateExtrinsicsIsometries()
...
@@ -121,7 +138,7 @@ void ProcessorOdomIcp::updateExtrinsicsIsometries()
ro_T_so_
=
laser
::
trf2isometry
(
origin_ptr_
->
getSensorP
()
->
getState
(),
origin_ptr_
->
getSensorP
()
->
getState
());
ro_T_so_
=
laser
::
trf2isometry
(
origin_ptr_
->
getSensorP
()
->
getState
(),
origin_ptr_
->
getSensorP
()
->
getState
());
rl_T_sl_
=
laser
::
trf2isometry
(
last_ptr_
->
getSensorP
()
->
getState
(),
last_ptr_
->
getSensorP
()
->
getState
());
rl_T_sl_
=
laser
::
trf2isometry
(
last_ptr_
->
getSensorP
()
->
getState
(),
last_ptr_
->
getSensorP
()
->
getState
());
}
}
//
statics not fixed (otherwise nothing to do)
//
estimated
else
if
(
not
sensor_laser_
->
getP
()
->
isFixed
()
or
not
sensor_laser_
->
getO
()
->
isFixed
())
else
if
(
not
sensor_laser_
->
getP
()
->
isFixed
()
or
not
sensor_laser_
->
getO
()
->
isFixed
())
{
{
ro_T_so_
=
laser
::
trf2isometry
(
sensor_laser_
->
getP
()
->
getState
(),
sensor_laser_
->
getO
()
->
getState
());
ro_T_so_
=
laser
::
trf2isometry
(
sensor_laser_
->
getP
()
->
getState
(),
sensor_laser_
->
getO
()
->
getState
());
...
@@ -465,7 +482,7 @@ VectorComposite ProcessorOdomIcp::getState(StateKeys _keys) const
...
@@ -465,7 +482,7 @@ VectorComposite ProcessorOdomIcp::getState(StateKeys _keys) const
if
(
state_types_
.
has
(
key
))
keys_available
+=
key
;
if
(
state_types_
.
has
(
key
))
keys_available
+=
key
;
}
}
_keys
=
keys_available
;
_keys
=
keys_available
;
WOLF_
WARN
(
"Processor has no all keys asked ("
,
_keys
,
"). Returning the available ones: "
,
_keys
);
WOLF_
DEBUG
(
"Processor has no all keys asked ("
,
_keys
,
"). Returning the available ones: "
,
_keys
);
}
}
}
}
...
@@ -531,7 +548,13 @@ VectorComposite ProcessorOdomIcp::getState(const TimeStamp& _ts, StateKeys _keys
...
@@ -531,7 +548,13 @@ VectorComposite ProcessorOdomIcp::getState(const TimeStamp& _ts, StateKeys _keys
if
(
origin_ptr_
and
fabs
(
_ts
-
origin_ptr_
->
getTimeStamp
())
<
getTimeTolerance
())
if
(
origin_ptr_
and
fabs
(
_ts
-
origin_ptr_
->
getTimeStamp
())
<
getTimeTolerance
())
return
origin_ptr_
->
getFrame
()
->
getState
(
"PO"
);
return
origin_ptr_
->
getFrame
()
->
getState
(
"PO"
);
WOLF_WARN
(
getName
(),
": Requested state with time stamp out of tolerance. Returning empty VectorComposite"
);
WOLF_WARN
(
getName
(),
": Requested state with time stamp out of tolerance. Returning empty VectorComposite. Requested ts: "
,
_ts
,
" - last: "
,
last_ptr_
->
getTimeStamp
(),
" - origin: "
,
origin_ptr_
->
getTimeStamp
());
return
VectorComposite
();
return
VectorComposite
();
}
}
...
...
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