Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
example-robot-data
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
Gepetto
example-robot-data
Commits
850f6ec0
Commit
850f6ec0
authored
5 years ago
by
Guilhem Saurel
Browse files
Options
Downloads
Plain Diff
Merge branch 'devel' into 'devel'
switch to numpy arrays See merge request
!27
parents
e6db50ce
2c8caa12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
switch to numpy arrays
Pipeline
#7004
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/CMakeLists.txt
+3
-0
3 additions, 0 deletions
python/CMakeLists.txt
python/example_robot_data/path.py.in
+1
-0
1 addition, 0 deletions
python/example_robot_data/path.py.in
python/example_robot_data/robots_loader.py
+16
-6
16 additions, 6 deletions
python/example_robot_data/robots_loader.py
with
20 additions
and
6 deletions
python/CMakeLists.txt
+
3
−
0
View file @
850f6ec0
...
...
@@ -7,3 +7,6 @@ SET(${PROJECT_NAME}_PYTHON_FILES
FOREACH
(
python
${${
PROJECT_NAME
}
_PYTHON_FILES
}
)
PYTHON_INSTALL_ON_SITE
(
${
PY_NAME
}
${
python
}
)
ENDFOREACH
(
python
${${
PROJECT_NAME
}
_PYTHON_FILES
}
)
CONFIGURE_FILE
(
${
PY_NAME
}
/path.py.in
${
PY_NAME
}
/path.py
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PY_NAME
}
/path.py DESTINATION
"
${
PYTHON_SITELIB
}
/
${
PY_NAME
}
"
)
This diff is collapsed.
Click to expand it.
python/example_robot_data/path.py.in
0 → 100644
+
1
−
0
View file @
850f6ec0
EXAMPLE_ROBOT_DATA_MODEL_DIR = "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/robots"
This diff is collapsed.
Click to expand it.
python/example_robot_data/robots_loader.py
+
16
−
6
View file @
850f6ec0
...
...
@@ -2,20 +2,30 @@ 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
):
base
=
'
../../../share/example-robot-data/robots
'
main_dir
=
dirname
(
dirname
(
dirname
(
__file__
)))
for
path
in
[
join
(
dirname
(
main_dir
),
'
robots
'
),
join
(
main_dir
,
'
robots
'
)
]
+
[
join
(
p
,
base
.
strip
(
'
/
'
))
for
p
in
sys
.
path
]:
paths
=
[
join
(
dirname
(
dirname
(
dirname
(
dirname
(
__file__
)))),
'
robots
'
),
join
(
dirname
(
dirname
(
dirname
(
__file__
))),
'
robots
'
)
]
try
:
from
.path
import
EXAMPLE_ROBOT_DATA_MODEL_DIR
paths
.
append
(
EXAMPLE_ROBOT_DATA_MODEL_DIR
)
except
ImportError
:
pass
paths
+=
[
join
(
p
,
'
../../../share/example-robot-data/robots
'
)
for
p
in
sys
.
path
]
for
path
in
paths
:
if
exists
(
join
(
path
,
subpath
.
strip
(
'
/
'
))):
if
printmsg
:
print
(
"
using %s as modelPath
"
%
path
)
return
path
raise
IOError
(
'
%s not found
'
%
(
subpath
)
)
raise
IOError
(
'
%s not found
'
%
subpath
)
def
readParamsFromSrdf
(
robot
,
SRDF_PATH
,
verbose
,
has_rotor_parameters
=
True
,
referencePose
=
'
half_sitting
'
):
...
...
@@ -138,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
())
...
...
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