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
89aa2278
Commit
89aa2278
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Move methods to cpp
parent
e2a19e78
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/frame_base.cpp
+78
-0
78 additions, 0 deletions
src/frame_base.cpp
src/frame_base.h
+0
-86
0 additions, 86 deletions
src/frame_base.h
with
78 additions
and
86 deletions
src/frame_base.cpp
+
78
−
0
View file @
89aa2278
...
...
@@ -138,6 +138,28 @@ void FrameBase::fix()
}
}
void
FrameBase
::
unfix
()
{
for
(
auto
sbp
:
state_block_vec_
)
if
(
sbp
!=
nullptr
)
{
sbp
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
bool
FrameBase
::
isFixed
()
const
{
bool
fixed
=
true
;
for
(
auto
sb
:
getStateBlockVec
())
{
if
(
sb
)
fixed
&=
sb
->
isFixed
();
}
return
fixed
;
}
void
FrameBase
::
setState
(
const
Eigen
::
VectorXs
&
_state
)
{
int
size
=
0
;
...
...
@@ -252,6 +274,62 @@ FrameBasePtr FrameBase::getNextFrame() const
return
nullptr
;
}
CaptureBasePtr
FrameBase
::
addCapture
(
CaptureBasePtr
_capt_ptr
)
{
capture_list_
.
push_back
(
_capt_ptr
);
_capt_ptr
->
setFramePtr
(
shared_from_this
());
_capt_ptr
->
setProblem
(
getProblem
());
return
_capt_ptr
;
}
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
&&
capture_ptr
->
getType
()
==
type
)
return
capture_ptr
;
return
nullptr
;
}
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
)
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
)
return
capture_ptr
;
return
nullptr
;
}
CaptureBaseList
FrameBase
::
getCapturesOf
(
const
SensorBasePtr
_sensor_ptr
)
{
CaptureBaseList
captures
;
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
)
captures
.
push_back
(
capture_ptr
);
return
captures
;
}
ConstraintBasePtr
FrameBase
::
getConstraintOf
(
const
ProcessorBasePtr
_processor_ptr
,
const
std
::
string
&
type
)
{
for
(
const
ConstraintBasePtr
&
constaint_ptr
:
getConstrainedByList
())
if
(
constaint_ptr
->
getProcessor
()
==
_processor_ptr
&&
constaint_ptr
->
getType
()
==
type
)
return
constaint_ptr
;
return
nullptr
;
}
ConstraintBasePtr
FrameBase
::
getConstraintOf
(
const
ProcessorBasePtr
_processor_ptr
)
{
for
(
const
ConstraintBasePtr
&
constaint_ptr
:
getConstrainedByList
())
if
(
constaint_ptr
->
getProcessor
()
==
_processor_ptr
)
return
constaint_ptr
;
return
nullptr
;
}
ConstraintBasePtr
FrameBase
::
addConstrainedBy
(
ConstraintBasePtr
_ctr_ptr
)
{
constrained_by_list_
.
push_back
(
_ctr_ptr
);
_ctr_ptr
->
setFrameOtherPtr
(
shared_from_this
());
return
_ctr_ptr
;
}
FrameBasePtr
FrameBase
::
create_PO_2D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
)
...
...
This diff is collapsed.
Click to expand it.
src/frame_base.h
+
0
−
86
View file @
89aa2278
...
...
@@ -167,28 +167,6 @@ inline bool FrameBase::isKey() const
return
(
type_
==
KEY_FRAME
);
}
inline
void
FrameBase
::
unfix
()
{
for
(
auto
sbp
:
state_block_vec_
)
if
(
sbp
!=
nullptr
)
{
sbp
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
inline
bool
FrameBase
::
isFixed
()
const
{
bool
fixed
=
true
;
for
(
auto
sb
:
getStateBlockVec
())
{
if
(
sb
)
fixed
&=
sb
->
isFixed
();
}
return
fixed
;
}
inline
void
FrameBase
::
setTimeStamp
(
const
TimeStamp
&
_ts
)
{
time_stamp_
=
_ts
;
...
...
@@ -266,88 +244,24 @@ inline CaptureBaseList& FrameBase::getCaptureList()
return
capture_list_
;
}
inline
CaptureBasePtr
FrameBase
::
addCapture
(
CaptureBasePtr
_capt_ptr
)
{
capture_list_
.
push_back
(
_capt_ptr
);
_capt_ptr
->
setFramePtr
(
shared_from_this
());
_capt_ptr
->
setProblem
(
getProblem
());
return
_capt_ptr
;
}
inline
void
FrameBase
::
resizeStateBlockVec
(
int
_size
)
{
if
(
_size
>
state_block_vec_
.
size
())
state_block_vec_
.
resize
(
_size
);
}
inline
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
)
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
)
return
capture_ptr
;
return
nullptr
;
}
inline
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
&&
capture_ptr
->
getType
()
==
type
)
return
capture_ptr
;
return
nullptr
;
}
inline
CaptureBaseList
FrameBase
::
getCapturesOf
(
const
SensorBasePtr
_sensor_ptr
)
{
CaptureBaseList
captures
;
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getSensorPtr
()
==
_sensor_ptr
)
captures
.
push_back
(
capture_ptr
);
return
captures
;
}
inline
void
FrameBase
::
unlinkCapture
(
CaptureBasePtr
_cap_ptr
)
{
_cap_ptr
->
unlinkFromFrame
();
capture_list_
.
remove
(
_cap_ptr
);
}
inline
ConstraintBasePtr
FrameBase
::
getConstraintOf
(
const
ProcessorBasePtr
_processor_ptr
)
{
for
(
const
ConstraintBasePtr
&
constaint_ptr
:
getConstrainedByList
())
if
(
constaint_ptr
->
getProcessor
()
==
_processor_ptr
)
return
constaint_ptr
;
return
nullptr
;
}
inline
ConstraintBasePtr
FrameBase
::
getConstraintOf
(
const
ProcessorBasePtr
_processor_ptr
,
const
std
::
string
&
type
)
{
for
(
const
ConstraintBasePtr
&
constaint_ptr
:
getConstrainedByList
())
if
(
constaint_ptr
->
getProcessor
()
==
_processor_ptr
&&
constaint_ptr
->
getType
()
==
type
)
return
constaint_ptr
;
return
nullptr
;
}
inline
void
FrameBase
::
getConstraintList
(
ConstraintBaseList
&
_ctr_list
)
{
for
(
auto
c_ptr
:
getCaptureList
())
c_ptr
->
getConstraintList
(
_ctr_list
);
}
inline
ConstraintBasePtr
FrameBase
::
addConstrainedBy
(
ConstraintBasePtr
_ctr_ptr
)
{
constrained_by_list_
.
push_back
(
_ctr_ptr
);
_ctr_ptr
->
setFrameOtherPtr
(
shared_from_this
()
);
return
_ctr_ptr
;
}
inline
unsigned
int
FrameBase
::
getHits
()
const
{
return
constrained_by_list_
.
size
();
...
...
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