Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
076d0a34
Commit
076d0a34
authored
Feb 09, 2016
by
Valenza Florian
Browse files
[frame jacobian] Express jacobian in correct frame
parent
bf3e70a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/algorithm/operational-frames.hpp
View file @
076d0a34
...
...
@@ -119,13 +119,14 @@ inline void getFrameJacobian(const Model & model, const Data& data,
int
colRef
=
nv
(
model
.
joints
[
parent
])
+
idx_v
(
model
.
joints
[
parent
])
-
1
;
SE3
::
Vector3
lever
(
data
.
oMi
[
parent
].
rotation
()
*
(
model
.
operational_frames
[
frame_id
].
frame_placement
.
translation
()));
if
(
!
localFrame
)
getJacobian
<
localFrame
>
(
model
,
data
,
parent
,
J
);
for
(
int
j
=
colRef
;
j
>=
0
;
j
=
data
.
parents_fromRow
[(
Model
::
Index
)
j
])
{
if
(
!
localFrame
)
{
J
.
col
(
j
).
topRows
<
3
>
()
+
=
model
.
operational_frames
[
frame_id
].
frame_placement
.
inverse
().
translation
()
.
cross
(
J
.
col
(
j
).
bottomRows
<
3
>
());
J
.
col
(
j
).
topRows
<
3
>
()
-
=
lever
.
cross
(
J
.
col
(
j
).
bottomRows
<
3
>
());
}
else
{
...
...
unittest/operational-frames.cpp
View file @
076d0a34
...
...
@@ -85,13 +85,12 @@ BOOST_AUTO_TEST_CASE ( test_jacobian )
getFrameJacobian
<
false
>
(
model
,
data
,
idx
,
Jof
);
getJacobian
<
false
>
(
model
,
data
,
parent_idx
,
Joj
);
// expected = frame_placement.inverse().toActionMatrix() * expected;
Motion
nu_frame
(
Jof
*
q_dot
);
Motion
nu_joint
(
Joj
*
q_dot
);
Motion
nu_frame_from_nu_joint
(
nu_joint
);
nu_frame_from_nu_joint
.
linear
()
+
=
frame_placement
.
inverse
().
translation
().
cross
(
nu_joint
.
angular
());
nu_frame_from_nu_joint
.
linear
()
-
=
(
data
.
oMi
[
parent_idx
].
rotation
()
*
frame_placement
.
translation
()
)
.
cross
(
nu_joint
.
angular
());
BOOST_CHECK
(
nu_frame
.
toVector
().
isApprox
(
nu_frame_from_nu_joint
.
toVector
(),
1e-12
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment