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
79eaefe1
Commit
79eaefe1
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
keeping ordered last_KF and last_estimated_frame
parent
b4c766bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!266
Estimated frames
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/trajectory/trajectory_base.cpp
+11
-7
11 additions, 7 deletions
src/trajectory/trajectory_base.cpp
with
11 additions
and
7 deletions
src/trajectory/trajectory_base.cpp
+
11
−
7
View file @
79eaefe1
...
...
@@ -31,8 +31,11 @@ FrameBasePtr TrajectoryBase::addFrame(FrameBasePtr _frame_ptr)
// register state blocks
_frame_ptr
->
registerNewStateBlocks
();
// sort
and update last_estimated and last_important
// sort
sortFrame
(
_frame_ptr
);
// update last_estimated and last_key
updateLastFrames
();
}
return
_frame_ptr
;
...
...
@@ -71,7 +74,7 @@ void TrajectoryBase::updateLastFrames()
{
bool
last_estimated_set
=
false
;
// NOTE: Assumes
key
frames are sorted by timestamp
// NOTE: Assumes
estimated (key or auxiliary)
frames are sorted by timestamp
for
(
auto
frm_rit
=
getFrameList
().
rbegin
();
frm_rit
!=
getFrameList
().
rend
();
++
frm_rit
)
if
((
*
frm_rit
)
->
isEstimated
())
{
...
...
@@ -80,22 +83,22 @@ void TrajectoryBase::updateLastFrames()
last_estimated_frame_ptr_
=
(
*
frm_rit
);
last_estimated_set
=
true
;
}
if
((
*
frm_rit
)
->
is
Important
())
if
((
*
frm_rit
)
->
is
Key
())
{
last_
important
_frame_ptr_
=
(
*
frm_rit
);
last_
key
_frame_ptr_
=
(
*
frm_rit
);
break
;
}
}
}
FrameBasePtr
TrajectoryBase
::
closest
Important
FrameToTimeStamp
(
const
TimeStamp
&
_ts
)
const
FrameBasePtr
TrajectoryBase
::
closest
Key
FrameToTimeStamp
(
const
TimeStamp
&
_ts
)
const
{
// NOTE: Assumes
key
frames are sorted by timestamp
// NOTE: Assumes
estimated (key or auxiliary)
frames are sorted by timestamp
FrameBasePtr
closest_kf
=
nullptr
;
Scalar
min_dt
=
1e9
;
for
(
auto
frm_rit
=
frame_list_
.
rbegin
();
frm_rit
!=
frame_list_
.
rend
();
frm_rit
++
)
if
((
*
frm_rit
)
->
is
Important
())
if
((
*
frm_rit
)
->
is
Key
())
{
Scalar
dt
=
std
::
fabs
((
*
frm_rit
)
->
getTimeStamp
()
-
_ts
);
if
(
dt
<
min_dt
)
...
...
@@ -111,6 +114,7 @@ FrameBasePtr TrajectoryBase::closestImportantFrameToTimeStamp(const TimeStamp& _
FrameBasePtr
TrajectoryBase
::
closestEstimatedFrameToTimeStamp
(
const
TimeStamp
&
_ts
)
const
{
// NOTE: Assumes estimated (key or auxiliary) frames are sorted by timestamp
FrameBasePtr
closest_kf
=
nullptr
;
Scalar
min_dt
=
1e9
;
...
...
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