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
a4ec68e9
Verified
Commit
a4ec68e9
authored
Nov 14, 2019
by
Justin Carpentier
Browse files
python/algo: add dDifference
parent
9b2e8fc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
bindings/python/algorithm/expose-joints.cpp
View file @
a4ec68e9
...
...
@@ -47,6 +47,31 @@ namespace pinocchio
return
J
;
}
bp
::
tuple
dDifference_proxy
(
const
Model
&
model
,
const
Eigen
::
VectorXd
&
q1
,
const
Eigen
::
VectorXd
&
q2
)
{
Eigen
::
MatrixXd
J0
(
Eigen
::
MatrixXd
::
Zero
(
model
.
nv
,
model
.
nv
));
Eigen
::
MatrixXd
J1
(
Eigen
::
MatrixXd
::
Zero
(
model
.
nv
,
model
.
nv
));
dDifference
(
model
,
q1
,
q2
,
J0
,
ARG0
);
dDifference
(
model
,
q1
,
q2
,
J1
,
ARG1
);
return
bp
::
make_tuple
(
J0
,
J1
);
}
Eigen
::
MatrixXd
dDifference_arg_proxy
(
const
Model
&
model
,
const
Eigen
::
VectorXd
&
q1
,
const
Eigen
::
VectorXd
&
q2
,
const
ArgumentPosition
arg
)
{
Eigen
::
MatrixXd
J
(
Eigen
::
MatrixXd
::
Zero
(
model
.
nv
,
model
.
nv
));
dDifference
(
model
,
q1
,
q2
,
J
,
arg
);
return
J
;
}
void
exposeJointsAlgo
()
{
...
...
@@ -113,6 +138,23 @@ namespace pinocchio
"Configuration q1 (size model.nq)"
,
"Configuration q2 (size model.nq)"
),
"Distance between two configurations."
);
bp
::
def
(
"dDifference"
,
&
dDifference_proxy
,
bp
::
args
(
"Model"
,
"Configuration q1 (size model.nq)"
,
"Configuration q2 (size model.nq)"
),
"Computes the partial derivatives of the difference function with respect to the first "
"and the second argument, and returns the two Jacobians as a tuple. "
);
bp
::
def
(
"dDifference"
,
&
dDifference_arg_proxy
,
bp
::
args
(
"Model"
,
"Configuration q1 (size model.nq)"
,
"Configuration q2 (size model.nq)"
,
"arg (either ARG0 or ARG1)"
),
"Computes the partial derivatives of the difference function with respect to the first (arg == ARG0) "
"or the second argument (arg == ARG1). "
);
bp
::
def
(
"randomConfiguration"
,
&
randomConfiguration_proxy
,
...
...
Write
Preview
Markdown
is supported
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