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
Gepetto
example-robot-data
Commits
9ce3cc47
Commit
9ce3cc47
authored
Apr 16, 2019
by
Carlos Mastalli
Browse files
[format] Fixed further errors in the code
parent
f031aa25
Changes
1
Hide whitespace changes
Inline
Side-by-side
unittest/unittest_utils.py
View file @
9ce3cc47
...
...
@@ -8,7 +8,7 @@ from pinocchio.robot_wrapper import RobotWrapper
def
getModelPath
(
subpath
):
for
path
in
[
'..'
,
'../..'
,
'/opt/openrobots/share/example-robot-data'
]:
if
exists
(
join
(
path
,
subpath
.
strip
(
'/'
))):
print
"using %s as modelPath"
%
path
print
(
"using %s as modelPath"
%
path
)
return
path
raise
IOError
(
'%s not found'
%
(
subpath
))
...
...
@@ -17,22 +17,9 @@ def readParamsFromSrdf(robot, SRDF_PATH, verbose):
rmodel
=
robot
.
model
pinocchio
.
loadRotorParameters
(
rmodel
,
SRDF_PATH
,
verbose
)
rmodel
.
armature
=
\
np
.
multiply
(
rmodel
.
rotorInertia
.
flat
,
np
.
square
(
rmodel
.
rotorGearRatio
.
flat
))
try
:
pinocchio
.
loadReferenceConfigurations
(
rmodel
,
SRDF_PATH
,
verbose
)
robot
.
q0
.
flat
[:]
=
\
rmodel
.
referenceConfigurations
[
"half_sitting"
].
copy
()
except
:
print
"loadReferenceConfigurations did not work. Please check your
\
Pinocchio Version"
try
:
pinocchio
.
getNeutralConfiguration
(
rmodel
,
SRDF_PATH
,
verbose
)
robot
.
q0
.
flat
[:]
=
rmodel
.
neutralConfiguration
.
copy
()
except
:
robot
.
q0
.
flat
[:]
=
pinocchio
.
neutral
(
rmodel
)
rmodel
.
armature
=
np
.
multiply
(
rmodel
.
rotorInertia
.
flat
,
np
.
square
(
rmodel
.
rotorGearRatio
.
flat
))
pinocchio
.
loadReferenceConfigurations
(
rmodel
,
SRDF_PATH
,
verbose
)
robot
.
q0
.
flat
[:]
=
rmodel
.
referenceConfigurations
[
"half_sitting"
].
copy
()
return
...
...
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