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
9be1e9d5
Commit
9be1e9d5
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
removed frame factory
parent
c4f664b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!274
Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/frame/frame_base.h
+11
-10
11 additions, 10 deletions
include/core/frame/frame_base.h
src/frame/frame_base.cpp
+48
-42
48 additions, 42 deletions
src/frame/frame_base.cpp
with
59 additions
and
52 deletions
include/core/frame/frame_base.h
+
11
−
10
View file @
9be1e9d5
...
@@ -155,18 +155,19 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
...
@@ -155,18 +155,19 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
CaptureBasePtr
addCapture
(
CaptureBasePtr
_capt_ptr
);
CaptureBasePtr
addCapture
(
CaptureBasePtr
_capt_ptr
);
void
removeCapture
(
CaptureBasePtr
_capt_ptr
);
void
removeCapture
(
CaptureBasePtr
_capt_ptr
);
void
setTrajectory
(
TrajectoryBasePtr
_trj_ptr
);
void
setTrajectory
(
TrajectoryBasePtr
_trj_ptr
);
public:
static
FrameBasePtr
create_PO_2D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
=
Eigen
::
VectorXs
::
Zero
(
3
));
static
FrameBasePtr
create_PO_3D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
=
Eigen
::
VectorXs
::
Zero
(
7
));
static
FrameBasePtr
create_POV_3D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
=
Eigen
::
VectorXs
::
Zero
(
10
));
virtual
FactorBasePtr
addConstrainedBy
(
FactorBasePtr
_fac_ptr
);
virtual
FactorBasePtr
addConstrainedBy
(
FactorBasePtr
_fac_ptr
);
virtual
void
removeConstrainedBy
(
FactorBasePtr
_fac_ptr
);
virtual
void
removeConstrainedBy
(
FactorBasePtr
_fac_ptr
);
// public:
// static FrameBasePtr create_PO_2D (const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x = Eigen::VectorXs::Zero(3));
// static FrameBasePtr create_PO_3D (const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x = Eigen::VectorXs::Zero(7));
// static FrameBasePtr create_POV_3D(const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x = Eigen::VectorXs::Zero(10));
};
};
}
// namespace wolf
}
// namespace wolf
...
...
This diff is collapsed.
Click to expand it.
src/frame/frame_base.cpp
+
48
−
42
View file @
9be1e9d5
...
@@ -386,42 +386,6 @@ void FrameBase::removeConstrainedBy(FactorBasePtr _fac_ptr)
...
@@ -386,42 +386,6 @@ void FrameBase::removeConstrainedBy(FactorBasePtr _fac_ptr)
constrained_by_list_
.
remove
(
_fac_ptr
);
constrained_by_list_
.
remove
(
_fac_ptr
);
}
}
FrameBasePtr
FrameBase
::
create_PO_2D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
)
{
assert
(
_x
.
size
()
==
3
&&
"Wrong state vector size. Should be 3 for 2D!"
);
StateBlockPtr
p_ptr
(
std
::
make_shared
<
StateBlock
>
(
_x
.
head
<
2
>
(
)
)
);
StateBlockPtr
o_ptr
(
std
::
make_shared
<
StateAngle
>
((
Scalar
)
_x
(
2
)
)
);
StateBlockPtr
v_ptr
(
nullptr
);
FrameBasePtr
f
(
std
::
make_shared
<
FrameBase
>
(
_tp
,
_ts
,
p_ptr
,
o_ptr
,
v_ptr
)
);
f
->
setType
(
"PO 2D"
);
return
f
;
}
FrameBasePtr
FrameBase
::
create_PO_3D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
)
{
assert
(
_x
.
size
()
==
7
&&
"Wrong state vector size. Should be 7 for 3D!"
);
StateBlockPtr
p_ptr
(
std
::
make_shared
<
StateBlock
>
(
_x
.
head
<
3
>
(
)
)
);
StateBlockPtr
o_ptr
(
std
::
make_shared
<
StateQuaternion
>
(
_x
.
tail
<
4
>
(
)
)
);
StateBlockPtr
v_ptr
(
nullptr
);
FrameBasePtr
f
(
std
::
make_shared
<
FrameBase
>
(
_tp
,
_ts
,
p_ptr
,
o_ptr
,
v_ptr
)
);
f
->
setType
(
"PO 3D"
);
return
f
;
}
FrameBasePtr
FrameBase
::
create_POV_3D
(
const
FrameType
&
_tp
,
const
TimeStamp
&
_ts
,
const
Eigen
::
VectorXs
&
_x
)
{
assert
(
_x
.
size
()
==
10
&&
"Wrong state vector size. Should be 10 for 3D!"
);
StateBlockPtr
p_ptr
(
std
::
make_shared
<
StateBlock
>
(
_x
.
head
<
3
>
(
)
)
);
StateBlockPtr
o_ptr
(
std
::
make_shared
<
StateQuaternion
>
(
_x
.
segment
<
4
>
(
3
)
)
);
StateBlockPtr
v_ptr
(
std
::
make_shared
<
StateBlock
>
(
_x
.
tail
<
3
>
(
)
)
);
FrameBasePtr
f
(
std
::
make_shared
<
FrameBase
>
(
_tp
,
_ts
,
p_ptr
,
o_ptr
,
v_ptr
)
);
f
->
setType
(
"POV 3D"
);
return
f
;
}
void
FrameBase
::
link
(
TrajectoryBasePtr
_ptr
)
void
FrameBase
::
link
(
TrajectoryBasePtr
_ptr
)
{
{
if
(
_ptr
)
if
(
_ptr
)
...
@@ -436,14 +400,8 @@ void FrameBase::link(TrajectoryBasePtr _ptr)
...
@@ -436,14 +400,8 @@ void FrameBase::link(TrajectoryBasePtr _ptr)
WOLF_WARN
(
"Linking with a nullptr"
);
WOLF_WARN
(
"Linking with a nullptr"
);
}
}
}
}
}
// namespace wolf
#include
"core/common/factory.h"
namespace
wolf
{
{
namespace
{
const
bool
WOLF_UNUSED
Frame_PO_2D_Registered
=
FrameFactory
::
get
().
registerCreator
(
"PO 2D"
,
FrameBase
::
create_PO_2D
);
}
namespace
{
const
bool
WOLF_UNUSED
Frame_PO_3D_Registered
=
FrameFactory
::
get
().
registerCreator
(
"PO 3D"
,
FrameBase
::
create_PO_3D
);
}
namespace
{
const
bool
WOLF_UNUSED
Frame_POV_3D_Registered
=
FrameFactory
::
get
().
registerCreator
(
"POV 3D"
,
FrameBase
::
create_POV_3D
);
}
void
FrameBase
::
setProblem
(
ProblemPtr
_problem
)
void
FrameBase
::
setProblem
(
ProblemPtr
_problem
)
{
{
if
(
_problem
==
nullptr
||
_problem
==
this
->
getProblem
())
if
(
_problem
==
nullptr
||
_problem
==
this
->
getProblem
())
...
@@ -456,4 +414,52 @@ void FrameBase::setProblem(ProblemPtr _problem)
...
@@ -456,4 +414,52 @@ void FrameBase::setProblem(ProblemPtr _problem)
for
(
auto
cap
:
capture_list_
)
for
(
auto
cap
:
capture_list_
)
cap
->
setProblem
(
_problem
);
cap
->
setProblem
(
_problem
);
}
}
//FrameBasePtr FrameBase::create_PO_2D(const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x)
//{
// assert(_x.size() == 3 && "Wrong state vector size. Should be 3 for 2D!");
// StateBlockPtr p_ptr ( std::make_shared<StateBlock> (_x.head <2> ( ) ) );
// StateBlockPtr o_ptr ( std::make_shared<StateAngle> ((Scalar) _x(2) ) );
// StateBlockPtr v_ptr ( nullptr );
// FrameBasePtr f ( std::make_shared<FrameBase>(_tp, _ts, p_ptr, o_ptr, v_ptr) );
// f->setType("PO 2D");
// return f;
//}
//
//FrameBasePtr FrameBase::create_PO_3D(const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x)
//{
// assert(_x.size() == 7 && "Wrong state vector size. Should be 7 for 3D!");
// StateBlockPtr p_ptr ( std::make_shared<StateBlock> (_x.head <3> ( ) ) );
// StateBlockPtr o_ptr ( std::make_shared<StateQuaternion> (_x.tail <4> ( ) ) );
// StateBlockPtr v_ptr ( nullptr );
// FrameBasePtr f ( std::make_shared<FrameBase>(_tp, _ts, p_ptr, o_ptr, v_ptr) );
// f->setType("PO 3D");
// return f;
//}
//
//FrameBasePtr FrameBase::create_POV_3D(const FrameType & _tp,
// const TimeStamp& _ts,
// const Eigen::VectorXs& _x)
//{
// assert(_x.size() == 10 && "Wrong state vector size. Should be 10 for 3D!");
// StateBlockPtr p_ptr ( std::make_shared<StateBlock> (_x.head <3> ( ) ) );
// StateBlockPtr o_ptr ( std::make_shared<StateQuaternion> (_x.segment <4> (3) ) );
// StateBlockPtr v_ptr ( std::make_shared<StateBlock> (_x.tail <3> ( ) ) );
// FrameBasePtr f ( std::make_shared<FrameBase>(_tp, _ts, p_ptr, o_ptr, v_ptr) );
// f->setType("POV 3D");
// return f;
//}
}
// namespace wolf
}
// namespace wolf
//#include "core/common/factory.h"
//namespace wolf
//{
//namespace{ const bool WOLF_UNUSED Frame_PO_2D_Registered = FrameFactory::get().registerCreator("PO 2D", FrameBase::create_PO_2D ); }
//namespace{ const bool WOLF_UNUSED Frame_PO_3D_Registered = FrameFactory::get().registerCreator("PO 3D", FrameBase::create_PO_3D ); }
//namespace{ const bool WOLF_UNUSED Frame_POV_3D_Registered = FrameFactory::get().registerCreator("POV 3D", FrameBase::create_POV_3D); }
//} // namespace wolf
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