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
48f66548
Verified
Commit
48f66548
authored
Apr 25, 2020
by
Gabriele Buondonno
Committed by
Justin Carpentier
May 12, 2020
Browse files
[bindings] Fix bindings for getFrameAcceleration
parent
f3345a2d
Changes
2
Show whitespace changes
Inline
Side-by-side
bindings/python/algorithm/expose-frames.cpp
View file @
48f66548
...
...
@@ -69,6 +69,7 @@ namespace pinocchio
}
BOOST_PYTHON_FUNCTION_OVERLOADS
(
getFrameVelocity_overload
,
(
&
getFrameVelocity
<
double
,
0
,
JointCollectionDefaultTpl
>
),
3
,
4
)
BOOST_PYTHON_FUNCTION_OVERLOADS
(
getFrameAcceleration_overload
,
(
&
getFrameAcceleration
<
double
,
0
,
JointCollectionDefaultTpl
>
),
3
,
4
)
void
exposeFramesAlgo
()
{
...
...
@@ -95,9 +96,10 @@ namespace pinocchio
bp
::
def
(
"getFrameAcceleration"
,
&
getFrameAcceleration
<
double
,
0
,
JointCollectionDefaultTpl
>
,
bp
::
args
(
"model"
,
"data"
,
"frame_id"
),
"Returns the spatial acceleration of the frame expressed in the coordinates system of the Frame itself.
\n
"
"forwardKinematics(model,data,q,v,a) should be called first to compute the joint spatial acceleration stored in data.a ."
);
getFrameAcceleration_overload
(
bp
::
args
(
"model"
,
"data"
,
"frame_id"
,
"reference_frame"
),
"Returns the spatial acceleration of the frame expressed in the coordinate system given by reference_frame.
\n
"
"forwardKinematics(model,data,q,v,a) should be called first to compute the joint spatial acceleration stored in data.a ."
));
bp
::
def
(
"framesForwardKinematics"
,
&
framesForwardKinematics
<
double
,
0
,
JointCollectionDefaultTpl
,
VectorXd
>
,
...
...
unittest/python/bindings_frame.py
View file @
48f66548
...
...
@@ -63,5 +63,14 @@ class TestFrameBindings(PinocchioTestCase):
v
=
pin
.
getFrameVelocity
(
self
.
model
,
data
,
self
.
frame_idx
,
pin
.
ReferenceFrame
.
LOCAL_WORLD_ALIGNED
)
self
.
assertApprox
(
v
,
pin
.
SE3
(
T
.
rotation
,
np
.
zeros
(
3
)).
act
(
self
.
frame_placement
.
actInv
(
data
.
v
[
self
.
parent_idx
])))
a
=
pin
.
getFrameAcceleration
(
self
.
model
,
data
,
self
.
frame_idx
)
self
.
assertApprox
(
a
,
self
.
frame_placement
.
actInv
(
data
.
a
[
self
.
parent_idx
]))
a
=
pin
.
getFrameAcceleration
(
self
.
model
,
data
,
self
.
frame_idx
,
pin
.
ReferenceFrame
.
LOCAL
)
self
.
assertApprox
(
a
,
self
.
frame_placement
.
actInv
(
data
.
a
[
self
.
parent_idx
]))
a
=
pin
.
getFrameAcceleration
(
self
.
model
,
data
,
self
.
frame_idx
,
pin
.
ReferenceFrame
.
WORLD
)
self
.
assertApprox
(
a
,
data
.
oMi
[
self
.
parent_idx
].
act
(
data
.
a
[
self
.
parent_idx
]))
a
=
pin
.
getFrameAcceleration
(
self
.
model
,
data
,
self
.
frame_idx
,
pin
.
ReferenceFrame
.
LOCAL_WORLD_ALIGNED
)
self
.
assertApprox
(
a
,
pin
.
SE3
(
T
.
rotation
,
np
.
zeros
(
3
)).
act
(
self
.
frame_placement
.
actInv
(
data
.
a
[
self
.
parent_idx
])))
if
__name__
==
'__main__'
:
unittest
.
main
()
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