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
47022f5f
Verified
Commit
47022f5f
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
algo/centroidal: change the output of ccrba
parent
02887025
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/centroidal.hxx
+13
-15
13 additions, 15 deletions
src/algorithm/centroidal.hxx
unittest/centroidal.cpp
+2
-2
2 additions, 2 deletions
unittest/centroidal.cpp
with
15 additions
and
17 deletions
src/algorithm/centroidal.hxx
+
13
−
15
View file @
47022f5f
...
...
@@ -126,14 +126,12 @@ namespace pinocchio
const
JointIndex
&
i
=
jmodel
.
id
();
const
JointIndex
&
parent
=
model
.
parents
[
i
];
data
.
Ycrb
[
parent
]
+=
data
.
liMi
[
i
].
act
(
data
.
Ycrb
[
i
]);
jdata
.
U
()
=
data
.
Ycrb
[
i
]
*
jdata
.
S
();
ColsBlock
jF
=
jmodel
.
jointCols
(
data
.
Ag
);
// = data.Ag.middleCols(jmodel.idx_v(), jmodel.nv());
ColsBlock
J_cols
=
jmodel
.
jointCols
(
data
.
J
);
J_cols
=
data
.
oMi
[
i
].
act
(
jdata
.
S
());
forceSet
::
se3Action
(
data
.
oMi
[
i
],
jdata
.
U
(),
jF
);
ColsBlock
Ag_cols
=
jmodel
.
jointCols
(
data
.
Ag
);
motionSet
::
inertiaAction
(
data
.
oYcrb
[
i
],
J_cols
,
Ag_cols
);
data
.
oYcrb
[
parent
]
+=
data
.
oYcrb
[
i
];
}
};
// struct CcrbaBackwardStep
...
...
@@ -154,9 +152,9 @@ namespace pinocchio
typedef
typename
Model
::
JointIndex
JointIndex
;
forwardKinematics
(
model
,
data
,
q
);
data
.
Ycrb
[
0
].
setZero
();
data
.
o
Ycrb
[
0
].
setZero
();
for
(
JointIndex
i
=
1
;
i
<
(
JointIndex
)(
model
.
njoints
);
++
i
)
data
.
Ycrb
[
i
]
=
model
.
inertias
[
i
];
data
.
o
Ycrb
[
i
]
=
data
.
oMi
[
i
].
act
(
model
.
inertias
[
i
]
)
;
typedef
CcrbaBackwardStep
<
Scalar
,
Options
,
JointCollectionTpl
>
Pass2
;
for
(
JointIndex
i
=
(
JointIndex
)(
model
.
njoints
-
1
);
i
>
0
;
--
i
)
...
...
@@ -166,7 +164,7 @@ namespace pinocchio
}
// Express the centroidal map around the center of mass
data
.
com
[
0
]
=
data
.
Ycrb
[
0
].
lever
();
data
.
com
[
0
]
=
data
.
o
Ycrb
[
0
].
lever
();
typedef
Eigen
::
Block
<
typename
Data
::
Matrix6x
,
3
,
-
1
>
Block3x
;
const
Block3x
Ag_lin
=
data
.
Ag
.
template
middleRows
<
3
>(
Force
::
LINEAR
);
...
...
@@ -176,9 +174,9 @@ namespace pinocchio
data
.
hg
.
toVector
().
noalias
()
=
data
.
Ag
*
v
;
data
.
Ig
.
mass
()
=
data
.
Ycrb
[
0
].
mass
();
data
.
Ig
.
mass
()
=
data
.
o
Ycrb
[
0
].
mass
();
data
.
Ig
.
lever
().
setZero
();
data
.
Ig
.
inertia
()
=
data
.
Ycrb
[
0
].
inertia
();
data
.
Ig
.
inertia
()
=
data
.
o
Ycrb
[
0
].
inertia
();
return
data
.
Ag
;
}
...
...
@@ -197,9 +195,9 @@ namespace pinocchio
typedef
typename
Model
::
JointIndex
JointIndex
;
forwardKinematics
(
model
,
data
,
q
);
data
.
Ycrb
[
0
].
setZero
();
data
.
o
Ycrb
[
0
].
setZero
();
for
(
JointIndex
i
=
1
;
i
<
(
JointIndex
)(
model
.
njoints
);
++
i
)
data
.
Ycrb
[
i
]
=
model
.
inertias
[
i
];
data
.
o
Ycrb
[
i
]
=
data
.
oMi
[
i
].
act
(
model
.
inertias
[
i
]
)
;
typedef
CcrbaBackwardStep
<
Scalar
,
Options
,
JointCollectionTpl
>
Pass2
;
for
(
JointIndex
i
=
(
JointIndex
)(
model
.
njoints
-
1
);
i
>
0
;
--
i
)
...
...
@@ -209,7 +207,7 @@ namespace pinocchio
}
// Express the centroidal map around the center of mass
data
.
com
[
0
]
=
data
.
Ycrb
[
0
].
lever
();
data
.
com
[
0
]
=
data
.
o
Ycrb
[
0
].
lever
();
typedef
Eigen
::
Block
<
typename
Data
::
Matrix6x
,
3
,
-
1
>
Block3x
;
const
Block3x
Ag_lin
=
data
.
Ag
.
template
middleRows
<
3
>(
Force
::
LINEAR
);
...
...
This diff is collapsed.
Click to expand it.
unittest/centroidal.cpp
+
2
−
2
View file @
47022f5f
...
...
@@ -71,9 +71,9 @@ BOOST_AUTO_TEST_CASE (test_ccrba)
ccrba
(
model
,
data
,
q
,
v
);
BOOST_CHECK
(
data
.
com
[
0
].
isApprox
(
-
cMo
.
translation
(),
1e-12
));
BOOST_CHECK
(
data
.
Ycrb
[
0
].
matrix
().
isApprox
(
data_ref
.
Ycrb
[
0
].
matrix
(),
1e-12
));
BOOST_CHECK
(
data
.
o
Ycrb
[
0
].
matrix
().
isApprox
(
data_ref
.
Ycrb
[
0
].
matrix
(),
1e-12
));
pinocchio
::
Inertia
Ig_ref
(
cMo
.
act
(
data
.
Ycrb
[
0
]));
pinocchio
::
Inertia
Ig_ref
(
cMo
.
act
(
data
.
o
Ycrb
[
0
]));
BOOST_CHECK
(
data
.
Ig
.
matrix
().
isApprox
(
Ig_ref
.
matrix
(),
1e-12
));
pinocchio
::
SE3
oM1
(
data_ref
.
liMi
[
1
]);
...
...
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