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
94928397
Commit
94928397
authored
7 years ago
by
Dinesh Atchuthan
Browse files
Options
Downloads
Patches
Plain Diff
added constraint_quaternion_absolute
parent
bacdc779
No related branches found
No related tags found
1 merge request
!149
Constraint abs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
src/CMakeLists.txt
src/constraint_quaternion_absolute.h
+66
-0
66 additions, 0 deletions
src/constraint_quaternion_absolute.h
with
67 additions
and
0 deletions
src/CMakeLists.txt
+
1
−
0
View file @
94928397
...
...
@@ -253,6 +253,7 @@ SET(HDRS
constraint_odom_3D.h
constraint_point_2D.h
constraint_point_to_line_2D.h
constraint_quaternion_absolute.h
constraint_relative_2D_analytic.h
feature_corner_2D.h
feature_gps_fix.h
...
...
This diff is collapsed.
Click to expand it.
src/constraint_quaternion_absolute.h
0 → 100644
+
66
−
0
View file @
94928397
/**
* \file constraint_quaternion_absolute.h
*
* Created on: Dec 15, 2017
* \author: AtDinesh
*/
#ifndef CONSTRAINT_QUATERNION_ABSOLUTE_H_
#define CONSTRAINT_QUATERNION_ABSOLUTE_H_
//Wolf includes
#include
"constraint_autodiff.h"
#include
"frame_base.h"
namespace
wolf
{
WOLF_PTR_TYPEDEFS
(
ConstraintQuaternionAbsolute
);
//class
class
ConstraintQuaternionAbsolute
:
public
ConstraintAutodiff
<
ConstraintQuaternionAbsolute
,
3
,
4
>
{
public:
ConstraintQuaternionAbsolute
(
StateBlockPtr
_sb_ptr
,
bool
_apply_loss_function
=
false
,
ConstraintStatus
_status
=
CTR_ACTIVE
)
:
ConstraintAutodiff
<
ConstraintQuaternionAbsolute
,
3
,
4
>
(
CTR_BLOCK_ABS
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
_apply_loss_function
,
_status
,
_sb_ptr
)
{
setType
(
"FIX Q"
);
}
virtual
~
ConstraintQuaternionAbsolute
()
=
default
;
template
<
typename
T
>
bool
operator
()(
const
T
*
const
_o
,
T
*
_residuals
)
const
;
virtual
JacobianMethod
getJacobianMethod
()
const
override
{
return
JAC_AUTO
;
}
};
template
<
typename
T
>
inline
bool
ConstraintQuaternionAbsolute
::
operator
()(
const
T
*
const
_o
,
T
*
_residuals
)
const
{
// states
Eigen
::
Quaternion
<
T
>
q
(
_o
);
// measurements
Eigen
::
Quaternions
q_measured
(
getMeasurement
().
data
()
+
0
);
// error
Eigen
::
Matrix
<
T
,
3
,
1
>
er
;
er
=
q2v
(
q
.
conjugate
()
*
q_measured
.
cast
<
T
>
());
// 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.
Dinesh Atchuthan
@AtDinesh
mentioned in issue
#147 (closed)
·
7 years ago
mentioned in issue
#147 (closed)
mentioned in issue #147
Toggle commit list
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