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
2ccbe83e
Commit
2ccbe83e
authored
5 years ago
by
Médéric Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
Proposal to deal with integrateOneStep() before handling KF pack
parent
846ff15f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!373
Resolve "Processor motion composite state adaptation"
Pipeline
#5607
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/processor/processor_motion.h
+2
-1
2 additions, 1 deletion
include/core/processor/processor_motion.h
src/processor/processor_motion.cpp
+23
-10
23 additions, 10 deletions
src/processor/processor_motion.cpp
with
25 additions
and
11 deletions
include/core/processor/processor_motion.h
+
2
−
1
View file @
2ccbe83e
...
...
@@ -484,7 +484,8 @@ class ProcessorMotion : public ProcessorBase, public IsMotion
CaptureMotionPtr
origin_ptr_
;
CaptureMotionPtr
last_ptr_
;
CaptureMotionPtr
incoming_ptr_
;
bool
last_nullptr_
;
protected
:
// helpers to avoid allocation
double
dt_
;
///< Time step
...
...
This diff is collapsed.
Click to expand it.
src/processor/processor_motion.cpp
+
23
−
10
View file @
2ccbe83e
...
...
@@ -33,6 +33,7 @@ ProcessorMotion::ProcessorMotion(const std::string& _type,
origin_ptr_
(),
last_ptr_
(),
incoming_ptr_
(),
last_nullptr_
(
false
),
dt_
(
0.0
),
x_
(
_state_size
),
delta_
(
_delta_size
),
...
...
@@ -95,10 +96,19 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
preProcess
();
// Derived class operations
// integrate data
if
(
last_ptr_
!=
nullptr
)
{
integrateOneStep
();
}
else
{
last_nullptr_
=
true
;
}
PackKeyFramePtr
pack
=
computeProcessingStep
();
if
(
pack
)
buffer_pack_kf_
.
removeUpTo
(
pack
->
key_frame
->
getTimeStamp
()
);
switch
(
processing_step_
)
{
case
FIRST_TIME_WITHOUT_KF
:
...
...
@@ -161,13 +171,15 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
// extract pack elements
FrameBasePtr
keyframe_from_callback
=
pack
->
key_frame
;
TimeStamp
ts_from_callback
=
keyframe_from_callback
->
getTimeStamp
();
keyframe_from_callback
->
setState
(
getState
(
ts_from_callback
));
// find the capture whose buffer is affected by the new keyframe
auto
capture_existing
=
findCaptureContainingTimeStamp
(
keyframe
_from_callback
->
getTimeStamp
()
);
// k
auto
capture_existing
=
findCaptureContainingTimeStamp
(
ts
_from_callback
);
// k
if
(
!
capture_existing
)
{
WOLF_WARN
(
"A KF before first motion capture (TS = "
,
keyframe
_from_callback
->
getTimeStamp
()
,
"). ProcessorMotion cannot do anything."
);
WOLF_WARN
(
"A KF before first motion capture (TS = "
,
ts
_from_callback
,
"). ProcessorMotion cannot do anything."
);
break
;
}
...
...
@@ -178,7 +190,6 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
VectorXd
calib_origin
=
getCalibration
(
capture_origin
);
// emplace a new motion capture to the new keyframe
TimeStamp
ts_from_callback
=
keyframe_from_callback
->
getTimeStamp
();
auto
capture_for_keyframe_callback
=
emplaceCapture
(
keyframe_from_callback
,
// j
getSensor
(),
ts_from_callback
,
...
...
@@ -260,6 +271,8 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
// extract pack elements
FrameBasePtr
keyframe_from_callback
=
pack
->
key_frame
;
TimeStamp
ts_from_callback
=
keyframe_from_callback
->
getTimeStamp
();
keyframe_from_callback
->
setState
(
getState
(
ts_from_callback
));
auto
&
capture_existing
=
last_ptr_
;
...
...
@@ -270,7 +283,6 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
VectorXd
calib_origin
=
getCalibration
(
capture_origin
);
// emplace a new motion capture to the new keyframe
TimeStamp
ts_from_callback
=
keyframe_from_callback
->
getTimeStamp
();
auto
capture_for_keyframe_callback
=
emplaceCapture
(
keyframe_from_callback
,
getSensor
(),
ts_from_callback
,
...
...
@@ -300,17 +312,18 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
break
;
}
////////////////////////////////////////////////////
// NOW on with the received data
if
(
last_nullptr_
){
integrateOneStep
();
last_nullptr_
=
false
;
}
// integrate data
integrateOneStep
();
// Update state and time stamps
const
auto
&
ts
=
getTimeStamp
();
last_ptr_
->
setTimeStamp
(
ts
);
last_ptr_
->
getFrame
()
->
setTimeStamp
(
ts
);
last_ptr_
->
getFrame
()
->
setState
(
getProblem
()
->
getState
(
ts
)
);
VectorComposite
state_propa
=
getState
(
ts
);
last_ptr_
->
getFrame
()
->
setState
(
state_propa
);
if
(
permittedKeyFrame
()
&&
voteForKeyFrame
())
{
...
...
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