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
5125f088
Commit
5125f088
authored
6 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Add namespace SE2 and use it
parent
b5dd96d8
No related branches found
No related tags found
1 merge request
!311
Se2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/math/SE2.h
+14
-8
14 additions, 8 deletions
include/core/math/SE2.h
src/processor/processor_diff_drive.cpp
+1
-1
1 addition, 1 deletion
src/processor/processor_diff_drive.cpp
with
15 additions
and
9 deletions
include/core/math/SE2.h
+
14
−
8
View file @
5125f088
...
...
@@ -22,15 +22,20 @@
namespace
wolf
{
namespace
SO2
{
template
<
typename
T
>
Eigen
::
Matrix
<
T
,
2
,
2
>
exp
_SO2
(
const
T
theta
)
Eigen
::
Matrix
<
T
,
2
,
2
>
exp
(
const
T
theta
)
{
return
Eigen
::
Rotation2D
<
T
>
(
theta
).
matrix
();
}
}
// namespace SO2
namespace
SE2
{
template
<
typename
T
>
Eigen
::
Matrix2s
V_
SE2
(
const
T
theta
)
Eigen
::
Matrix2s
V_
helper
(
const
T
theta
)
{
T
s
;
// sin(theta) / theta
T
c_1
;
// (1-cos(theta)) / theta
...
...
@@ -52,13 +57,13 @@ Eigen::Matrix2s V_SE2(const T theta)
}
template
<
class
D1
,
class
D2
>
void
exp
_SE2
(
const
Eigen
::
MatrixBase
<
D1
>&
_tau
,
Eigen
::
MatrixBase
<
D2
>&
_delta
)
void
exp
(
const
Eigen
::
MatrixBase
<
D1
>&
_tau
,
Eigen
::
MatrixBase
<
D2
>&
_delta
)
{
MatrixSizeCheck
<
3
,
1
>::
check
(
_tau
);
MatrixSizeCheck
<
3
,
1
>::
check
(
_delta
);
// [1] eq. 156
_delta
.
head
(
2
)
=
V_
SE2
(
_tau
(
2
))
*
_tau
.
head
(
2
);
_delta
.
head
(
2
)
=
V_
helper
(
_tau
(
2
))
*
_tau
.
head
(
2
);
_delta
(
2
)
=
pi2pi
(
_tau
(
2
));
}
...
...
@@ -90,7 +95,7 @@ Eigen::Matrix<T, 2, 1> J_Vp_theta(const Eigen::MatrixBase<D>& p, const T theta)
}
template
<
class
D1
,
class
D2
,
class
D3
>
void
exp
_SE2
(
const
MatrixBase
<
D1
>&
_tau
,
MatrixBase
<
D2
>&
_delta
,
MatrixBase
<
D3
>&
_J_delta_tau
)
void
exp
(
const
MatrixBase
<
D1
>&
_tau
,
MatrixBase
<
D2
>&
_delta
,
MatrixBase
<
D3
>&
_J_delta_tau
)
{
MatrixSizeCheck
<
3
,
1
>::
check
(
_tau
);
MatrixSizeCheck
<
3
,
1
>::
check
(
_delta
);
...
...
@@ -100,17 +105,18 @@ void exp_SE2(const MatrixBase<D1>& _tau, MatrixBase<D2>& _delta, MatrixBase<D3>&
// [1] eq. 156
T
theta
=
pi2pi
(
_tau
(
2
));
Eigen
::
Matrix
<
T
,
2
,
2
>
V
=
V_
SE2
(
theta
);
Eigen
::
Matrix
<
T
,
2
,
2
>
V
=
V_
helper
(
theta
);
_delta
.
head
(
2
)
=
V
*
_tau
.
head
(
2
);
_delta
(
2
)
=
theta
;
// Jacobian is the composite definition [1] eq. 89, with jacobian blocks:
// J_Vp_p = V: see V_
SE2 below
, eq. 158
// J_Vp_theta: see fcn helper
below
// J_Vp_p = V: see V_
helper
, eq. 158
// J_Vp_theta: see fcn helper
// J_theta_theta = 1; eq. 126
_J_delta_tau
<<
V
,
J_Vp_theta
(
_tau
.
template
head
<
2
>(),
theta
),
0.0
,
0.0
,
1.0
;
}
}
// namespace SE2
}
// namespacs wolf
#endif
/* MATH_SE2_H_ */
This diff is collapsed.
Click to expand it.
src/processor/processor_diff_drive.cpp
+
1
−
1
View file @
5125f088
...
...
@@ -119,7 +119,7 @@ void ProcessorDiffDrive::computeCurrentDelta(const Eigen::VectorXs& _data,
Matrix3s
J_delta_tangent
;
exp_SE2
(
tangent
,
_delta
,
J_delta_tangent
);
SE2
::
exp
(
tangent
,
_delta
,
J_delta_tangent
);
/// 3. delta covariance -----------------------------------------------
...
...
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