Skip to content
GitLab
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
2c8caa12
Commit
2c8caa12
authored
Nov 26, 2019
by
Guilhem Saurel
Browse files
[Python] switch to numpy arrays
parent
556fee15
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/example_robot_data/robots_loader.py
View file @
2c8caa12
...
...
@@ -2,9 +2,12 @@ import sys
from
os.path
import
dirname
,
exists
,
join
import
numpy
as
np
import
pinocchio
from
pinocchio.robot_wrapper
import
RobotWrapper
pinocchio
.
switchToNumpyArray
()
def
getModelPath
(
subpath
,
printmsg
=
False
):
paths
=
[
...
...
@@ -145,7 +148,7 @@ def loadTalosLegs():
robot
.
visual_data
=
pinocchio
.
GeometryData
(
g2
)
# Load SRDF file
robot
.
q0
=
np
.
matrix
(
np
.
resize
(
robot
.
q0
,
robot
.
model
.
nq
)).
T
robot
.
q0
=
np
.
array
(
np
.
resize
(
robot
.
q0
,
robot
.
model
.
nq
)).
T
readParamsFromSrdf
(
robot
,
modelPath
+
SRDF_SUBPATH
,
False
)
assert
((
m2
.
armature
[:
6
]
==
0.
).
all
())
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment