Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
Stack Of Tasks
pinocchio
Commits
c7ef4157
Commit
c7ef4157
authored
7 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Spatial] Add action of Inertia on MotionSet
parent
366d3304
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/spatial/act-on-set.hpp
+58
-0
58 additions, 0 deletions
src/spatial/act-on-set.hpp
with
58 additions
and
0 deletions
src/spatial/act-on-set.hpp
+
58
−
0
View file @
c7ef4157
...
...
@@ -81,6 +81,15 @@ namespace se3
static
void
motionAction
(
const
MotionDense
<
MotionDerived
>
&
v
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iF
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jF
);
///
/// \brief Action of an Inertia matrix on a set of motions, represented by a 6xN matrix whose
/// columns represent a spatial motion.
///
template
<
typename
Scalar
,
int
Options
,
typename
Mat
,
typename
MatRet
>
static
void
inertiaAction
(
const
InertiaTpl
<
Scalar
,
Options
>
&
I
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iF
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jF
);
}
// namespace MotionSet
/* --- DETAILS --------------------------------------------------------- */
...
...
@@ -413,6 +422,47 @@ namespace se3
}
}
template
<
typename
Scalar
,
int
Options
,
typename
Mat
,
typename
MatRet
,
int
NCOLS
>
struct
MotionSetInertiaAction
{
/* Compute dV = v ^ V, where is the action operation associated
* with v, and V, dV are matrices whose columns are motions. */
static
void
run
(
const
InertiaTpl
<
Scalar
,
Options
>
&
I
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iV
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jV
);
};
template
<
typename
Scalar
,
int
Options
,
typename
Mat
,
typename
MatRet
,
int
NCOLS
>
void
MotionSetInertiaAction
<
Scalar
,
Options
,
Mat
,
MatRet
,
NCOLS
>::
run
(
const
InertiaTpl
<
Scalar
,
Options
>
&
I
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iV
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jV
)
{
for
(
int
col
=
0
;
col
<
jV
.
cols
();
++
col
)
{
typename
MatRet
::
ColXpr
jVc
=
const_cast
<
Eigen
::
MatrixBase
<
MatRet
>
&>
(
jV
).
col
(
col
);
motionSet
::
inertiaAction
(
I
,
iV
.
col
(
col
),
jVc
);
}
}
template
<
typename
Scalar
,
int
Options
,
typename
Mat
,
typename
MatRet
>
struct
MotionSetInertiaAction
<
Scalar
,
Options
,
Mat
,
MatRet
,
1
>
{
static
void
run
(
const
InertiaTpl
<
Scalar
,
Options
>
&
I
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iV
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jV
)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
Mat
);
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
MatRet
);
typedef
MotionRef
<
Mat
>
MotionRefOnMat
;
typedef
ForceRef
<
MatRet
>
ForceRefOnMatRet
;
ForceRefOnMatRet
fout
(
const_cast
<
Eigen
::
MatrixBase
<
MatRet
>
&>
(
jV
).
derived
());
I
.
__mult__
(
MotionRefOnMat
(
iV
.
derived
()),
fout
);
}
};
}
// namespace internal
...
...
@@ -442,6 +492,14 @@ namespace se3
{
internal
::
MotionSetMotionAction
<
MotionDerived
,
Mat
,
MatRet
,
Mat
::
ColsAtCompileTime
>::
run
(
v
,
iV
,
jV
);
}
template
<
typename
Scalar
,
int
Options
,
typename
Mat
,
typename
MatRet
>
static
void
inertiaAction
(
const
InertiaTpl
<
Scalar
,
Options
>
&
I
,
const
Eigen
::
MatrixBase
<
Mat
>
&
iV
,
Eigen
::
MatrixBase
<
MatRet
>
const
&
jV
)
{
internal
::
MotionSetInertiaAction
<
Scalar
,
Options
,
Mat
,
MatRet
,
Mat
::
ColsAtCompileTime
>::
run
(
I
,
iV
,
jV
);
}
}
// namespace motionSet
...
...
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