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
4eb5d909
Commit
4eb5d909
authored
8 years ago
by
Joan Solà Ortega
Committed by
Joan Solà Ortega
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix state blocks of landmark
parent
6fd04e75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/landmark_base.cpp
+21
-21
21 additions, 21 deletions
src/landmark_base.cpp
src/landmark_base.h
+6
-6
6 additions, 6 deletions
src/landmark_base.h
with
27 additions
and
27 deletions
src/landmark_base.cpp
+
21
−
21
View file @
4eb5d909
...
@@ -15,9 +15,9 @@ LandmarkBase::LandmarkBase(const LandmarkType & _tp, const std::string& _type, S
...
@@ -15,9 +15,9 @@ 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
),
//
p_ptr_(_p_ptr),
o_ptr_
(
_o_ptr
)
//
o_ptr_(_o_ptr)
{
{
//
//
state_block_vec_
[
0
]
=
_p_ptr
;
state_block_vec_
[
0
]
=
_p_ptr
;
...
@@ -66,32 +66,32 @@ void LandmarkBase::setStatus(LandmarkStatus _st)
...
@@ -66,32 +66,32 @@ void LandmarkBase::setStatus(LandmarkStatus _st)
// State Blocks
// State Blocks
if
(
status_
==
LANDMARK_FIXED
)
if
(
status_
==
LANDMARK_FIXED
)
{
{
if
(
p_ptr_
!=
nullptr
)
if
(
getPPtr
()
!=
nullptr
)
{
{
p_ptr_
->
fix
();
getPPtr
()
->
fix
();
if
(
getProblem
()
!=
nullptr
)
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
p_ptr_
);
getProblem
()
->
updateStateBlockPtr
(
getPPtr
()
);
}
}
if
(
o_ptr_
!=
nullptr
)
if
(
getOPtr
()
!=
nullptr
)
{
{
o_ptr_
->
fix
();
getOPtr
()
->
fix
();
if
(
getProblem
()
!=
nullptr
)
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
o_ptr_
);
getProblem
()
->
updateStateBlockPtr
(
getOPtr
()
);
}
}
}
}
else
if
(
status_
==
LANDMARK_ESTIMATED
)
else
if
(
status_
==
LANDMARK_ESTIMATED
)
{
{
if
(
p_ptr_
!=
nullptr
)
if
(
getPPtr
()
!=
nullptr
)
{
{
p_ptr_
->
unfix
();
getPPtr
()
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
p_ptr_
);
getProblem
()
->
updateStateBlockPtr
(
getPPtr
()
);
}
}
if
(
o_ptr_
!=
nullptr
)
if
(
getOPtr
()
!=
nullptr
)
{
{
o_ptr_
->
unfix
();
getOPtr
()
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
o_ptr_
);
getProblem
()
->
updateStateBlockPtr
(
getOPtr
()
);
}
}
}
}
}
}
...
@@ -128,15 +128,15 @@ YAML::Node LandmarkBase::saveToYaml() const
...
@@ -128,15 +128,15 @@ YAML::Node LandmarkBase::saveToYaml() const
YAML
::
Node
node
;
YAML
::
Node
node
;
node
[
"id"
]
=
landmark_id_
;
node
[
"id"
]
=
landmark_id_
;
node
[
"type"
]
=
node_type_
;
node
[
"type"
]
=
node_type_
;
if
(
p_ptr_
!=
nullptr
)
if
(
getPPtr
()
!=
nullptr
)
{
{
node
[
"position"
]
=
p_ptr_
->
getVector
();
node
[
"position"
]
=
getPPtr
()
->
getVector
();
node
[
"position fixed"
]
=
p_ptr_
->
isFixed
();
node
[
"position fixed"
]
=
getPPtr
()
->
isFixed
();
}
}
if
(
o_ptr_
!=
nullptr
)
if
(
getOPtr
()
!=
nullptr
)
{
{
node
[
"orientation"
]
=
o_ptr_
->
getVector
();
node
[
"orientation"
]
=
getOPtr
()
->
getVector
();
node
[
"orientation fixed"
]
=
p_ptr_
->
isFixed
();
node
[
"orientation fixed"
]
=
getOPtr
()
->
isFixed
();
}
}
return
node
;
return
node
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/landmark_base.h
+
6
−
6
View file @
4eb5d909
...
@@ -39,8 +39,8 @@ class LandmarkBase : public NodeBase, public std::enable_shared_from_this<Landma
...
@@ -39,8 +39,8 @@ 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 p_ptr_; ///< Position state block pointer
StateBlockPtr
o_ptr_
;
///< Orientation 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:
...
@@ -207,22 +207,22 @@ inline void LandmarkBase::setStateBlockPtr(unsigned int _i, StateBlockPtr _sb_pt
...
@@ -207,22 +207,22 @@ inline void LandmarkBase::setStateBlockPtr(unsigned int _i, StateBlockPtr _sb_pt
inline
StateBlockPtr
LandmarkBase
::
getPPtr
()
const
inline
StateBlockPtr
LandmarkBase
::
getPPtr
()
const
{
{
return
p_ptr_
;
return
getStateBlockPtr
(
0
)
;
}
}
inline
StateBlockPtr
LandmarkBase
::
getOPtr
()
const
inline
StateBlockPtr
LandmarkBase
::
getOPtr
()
const
{
{
return
o_ptr_
;
return
getStateBlockPtr
(
1
)
;
}
}
inline
void
LandmarkBase
::
setPPtr
(
const
StateBlockPtr
_st_ptr
)
inline
void
LandmarkBase
::
setPPtr
(
const
StateBlockPtr
_st_ptr
)
{
{
p_ptr_
=
_st_ptr
;
setStateBlockPtr
(
0
,
_st_ptr
)
;
}
}
inline
void
LandmarkBase
::
setOPtr
(
const
StateBlockPtr
_st_ptr
)
inline
void
LandmarkBase
::
setOPtr
(
const
StateBlockPtr
_st_ptr
)
{
{
o_ptr_
=
_st_ptr
;
setStateBlockPtr
(
1
,
_st_ptr
)
;
}
}
inline
void
LandmarkBase
::
setDescriptor
(
const
Eigen
::
VectorXs
&
_descriptor
)
inline
void
LandmarkBase
::
setDescriptor
(
const
Eigen
::
VectorXs
&
_descriptor
)
...
...
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