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
ad791020
Verified
Commit
ad791020
authored
6 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
bindings/python: correct bindings of contact dynamics
parent
0339723e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/python/algorithm/expose-contact-dynamics.cpp
+25
-11
25 additions, 11 deletions
bindings/python/algorithm/expose-contact-dynamics.cpp
with
25 additions
and
11 deletions
bindings/python/algorithm/expose-contact-dynamics.cpp
+
25
−
11
View file @
ad791020
...
...
@@ -10,17 +10,30 @@ namespace pinocchio
namespace
python
{
BOOST_PYTHON_FUNCTION_OVERLOADS
(
forwardDynamics_overloads
,
forwardDynamics
,
7
,
9
)
static
const
Eigen
::
VectorXd
forwardDynamics_proxy
(
const
Model
&
model
,
Data
&
data
,
const
Eigen
::
VectorXd
&
q
,
const
Eigen
::
VectorXd
&
v
,
const
Eigen
::
VectorXd
&
tau
,
const
Eigen
::
MatrixXd
&
J
,
const
Eigen
::
VectorXd
&
gamma
,
const
double
inv_damping
=
0.0
,
const
bool
updateKinematics
=
true
)
{
return
forwardDynamics
(
model
,
data
,
q
,
v
,
tau
,
J
,
gamma
,
inv_damping
,
updateKinematics
);
}
BOOST_PYTHON_FUNCTION_OVERLOADS
(
forwardDynamics_overloads
,
forwardDynamics_proxy
,
7
,
9
)
// TODO: overloading impulseDynamics directly, as done for forwardDynamics, was apparently not working (it crashed for 5 arguments)
// Therefore, it was necessary to resort to a proxy
static
const
Eigen
::
VectorXd
&
impulseDynamics_proxy
(
const
Model
&
model
,
Data
&
data
,
const
Eigen
::
VectorXd
&
q
,
const
Eigen
::
VectorXd
&
v_before
,
const
Eigen
::
MatrixXd
&
J
,
const
double
r_coeff
=
0.0
,
const
bool
updateKinematics
=
true
)
static
const
Eigen
::
VectorXd
impulseDynamics_proxy
(
const
Model
&
model
,
Data
&
data
,
const
Eigen
::
VectorXd
&
q
,
const
Eigen
::
VectorXd
&
v_before
,
const
Eigen
::
MatrixXd
&
J
,
const
double
r_coeff
=
0.0
,
const
bool
updateKinematics
=
true
)
{
return
impulseDynamics
(
model
,
data
,
q
,
v_before
,
J
,
r_coeff
,
updateKinematics
);
}
...
...
@@ -42,7 +55,7 @@ namespace pinocchio
using
namespace
Eigen
;
bp
::
def
(
"forwardDynamics"
,
&
forwardDynamics
<
double
,
0
,
JointCollectionDefaultTpl
,
VectorXd
,
VectorXd
,
VectorXd
,
MatrixXd
,
VectorXd
>
,
&
forwardDynamics
_proxy
,
forwardDynamics_overloads
(
bp
::
args
(
"Model"
,
"Data"
,
"Joint configuration q (size Model::nq)"
,
...
...
@@ -53,7 +66,7 @@ namespace pinocchio
"(double) Damping factor for cholesky decomposition of JMinvJt. Set to zero if constraints are full rank."
,
"Update kinematics (if true, it updates the dynamic variable according to the current state)"
),
"Solves the forward dynamics problem with contacts, puts the result in Data::ddq and return it. The contact forces are stored in data.lambda_c"
)
[
bp
::
return_value_policy
<
bp
::
return_by_value
>
()]
);
));
bp
::
def
(
"impulseDynamics"
,
&
impulseDynamics_proxy
,
...
...
@@ -65,7 +78,8 @@ namespace pinocchio
"Coefficient of restitution r_coeff (0 = rigid impact; 1 = fully elastic impact)"
,
"Update kinematics (if true, it updates only the joint space inertia matrix)"
),
"Solve the impact dynamics problem with contacts, put the result in Data::dq_after and return it. The contact impulses are stored in data.impulse_c"
)[
bp
::
return_value_policy
<
bp
::
return_by_value
>
()]);
));
bp
::
def
(
"getKKTContactDynamicMatrixInverse"
,
getKKTContactDynamicMatrixInverse_proxy
,
bp
::
args
(
"Model"
,
"Data"
,
"Contact Jacobian J(size nb_constraint * Model::nv)"
),
...
...
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