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
3b23ce6a
Commit
3b23ce6a
authored
8 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Re-code setStatus() with a for loop over state_blk_vec
parent
4eb5d909
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/landmark_base.cpp
+39
-29
39 additions, 29 deletions
src/landmark_base.cpp
src/landmark_base.h
+0
-4
0 additions, 4 deletions
src/landmark_base.h
with
39 additions
and
33 deletions
src/landmark_base.cpp
+
39
−
29
View file @
3b23ce6a
...
@@ -15,11 +15,8 @@ LandmarkBase::LandmarkBase(const LandmarkType & _tp, const std::string& _type, S
...
@@ -15,11 +15,8 @@ LandmarkBase::LandmarkBase(const LandmarkType & _tp, const std::string& _type, S
state_block_vec_
(
4
),
// allow for 4 state blocks by default. Should be enough in all applications.
state_block_vec_
(
4
),
// allow for 4 state blocks by default. Should be enough in all applications.
landmark_id_
(
++
landmark_id_count_
),
landmark_id_
(
++
landmark_id_count_
),
type_id_
(
_tp
),
type_id_
(
_tp
),
status_
(
LANDMARK_CANDIDATE
)
//,
status_
(
LANDMARK_CANDIDATE
)
// p_ptr_(_p_ptr),
// o_ptr_(_o_ptr)
{
{
//
state_block_vec_
[
0
]
=
_p_ptr
;
state_block_vec_
[
0
]
=
_p_ptr
;
state_block_vec_
[
1
]
=
_o_ptr
;
state_block_vec_
[
1
]
=
_o_ptr
;
state_block_vec_
[
2
]
=
nullptr
;
state_block_vec_
[
2
]
=
nullptr
;
...
@@ -41,7 +38,6 @@ void LandmarkBase::remove()
...
@@ -41,7 +38,6 @@ void LandmarkBase::remove()
std
::
cout
<<
"Removing L"
<<
id
()
<<
std
::
endl
;
std
::
cout
<<
"Removing L"
<<
id
()
<<
std
::
endl
;
LandmarkBasePtr
this_L
=
shared_from_this
();
// keep this alive while removing it
LandmarkBasePtr
this_L
=
shared_from_this
();
// keep this alive while removing it
// remove from upstream
// remove from upstream
auto
M
=
map_ptr_
.
lock
();
auto
M
=
map_ptr_
.
lock
();
if
(
M
)
if
(
M
)
...
@@ -66,33 +62,47 @@ void LandmarkBase::setStatus(LandmarkStatus _st)
...
@@ -66,33 +62,47 @@ void LandmarkBase::setStatus(LandmarkStatus _st)
// State Blocks
// State Blocks
if
(
status_
==
LANDMARK_FIXED
)
if
(
status_
==
LANDMARK_FIXED
)
{
{
if
(
getPPtr
()
!=
nullptr
)
for
(
auto
sb
:
state_block_vec_
)
{
if
(
sb
!=
nullptr
)
getPPtr
()
->
fix
();
{
if
(
getProblem
()
!=
nullptr
)
sb
->
fix
();
getProblem
()
->
updateStateBlockPtr
(
getPPtr
());
if
(
getProblem
()
!=
nullptr
)
}
getProblem
()
->
updateStateBlockPtr
(
sb
);
if
(
getOPtr
()
!=
nullptr
)
}
{
// if (getPPtr()!=nullptr)
getOPtr
()
->
fix
();
// {
if
(
getProblem
()
!=
nullptr
)
// getPPtr()->fix();
getProblem
()
->
updateStateBlockPtr
(
getOPtr
());
// if (getProblem() != nullptr)
}
// getProblem()->updateStateBlockPtr(getPPtr());
// }
// if (getOPtr()!=nullptr)
// {
// getOPtr()->fix();
// if (getProblem() != nullptr)
// getProblem()->updateStateBlockPtr(getOPtr());
// }
}
}
else
if
(
status_
==
LANDMARK_ESTIMATED
)
else
if
(
status_
==
LANDMARK_ESTIMATED
)
{
{
if
(
getPPtr
()
!=
nullptr
)
for
(
auto
sb
:
state_block_vec_
)
{
if
(
sb
!=
nullptr
)
getPPtr
()
->
unfix
();
{
if
(
getProblem
()
!=
nullptr
)
sb
->
unfix
();
getProblem
()
->
updateStateBlockPtr
(
getPPtr
());
if
(
getProblem
()
!=
nullptr
)
}
getProblem
()
->
updateStateBlockPtr
(
sb
);
if
(
getOPtr
()
!=
nullptr
)
}
{
// if (getPPtr()!=nullptr)
getOPtr
()
->
unfix
();
// {
if
(
getProblem
()
!=
nullptr
)
// getPPtr()->unfix();
getProblem
()
->
updateStateBlockPtr
(
getOPtr
());
// if (getProblem() != nullptr)
}
// getProblem()->updateStateBlockPtr(getPPtr());
// }
// if (getOPtr()!=nullptr)
// {
// getOPtr()->unfix();
// if (getProblem() != nullptr)
// getProblem()->updateStateBlockPtr(getOPtr());
// }
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/landmark_base.h
+
0
−
4
View file @
3b23ce6a
...
@@ -39,8 +39,6 @@ class LandmarkBase : public NodeBase, public std::enable_shared_from_this<Landma
...
@@ -39,8 +39,6 @@ class LandmarkBase : public NodeBase, public std::enable_shared_from_this<Landma
LandmarkType
type_id_
;
///< type of landmark. (types defined at wolf.h)
LandmarkType
type_id_
;
///< type of landmark. (types defined at wolf.h)
LandmarkStatus
status_
;
///< status of the landmark. (types defined at wolf.h)
LandmarkStatus
status_
;
///< status of the landmark. (types defined at wolf.h)
TimeStamp
stamp_
;
///< stamp of the creation of the landmark (and stamp of destruction when status is LANDMARK_OLD)
TimeStamp
stamp_
;
///< stamp of the creation of the landmark (and stamp of destruction when status is LANDMARK_OLD)
// StateBlockPtr p_ptr_; ///< Position state block pointer
// StateBlockPtr o_ptr_; ///< Orientation state block pointer
Eigen
::
VectorXs
descriptor_
;
//TODO: agree? JS: No: It is not general enough as descriptor to be in LmkBase.
Eigen
::
VectorXs
descriptor_
;
//TODO: agree? JS: No: It is not general enough as descriptor to be in LmkBase.
public:
public:
...
@@ -149,13 +147,11 @@ inline void LandmarkBase::setId(unsigned int _id)
...
@@ -149,13 +147,11 @@ inline void LandmarkBase::setId(unsigned int _id)
inline
void
LandmarkBase
::
fix
()
inline
void
LandmarkBase
::
fix
()
{
{
//std::cout << "Fixing frame " << nodeId() << std::endl;
this
->
setStatus
(
LANDMARK_FIXED
);
this
->
setStatus
(
LANDMARK_FIXED
);
}
}
inline
void
LandmarkBase
::
unfix
()
inline
void
LandmarkBase
::
unfix
()
{
{
//std::cout << "Unfixing frame " << nodeId() << std::endl;
this
->
setStatus
(
LANDMARK_ESTIMATED
);
this
->
setStatus
(
LANDMARK_ESTIMATED
);
}
}
...
...
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