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
598a8869
Commit
598a8869
authored
Aug 28, 2019
by
Guilhem Saurel
Browse files
[CMake] allow tests to be run before installation
parent
0629d81e
Changes
6
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
598a8869
...
...
@@ -10,6 +10,8 @@ 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
}
)
STRING
(
REGEX REPLACE
"-"
"_"
PY_NAME
${
PROJECT_NAME
}
)
# Print initial message
MESSAGE
(
"
${
PROJECT_DESCRIPTION
}
, version
${
PROJECT_VERSION
}
"
)
MESSAGE
(
"Copyright (C) 2018-2019 CNRS-LAAS"
)
...
...
@@ -35,7 +37,7 @@ INSTALL(DIRECTORY icub_description DESTINATION share/${PROJECT_NAME})
INSTALL
(
DIRECTORY talos_data DESTINATION share/
${
PROJECT_NAME
}
)
INSTALL
(
DIRECTORY tiago_description DESTINATION share/
${
PROJECT_NAME
}
)
ADD_SUBDIRECTORY
(
python
)
ADD_SUBDIRECTORY
(
${
PY_NAME
}
)
ADD_SUBDIRECTORY
(
unittest
)
SETUP_PROJECT_FINALIZE
()
python
/CMakeLists.txt
→
example_robot_data
/CMakeLists.txt
View file @
598a8869
...
...
@@ -6,5 +6,5 @@ SET(${PROJECT_NAME}_PYTHON_FILES
FOREACH
(
python
${${
PROJECT_NAME
}
_PYTHON_FILES
}
)
PYTHON_BUILD
(
.
${
python
}
)
INSTALL
(
FILES
${
python
}
DESTINATION
${
PYTHON_SITELIB
}
/
example_robot_data
)
INSTALL
(
FILES
${
python
}
DESTINATION
${
PYTHON_SITELIB
}
/
${
PY_NAME
}
)
ENDFOREACH
(
python
${${
PROJECT_NAME
}
_PYTHON_FILES
}
)
python
/__init__.py
→
example_robot_data
/__init__.py
View file @
598a8869
File moved
python
/display.py
→
example_robot_data
/display.py
View file @
598a8869
File moved
python
/robots_loader.py
→
example_robot_data
/robots_loader.py
View file @
598a8869
from
os.path
import
exists
,
join
import
sys
from
os.path
import
dirname
,
exists
,
join
import
numpy
as
np
import
pinocchio
from
pinocchio.robot_wrapper
import
RobotWrapper
...
...
@@ -13,6 +13,10 @@ def getModelPath(subpath):
if
exists
(
join
(
path
,
subpath
.
strip
(
'/'
))):
print
(
"using %s as modelPath"
%
path
)
return
path
for
path
in
(
dirname
(
dirname
(
dirname
(
__file__
))),
dirname
(
dirname
(
__file__
))):
if
exists
(
join
(
path
,
subpath
.
strip
(
'/'
))):
print
(
"using %s as modelPath"
%
path
)
return
path
raise
IOError
(
'%s not found'
%
(
subpath
))
...
...
unittest/CMakeLists.txt
View file @
598a8869
...
...
@@ -3,6 +3,5 @@ SET(${PROJECT_NAME}_PYTHON_TESTS
)
FOREACH
(
TEST
${${
PROJECT_NAME
}
_PYTHON_TESTS
}
)
ADD_PYTHON_UNIT_TEST
(
"py-
${
TEST
}
"
"unittest/test_
${
TEST
}
.py"
)
ADD_PYTHON_UNIT_TEST
(
"py-
${
TEST
}
"
"unittest/test_
${
TEST
}
.py"
.
)
ENDFOREACH
(
TEST
${${
PROJECT_NAME
}
_PYTHON_TESTS
}
)
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