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
d62a109f
Commit
d62a109f
authored
5 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
implemented move() and use it in PT
parent
e783e3d4
No related branches found
No related tags found
1 merge request
!292
Resolve "Allowed changes in wolf nodes"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/core/capture/capture_base.h
+1
-0
1 addition, 0 deletions
include/core/capture/capture_base.h
src/capture/capture_base.cpp
+23
-3
23 additions, 3 deletions
src/capture/capture_base.cpp
src/processor/processor_tracker.cpp
+5
-7
5 additions, 7 deletions
src/processor/processor_tracker.cpp
with
29 additions
and
10 deletions
include/core/capture/capture_base.h
+
1
−
0
View file @
d62a109f
...
@@ -103,6 +103,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
...
@@ -103,6 +103,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
SizeEigen
getCalibSize
()
const
;
SizeEigen
getCalibSize
()
const
;
virtual
Eigen
::
VectorXs
getCalibration
()
const
;
virtual
Eigen
::
VectorXs
getCalibration
()
const
;
void
setCalibration
(
const
Eigen
::
VectorXs
&
_calib
);
void
setCalibration
(
const
Eigen
::
VectorXs
&
_calib
);
void
move
(
FrameBasePtr
);
void
link
(
FrameBasePtr
);
void
link
(
FrameBasePtr
);
template
<
typename
classType
,
typename
...
T
>
template
<
typename
classType
,
typename
...
T
>
static
std
::
shared_ptr
<
CaptureBase
>
emplace
(
FrameBasePtr
_frm_ptr
,
T
&&
...
all
);
static
std
::
shared_ptr
<
CaptureBase
>
emplace
(
FrameBasePtr
_frm_ptr
,
T
&&
...
all
);
...
...
This diff is collapsed.
Click to expand it.
src/capture/capture_base.cpp
+
23
−
3
View file @
d62a109f
...
@@ -289,16 +289,36 @@ void CaptureBase::setCalibration(const VectorXs& _calib)
...
@@ -289,16 +289,36 @@ void CaptureBase::setCalibration(const VectorXs& _calib)
}
}
}
}
void
CaptureBase
::
link
(
FrameBasePtr
_frm_ptr
)
void
CaptureBase
::
move
(
FrameBasePtr
_frm_ptr
)
{
{
assert
((
this
->
getFrame
()
==
nullptr
||
!
this
->
getFrame
()
->
isKey
())
&&
"linking a capture already linked to a KF"
);
WOLF_WARN_COND
(
this
->
getFrame
()
==
nullptr
,
"moving a capture not linked to any frame"
);
WOLF_WARN_COND
(
_frm_ptr
!=
nullptr
,
"moving a capture to a null FrameBasePtr"
);
//
u
nlink
from previous non-key frame
//
U
nlink
if
(
this
->
getFrame
())
if
(
this
->
getFrame
())
{
if
(
this
->
getFrame
()
->
isKey
())
{
WOLF_ERROR
(
"moving a capture linked to a KF"
);
return
;
}
// unlink from previous non-key frame
this
->
getFrame
()
->
removeCapture
(
shared_from_this
());
this
->
getFrame
()
->
removeCapture
(
shared_from_this
());
}
// link
link
(
_frm_ptr
);
}
void
CaptureBase
::
link
(
FrameBasePtr
_frm_ptr
)
{
assert
(
this
->
getFrame
()
==
nullptr
&&
"linking a capture already linked"
);
if
(
_frm_ptr
)
if
(
_frm_ptr
)
{
{
_frm_ptr
->
addCapture
(
shared_from_this
());
_frm_ptr
->
addCapture
(
shared_from_this
());
this
->
setFrame
(
_frm_ptr
);
this
->
setFrame
(
_frm_ptr
);
this
->
setProblem
(
_frm_ptr
->
getProblem
());
this
->
setProblem
(
_frm_ptr
->
getProblem
());
...
...
This diff is collapsed.
Click to expand it.
src/processor/processor_tracker.cpp
+
5
−
7
View file @
d62a109f
...
@@ -58,7 +58,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
...
@@ -58,7 +58,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
WOLF_DEBUG
(
"PT "
,
getName
(),
" FIRST_TIME_WITH_PACK: KF"
,
pack
->
key_frame
->
id
()
,
" callback unpacked with ts= "
,
pack
->
key_frame
->
getTimeStamp
()
);
WOLF_DEBUG
(
"PT "
,
getName
(),
" FIRST_TIME_WITH_PACK: KF"
,
pack
->
key_frame
->
id
()
,
" callback unpacked with ts= "
,
pack
->
key_frame
->
getTimeStamp
()
);
// Append incoming to KF
// Append incoming to KF
// pack->key_frame->addCapture(incoming_ptr_);
incoming_ptr_
->
link
(
pack
->
key_frame
);
incoming_ptr_
->
link
(
pack
->
key_frame
);
// Process info
// Process info
...
@@ -137,7 +136,7 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
...
@@ -137,7 +136,7 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// Capture last_ is added to the new keyframe
// Capture last_ is added to the new keyframe
FrameBasePtr
last_old_frame
=
last_ptr_
->
getFrame
();
FrameBasePtr
last_old_frame
=
last_ptr_
->
getFrame
();
last_ptr_
->
link
(
pack
->
key_frame
);
// automatically calling last_ptr_->unlink();
last_ptr_
->
move
(
pack
->
key_frame
);
last_old_frame
->
remove
();
last_old_frame
->
remove
();
// Create new frame
// Create new frame
...
@@ -204,7 +203,7 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
...
@@ -204,7 +203,7 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// make F; append incoming to new F
// make F; append incoming to new F
FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, incoming_ptr_->getTimeStamp());
FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, incoming_ptr_->getTimeStamp());
frm->addCapture(
incoming_ptr_);
incoming_ptr_
->link(frm
);
// Establish factors
// Establish factors
establishFactors();
establishFactors();
...
@@ -227,10 +226,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
...
@@ -227,10 +226,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// We do not create a KF
// We do not create a KF
// Advance this
// Advance this
// last_ptr_->getFrame()->addCapture(incoming_ptr_); // Add incoming Capture to the tracker's last Frame
FrameBasePtr
frm
=
getProblem
()
->
emplaceFrame
(
NON_ESTIMATED
,
last_ptr_
->
getFrame
()
->
getState
(),
incoming_ptr_
->
getTimeStamp
());
incoming_ptr_
->
link
(
last_ptr_
->
getFrame
());
incoming_ptr_
->
link
(
frm
);
last_ptr_
->
remove
();
last_ptr_
->
getFrame
()
->
remove
();
// implicitly calling last_ptr_->remove();
incoming_ptr_
->
getFrame
()
->
setTimeStamp
(
incoming_ptr_
->
getTimeStamp
());
// Update pointers
// Update pointers
advanceDerived
();
advanceDerived
();
...
...
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