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
514b032a
Commit
514b032a
authored
10 years ago
by
Nicolas Mansard
Committed by
Valenza Florian
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Before refactoring.
parent
3b4b937e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/algorithm/crba.hpp
+20
-12
20 additions, 12 deletions
src/algorithm/crba.hpp
unittest/crba.cpp
+2
-2
2 additions, 2 deletions
unittest/crba.cpp
with
22 additions
and
14 deletions
src/algorithm/crba.hpp
+
20
−
12
View file @
514b032a
...
...
@@ -46,21 +46,26 @@ namespace se3
namespace
internal
{
/* Compute jF = jXi * iF, where jXi is the dual action matrix associated with m,
* and iF, jF are vectors. */
template
<
typename
D
,
typename
Dret
>
static
void
actVec
(
const
SE3
&
m
,
const
Eigen
::
MatrixBase
<
D
>
&
iF
,
Eigen
::
MatrixBase
<
Dret
>
&
jF
)
{
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(D,6);
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Dret,6);
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
D
);
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
Dret
);
Eigen
::
VectorBlock
<
const
D
,
3
>
linear
=
iF
.
template
head
<
3
>();
Eigen
::
VectorBlock
<
const
D
,
3
>
angular
=
iF
.
template
tail
<
3
>();
jF
.
template
head
<
3
>()
=
m
.
rotation
()
*
linear
;
jF
.
template
tail
<
3
>()
=
m
.
translation
().
cross
(
jF
.
template
head
<
3
>())
+
m
.
rotation
()
*
angular
;
jF
.
template
tail
<
3
>()
=
(
m
.
translation
().
cross
(
jF
.
template
head
<
3
>())
+
m
.
rotation
()
*
angular
);
}
/* Compute jF = jXi * iF, where jXi is the dual action matrix associated
* with m, and iF, jF are matrices whose columns are forces. The resolution
* is done column by column. */
template
<
typename
D
,
typename
Dret
>
static
void
act_alt
(
const
SE3
&
m
,
...
...
@@ -74,7 +79,10 @@ namespace se3
}
}
/* Compute jF = jXi * iF, where jXi is the dual action matrix associated
* with m, and iF, jF are matrices whose columns are forces. The resolution
* is done by block operation. It is less efficient than the colwise
* operation and should not be used. */
template
<
typename
D
,
typename
Dret
>
static
void
act
(
const
SE3
&
m
,
...
...
@@ -114,23 +122,23 @@ namespace se3
*/
const
int
&
i
=
jmodel
.
id
();
/* F[1:6,i] = Y*S */
data
.
Fcrb
[
i
].
block
<
6
,
JointModel
::
NV
>
(
0
,
jmodel
.
idx_v
())
=
data
.
Ycrb
[
i
]
*
jdata
.
S
();
/* M[i,SUBTREE] = S'*F[1:6,SUBTREE] */
data
.
M
.
block
(
jmodel
.
idx_v
(),
jmodel
.
idx_v
(),
jmodel
.
nv
(),
data
.
nvSubtree
[
i
])
=
jdata
.
S
().
transpose
()
*
data
.
Fcrb
[
i
].
block
(
0
,
jmodel
.
idx_v
(),
6
,
data
.
nvSubtree
[
i
]);
// std::cout << "*** joint " << i << std::endl;
// std::cout << "iFi = " << jdata.F() << std::endl;
const
Model
::
Index
&
parent
=
model
.
parents
[
i
];
if
(
parent
>
0
)
{
data
.
Ycrb
[
parent
]
+=
data
.
liMi
[
i
].
act
(
data
.
Ycrb
[
i
]);
/* Yli += liXi Yi */
data
.
Ycrb
[
parent
]
+=
data
.
liMi
[
i
].
act
(
data
.
Ycrb
[
i
]);
/* F[1:6,SUBTREE] = liXi F[1:6,SUBTREE] */
Eigen
::
Block
<
typename
Data
::
Matrix6x
>
jF
=
data
.
Fcrb
[
parent
].
block
(
0
,
jmodel
.
idx_v
(),
6
,
data
.
nvSubtree
[
i
]);
internal
::
act_alt
(
data
.
liMi
[
i
],
internal
::
act_alt
(
data
.
liMi
[
i
],
data
.
Fcrb
[
i
].
block
(
0
,
jmodel
.
idx_v
(),
6
,
data
.
nvSubtree
[
i
]),
jF
);
}
...
...
This diff is collapsed.
Click to expand it.
unittest/crba.cpp
+
2
−
2
View file @
514b032a
...
...
@@ -40,11 +40,11 @@ int main(int argc, const char ** argv)
VectorXd
q
=
VectorXd
::
Zero
(
model
.
nq
);
StackTicToc
timer
(
StackTicToc
::
US
);
timer
.
tic
();
SMOOTH
(
1000
)
SMOOTH
(
1000
*
100
)
{
crba
(
model
,
data
,
q
);
}
timer
.
toc
(
std
::
cout
,
1000
);
timer
.
toc
(
std
::
cout
,
1000
*
100
);
#ifndef NDEBUG
std
::
cout
<<
"Mcrb = [ "
<<
data
.
M
<<
" ];"
<<
std
::
endl
;
...
...
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