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
9b671e06
Commit
9b671e06
authored
7 years ago
by
Dinesh Atchuthan
Browse files
Options
Downloads
Patches
Plain Diff
create class constraint_block_absolute.h
parent
949b6597
No related branches found
No related tags found
1 merge request
!149
Constraint abs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/constraint_block_absolute.h
+72
-0
72 additions, 0 deletions
src/constraint_block_absolute.h
with
72 additions
and
0 deletions
src/constraint_block_absolute.h
0 → 100644
+
72
−
0
View file @
9b671e06
/**
* \file constraint_block_absolute.h
*
* Created on: Dec 15, 2017
* \author: AtDinesh
*/
#ifndef CONSTRAINT_BLOCK_ABSOLUTE_H_
#define CONSTRAINT_BLOCK_ABSOLUTE_H_
//Wolf includes
#include
"constraint_autodiff.h"
#include
"frame_base.h"
namespace
wolf
{
WOLF_PTR_TYPEDEFS
(
ConstraintBlockAbsolute
);
//class
class
ConstraintBlockAbsolute
:
public
ConstraintAutodiff
<
ConstraintBlockAbsolute
,
3
,
3
>
{
public:
ConstraintBlockAbsolute
(
StateBlockPtr
_sb_ptr
,
const
Eigen
::
VectorXs
&
_state
,
const
Eigen
::
MatrixXs
&
_cov
,
bool
_apply_loss_function
=
false
,
ConstraintStatus
_status
=
CTR_ACTIVE
)
:
ConstraintAutodiff
<
ConstraintBlockAbsolute
,
3
,
3
>
(
CTR_BLOCK_ABS
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
_apply_loss_function
,
_status
,
_sb_ptr
),
state_
(
_state
),
cov_
(
_cov
)
{
setType
(
"FIX SB"
);
}
virtual
~
ConstraintBlockAbsolute
()
=
default
;
template
<
typename
T
>
bool
operator
()(
const
T
*
const
_sb
,
T
*
_residuals
)
const
;
virtual
JacobianMethod
getJacobianMethod
()
const
override
{
return
JAC_AUTO
;
}
private
:
const
Eigen
::
VectorXs
state_
;
const
Eigen
::
MatrixXs
cov_
;
};
template
<
typename
T
>
inline
bool
ConstraintBlockAbsolute
::
operator
()(
const
T
*
const
_sb
,
T
*
_residuals
)
const
{
// states
Eigen
::
Matrix
<
T
,
3
,
1
>
sb
(
_sb
);
// measurements
Eigen
::
Vector3s
measured_state
(
state_
.
data
()
+
0
);
// error
Eigen
::
Matrix
<
T
,
3
,
1
>
er
;
er
=
measured_state
.
cast
<
T
>
()
-
sb
;
// residual
Eigen
::
Map
<
Eigen
::
Matrix
<
T
,
3
,
1
>>
res
(
_residuals
);
res
=
getFeaturePtr
()
->
getMeasurementSquareRootInformationUpper
().
cast
<
T
>
()
*
er
;
return
true
;
}
}
// namespace wolf
#endif
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