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
f117b641
Commit
f117b641
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
specialized addPrior functions
parent
7f529bea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!243
Constraint prior sensor params
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sensor_base.cpp
+1
-1
1 addition, 1 deletion
src/sensor_base.cpp
src/sensor_base.h
+99
-1
99 additions, 1 deletion
src/sensor_base.h
with
100 additions
and
2 deletions
src/sensor_base.cpp
+
1
−
1
View file @
f117b641
...
...
@@ -144,7 +144,7 @@ void SensorBase::unfixIntrinsics()
updateCalibSize
();
}
void
SensorBase
::
addParameterPrior
(
const
StateBlockPtr
&
_sb
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
void
SensorBase
::
add
Static
ParameterPrior
(
const
StateBlockPtr
&
_sb
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
bool
is_quaternion
=
(
std
::
dynamic_pointer_cast
<
StateQuaternion
>
(
_sb
)
!=
nullptr
);
...
...
This diff is collapsed.
Click to expand it.
src/sensor_base.h
+
99
−
1
View file @
f117b641
...
...
@@ -148,12 +148,56 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
* \param _size state segment size (-1: whole state) (not used in quaternions)
*
**/
void
addParameterPrior
(
const
StateBlockPtr
&
_sb
,
void
addParameterStaticPrior
(
const
StateBlockPtr
&
_sb
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addParameterDynamicPrior
(
const
CaptureBase
&
_cap
,
const
StateBlockPtr
&
_sb
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addParameterPrior
(
const
unsigned
int
_i
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addParameterPrior
(
const
unsigned
int
_i
,
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addPPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addOPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
);
void
addIntrinsicsPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addPPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
void
addOPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
);
void
addIntrinsicsPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
=
0
,
int
_size
=
-
1
);
SizeEigen
getCalibSize
()
const
;
Eigen
::
VectorXs
getCalibration
()
const
;
...
...
@@ -274,6 +318,60 @@ inline void SensorBase::setHardwarePtr(const HardwareBasePtr _hw_ptr)
hardware_ptr_
=
_hw_ptr
;
}
inline
void
SensorBase
::
addParameterPrior
(
const
unsigned
int
_i
,
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
CaptureBasePtr
cap
;
// i is dynamic? //TODO
if
(
isDynamic
(
_i
,
_ts
,
cap
))
addParameterDynamicPrior
(
cap
,
cap
->
getStateBlockPtr
(
_i
),
_x
,
_cov
,
_start_idx
,
_size
);
else
addParameterStaticPrior
(
getStateBlockPtrStatic
(
_i
),
_x
,
_cov
,
_start_idx
,
_size
);
}
inline
void
SensorBase
::
addParameterPrior
(
const
unsigned
int
_i
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
CaptureBasePtr
cap
;
// i is dynamic? //TODO
if
(
isDynamic
(
_i
,
cap
))
addParameterDynamicPrior
(
cap
,
cap
->
getStateBlockPtr
(
_i
),
_x
,
_cov
,
_start_idx
,
_size
);
else
addParameterStaticPrior
(
getStateBlockPtrStatic
(
_i
),
_x
,
_cov
,
_start_idx
,
_size
);
}
inline
void
SensorBase
::
addPPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
addParameterPrior
(
0
,
_ts
,
_x
,
_cov
,
_start_idx
,
_size
);
}
inline
void
SensorBase
::
addOPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
)
{
addParameterPrior
(
1
,
_ts
,
_x
,
_cov
);
}
inline
void
SensorBase
::
addIntrinsicsPrior
(
const
TimeStamp
_ts
,
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
addParameterPrior
(
2
,
_ts
,
_x
,
_cov
);
}
inline
void
SensorBase
::
addPPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
addParameterPrior
(
0
,
_x
,
_cov
,
_start_idx
,
_size
);
}
inline
void
SensorBase
::
addOPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
)
{
addParameterPrior
(
1
,
_x
,
_cov
);
}
inline
void
SensorBase
::
addIntrinsicsPrior
(
const
Eigen
::
VectorXs
&
_x
,
const
Eigen
::
MatrixXs
&
_cov
,
unsigned
int
_start_idx
,
int
_size
)
{
addParameterPrior
(
2
,
_x
,
_cov
);
}
inline
SizeEigen
SensorBase
::
getCalibSize
()
const
{
return
calib_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