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
10035a10
Commit
10035a10
authored
Aug 26, 2019
by
Carlos Mastalli
Browse files
[script] Now the loader script works for any installation folder
parent
e1e57231
Pipeline
#5354
passed with stage
in 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
10035a10
...
...
@@ -4,12 +4,26 @@ INCLUDE(cmake/base.cmake)
INCLUDE
(
cmake/test.cmake
)
INCLUDE
(
cmake/python.cmake
)
# Set up project properties
SET
(
PROJECT_NAMESPACE gepetto
)
SET
(
PROJECT_NAME example-robot-data
)
SET
(
PROJECT_DESCRIPTION
"Set of robot URDFs for benchmarking and developed examples."
)
SET
(
PROJECT_URL https://gepgitlab.laas.fr/
${
PROJECT_NAMESPACE
}
/
${
PROJECT_NAME
}
)
# Print initial message
MESSAGE
(
"
${
PROJECT_DESCRIPTION
}
, version
${
PROJECT_VERSION
}
"
)
MESSAGE
(
"Copyright (C) 2018-2019 CNRS-LAAS"
)
MESSAGE
(
"All rights reserved."
)
MESSAGE
(
"Released under the BSD 3-Clause License."
)
# Set a default build type to 'Release' if none was specified
IF
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
MESSAGE
(
STATUS
"Setting build type to 'Release' as none was specified."
)
SET
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build."
FORCE
)
# Set the possible values of build type for cmake-gui
SET_PROPERTY
(
CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug"
"Release"
"MinSizeRel"
"RelWithDebInfo"
)
ENDIF
()
SETUP_PROJECT
()
ADD_REQUIRED_DEPENDENCY
(
"pinocchio >= 2.1.0"
)
...
...
python/robots_loader.py
View file @
10035a10
from
os.path
import
exists
,
join
import
sys
import
numpy
as
np
import
pinocchio
from
pinocchio.robot_wrapper
import
RobotWrapper
def
getModelPath
(
subpath
):
for
path
in
[
'..'
,
'../..'
,
'/opt/openrobots/share/example-robot-data'
]:
base
=
'../../../share/example-robot-data'
for
p
in
sys
.
path
:
path
=
join
(
p
,
base
.
strip
(
'/'
))
if
exists
(
join
(
path
,
subpath
.
strip
(
'/'
))):
print
(
"using %s as modelPath"
%
path
)
return
path
...
...
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