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
b40df3a6
Commit
b40df3a6
authored
4 years ago
by
Guilhem Saurel
Browse files
Options
Downloads
Patches
Plain Diff
[Python] add more paths to getModelPath, fix #37
and document their purpose
parent
a00409a3
No related branches found
No related tags found
No related merge requests found
Pipeline
#10445
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
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
+7
-5
7 additions, 5 deletions
python/example_robot_data/robots_loader.py
with
8 additions
and
5 deletions
python/example_robot_data/path.py.in
+
1
−
0
View file @
b40df3a6
EXAMPLE_ROBOT_DATA_MODEL_DIR = "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/robots"
EXAMPLE_ROBOT_DATA_MODEL_DIR = "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/robots"
EXAMPLE_ROBOT_DATA_SOURCE_DIR = "${PROJECT_SOURCE_DIR}/robots"
This diff is collapsed.
Click to expand it.
python/example_robot_data/robots_loader.py
+
7
−
5
View file @
b40df3a6
...
@@ -3,7 +3,6 @@ import warnings
...
@@ -3,7 +3,6 @@ import warnings
from
os.path
import
dirname
,
exists
,
join
from
os.path
import
dirname
,
exists
,
join
import
numpy
as
np
import
numpy
as
np
import
pinocchio
as
pin
import
pinocchio
as
pin
from
pinocchio.robot_wrapper
import
RobotWrapper
from
pinocchio.robot_wrapper
import
RobotWrapper
...
@@ -11,13 +10,16 @@ pin.switchToNumpyArray()
...
@@ -11,13 +10,16 @@ pin.switchToNumpyArray()
def
getModelPath
(
subpath
,
printmsg
=
False
):
def
getModelPath
(
subpath
,
printmsg
=
False
):
source
=
dirname
(
dirname
(
dirname
(
__file__
)))
# top level source directory
paths
=
[
paths
=
[
join
(
dirname
(
dirname
(
dirname
(
dirname
(
__file__
)))),
'
robots
'
),
join
(
dirname
(
dirname
(
dirname
(
source
))),
'
robots
'
),
# function called from "make release" in build/ dir
join
(
dirname
(
dirname
(
dirname
(
__file__
))),
'
robots
'
)
join
(
dirname
(
source
),
'
robots
'
),
# function called from a build/ dir inside top level source
join
(
source
,
'
robots
'
)
# function called from top level source dir
]
]
try
:
try
:
from
.path
import
EXAMPLE_ROBOT_DATA_MODEL_DIR
from
.path
import
EXAMPLE_ROBOT_DATA_MODEL_DIR
,
EXAMPLE_ROBOT_DATA_SOURCE_DIR
paths
.
append
(
EXAMPLE_ROBOT_DATA_MODEL_DIR
)
paths
.
append
(
EXAMPLE_ROBOT_DATA_MODEL_DIR
)
# function called from installed project
paths
.
append
(
EXAMPLE_ROBOT_DATA_SOURCE_DIR
)
# function called from off-tree build dir
except
ImportError
:
except
ImportError
:
pass
pass
paths
+=
[
join
(
p
,
'
../../../share/example-robot-data/robots
'
)
for
p
in
sys
.
path
]
paths
+=
[
join
(
p
,
'
../../../share/example-robot-data/robots
'
)
for
p
in
sys
.
path
]
...
...
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