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
972815df
Commit
972815df
authored
5 years ago
by
Gabriele Buondonno
Committed by
Gabriele Buondonno
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[python] Fix deprecation of potentialEnergy and kineticEnergy
parent
e896e68f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/python/pinocchio/deprecated.py
+12
-30
12 additions, 30 deletions
bindings/python/pinocchio/deprecated.py
with
12 additions
and
30 deletions
bindings/python/pinocchio/deprecated.py
+
12
−
30
View file @
972815df
...
...
@@ -129,40 +129,22 @@ buildGeomFromUrdf.__doc__ = (
pin
.
buildGeomFromUrdf
.
__doc__
)
def
potentialEnergy
(
model
,
data
,
q
,
update_kinematics
=
None
):
if
update_kinematics
is
None
:
@deprecated
(
"
This function is now deprecated and will be removed in future releases of Pinocchio.
"
"
Please change for the new function computePotentialEnergy.
"
)
def
potentialEnergy
(
model
,
data
,
q
,
update_kinematics
=
True
):
if
update_kinematics
:
return
pin
.
computePotentialEnergy
(
model
,
data
,
q
)
else
:
if
update_kinematics
:
message
=
(
"
This function signature has been renamed and will be removed in future releases of Pinocchio.
"
"
Please change for the new signature computePotentialEnergy(model,data,q).
"
)
_warnings
.
warn
(
message
,
category
=
DeprecatedWarning
,
stacklevel
=
2
)
return
pin
.
computePotentialEnergy
(
model
,
data
,
q
)
else
:
message
=
(
"
This function signature has been renamed and will be removed in future releases of Pinocchio.
"
"
Please change for the new signature computePotentialEnergy(model,data).
"
)
_warnings
.
warn
(
message
,
category
=
DeprecatedWarning
,
stacklevel
=
2
)
return
pin
.
computePotentialEnergy
(
model
,
data
)
return
pin
.
computePotentialEnergy
(
model
,
data
)
potentialEnergy
.
__doc__
=
(
pin
.
computePotentialEnergy
.
__doc__
)
potentialEnergy
.
__doc__
+=
'
\n
'
+
pin
.
computePotentialEnergy
.
__doc__
def
kineticEnergy
(
model
,
data
,
q
,
v
,
update_kinematics
=
None
):
if
update_kinematics
is
None
:
@deprecated
(
"
This function is now deprecated and will be removed in future releases of Pinocchio.
"
"
Please change for the new function computeKineticEnergy.
"
)
def
kineticEnergy
(
model
,
data
,
q
,
v
,
update_kinematics
=
True
):
if
update_kinematics
:
return
pin
.
computeKineticEnergy
(
model
,
data
,
q
,
v
)
else
:
if
update_kinematics
:
message
=
(
"
This function signature has been renamed and will be removed in future releases of Pinocchio.
"
"
Please change for the new signature computeKineticEnergy(model,data,q,v).
"
)
_warnings
.
warn
(
message
,
category
=
DeprecatedWarning
,
stacklevel
=
2
)
return
pin
.
computeKineticEnergy
(
model
,
data
,
q
,
v
)
else
:
message
=
(
"
This function signature has been renamed and will be removed in future releases of Pinocchio.
"
"
Please change for the new signature computeKineticEnergy(model,data).
"
)
_warnings
.
warn
(
message
,
category
=
DeprecatedWarning
,
stacklevel
=
2
)
return
pin
.
computeKineticEnergy
(
model
,
data
)
return
pin
.
computeKineticEnergy
(
model
,
data
)
kineticEnergy
.
__doc__
=
(
pin
.
computeKineticEnergy
.
__doc__
)
kineticEnergy
.
__doc__
+=
'
\n
'
+
pin
.
computeKineticEnergy
.
__doc__
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