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
1f913f34
Commit
1f913f34
authored
Nov 30, 2016
by
jcarpent
Browse files
[Algo] Fix computation of potential energy
parent
cf2babdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
bindings/python/algorithm/expose-energy.cpp
View file @
1f913f34
...
...
@@ -32,7 +32,7 @@ namespace se3
"Update kinematics (bool)"
),
"Computes the kinematic energy of the model for the "
"given joint configuration and velocity and stores the result "
"
in data.kinetic_energy. By default, the
kinematic
s of model
is
updated."
);
"in data.kinetic_energy. By default, the
first order kinematic quantitie
s of
the
model
are
updated."
);
bp
::
def
(
"potentialEnergy"
,
potentialEnergy
,
bp
::
args
(
"Model"
,
"Data"
,
...
...
@@ -40,7 +40,7 @@ namespace se3
"Update kinematics (bool)"
),
"Computes the potential energy of the model for the "
"given the joint configuration and stores the result "
"
in data.potential_energy. By default, the
kinematic
s of model
is
updated."
);
"in data.potential_energy. By default, the
first order kinematic quantitie
s of
the
model
are
updated."
);
}
}
// namespace python
...
...
src/algorithm/energy.hpp
View file @
1f913f34
...
...
@@ -99,7 +99,7 @@ namespace se3
for
(
Model
::
JointIndex
i
=
1
;
i
<
(
Model
::
JointIndex
)(
model
.
njoints
);
++
i
)
{
com_global
=
data
.
oMi
[
i
].
translation
()
+
data
.
oMi
[
i
].
rotation
()
*
model
.
inertias
[
i
].
lever
();
data
.
potential_energy
+
=
model
.
inertias
[
i
].
mass
()
*
com_global
.
dot
(
g
);
data
.
potential_energy
-
=
model
.
inertias
[
i
].
mass
()
*
com_global
.
dot
(
g
);
}
return
data
.
potential_energy
;
...
...
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