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
b3087cea
Commit
b3087cea
authored
8 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Remove shared_from_this in the lmk case
Frame and Feature cases are marked with FIXME for later evaluation
parent
500d3c1e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/constraint_base.cpp
+2
-7
2 additions, 7 deletions
src/constraint_base.cpp
src/processor_tracker_landmark.cpp
+5
-4
5 additions, 4 deletions
src/processor_tracker_landmark.cpp
with
7 additions
and
11 deletions
src/constraint_base.cpp
+
2
−
7
View file @
b3087cea
...
@@ -38,7 +38,7 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBasePtr _frame_ptr, bool
...
@@ -38,7 +38,7 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBasePtr _frame_ptr, bool
// add constraint to frame
// add constraint to frame
FrameBasePtr
frm_o
=
frame_other_ptr_
.
lock
();
FrameBasePtr
frm_o
=
frame_other_ptr_
.
lock
();
if
(
frm_o
)
if
(
frm_o
)
frm_o
->
addConstrainedBy
(
shared_from_this
());
frm_o
->
addConstrainedBy
(
shared_from_this
());
// FIXME: cannot do shared_from_this in constructor!
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
}
}
...
@@ -58,7 +58,7 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBasePtr _feature_ptr,
...
@@ -58,7 +58,7 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBasePtr _feature_ptr,
// add constraint to feature
// add constraint to feature
FeatureBasePtr
ftr_o
=
feature_other_ptr_
.
lock
();
FeatureBasePtr
ftr_o
=
feature_other_ptr_
.
lock
();
if
(
ftr_o
)
if
(
ftr_o
)
ftr_o
->
addConstrainedBy
(
shared_from_this
());
ftr_o
->
addConstrainedBy
(
shared_from_this
());
// FIXME: cannot do shared_from_this in constructor!
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
}
}
...
@@ -76,11 +76,6 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, LandmarkBasePtr _landmark_ptr
...
@@ -76,11 +76,6 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, LandmarkBasePtr _landmark_ptr
landmark_other_ptr_
(
_landmark_ptr
)
landmark_other_ptr_
(
_landmark_ptr
)
{
{
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
// add constraint to landmark
LandmarkBasePtr
lmk_o
=
landmark_other_ptr_
.
lock
();
if
(
lmk_o
)
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
lmk_o
->
addConstrainedBy
(
shared_from_this
());
// FIXME: cannot do shared_from_this in constructor!
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
std
::
cout
<<
"constructed +c"
<<
id
()
<<
std
::
endl
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/processor_tracker_landmark.cpp
+
5
−
4
View file @
b3087cea
...
@@ -130,17 +130,18 @@ void ProcessorTrackerLandmark::establishConstraints()
...
@@ -130,17 +130,18 @@ void ProcessorTrackerLandmark::establishConstraints()
//std::cout << "ProcessorTrackerLandmark::establishConstraints" << std::endl;
//std::cout << "ProcessorTrackerLandmark::establishConstraints" << std::endl;
//std::cout << "\tfeatures:" << last_ptr_->getFeatureList().size() << std::endl;
//std::cout << "\tfeatures:" << last_ptr_->getFeatureList().size() << std::endl;
//std::cout << "\tcorrespondences: " << matches_landmark_from_last_.size() << std::endl;
//std::cout << "\tcorrespondences: " << matches_landmark_from_last_.size() << std::endl;
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
for
(
auto
last_feature
:
last_ptr_
->
getFeatureList
())
for
(
auto
last_feature
:
last_ptr_
->
getFeatureList
())
{
{
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
auto
lmk
=
matches_landmark_from_last_
[
last_feature
]
->
landmark_ptr_
;
ConstraintBasePtr
ctr_ptr
=
createConstraint
(
last_feature
,
ConstraintBasePtr
ctr_ptr
=
createConstraint
(
last_feature
,
matches_landmark_from_last_
[
last_feature
]
->
landmark_ptr_
);
lmk
);
if
(
ctr_ptr
!=
nullptr
)
if
(
ctr_ptr
!=
nullptr
)
// constraint links
{
{
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
last_feature
->
addConstraint
(
ctr_ptr
);
last_feature
->
addConstraint
(
ctr_ptr
);
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
lmk
->
addConstrainedBy
(
ctr_ptr
);
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
}
}
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
std
::
cout
<<
__FILE__
<<
":"
<<
__FUNCTION__
<<
"():"
<<
__LINE__
<<
std
::
endl
;
}
}
...
...
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