Commit 290f40d6 authored by Carlos Mastalli's avatar Carlos Mastalli

Merge branch 'devel' into 'devel'

[CMake] use PYTHON_INSTALL_ON_SITE

See merge request gepetto/example-robot-data!16
parents 230fe902 56827572
......@@ -33,7 +33,7 @@ IF(BUILD_PYTHON_INTERFACE)
ADD_REQUIRED_DEPENDENCY("pinocchio >= 2.1.0")
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_SUBDIRECTORY(${PY_NAME})
ADD_SUBDIRECTORY(python)
ADD_SUBDIRECTORY(unittest)
ENDIF(BUILD_PYTHON_INTERFACE)
......
......@@ -13,7 +13,11 @@ This repository includes a set of robot descriptions that are aimed to be used i
## <img align="center" height="20" src="https://i.imgur.com/x1morBF.png"/> Installation
You can install this package throught robotpkg. robotpkg is a package manager tailored for robotics softwares. It greatly simplifies the release of new versions along with the management of their dependencies. You just need to add the robotpkg apt repository to your sources.list and then use `sudo apt install robotpkg-example-robot-data` or `sudo apt install robotpkg-py27-example-robot-data` if you need the Python loaders:
You can install this package throught robotpkg. robotpkg is a package manager tailored for robotics softwares. It
greatly simplifies the release of new versions along with the management of their dependencies. You just need to add
the robotpkg apt repository to your sources.list and then use `sudo apt install robotpkg-example-robot-data` or `sudo
apt install robotpkg-py27-example-robot-data` (or `py3X` for python 3.X, depending on your system) if you need the
Python loaders.
### Add robotpkg apt repository
If you have never added robotpkg as a softwares repository, please follow first the instructions from 1 to 3. Otherwise, go directly to instruction 4. Those instructions are similar to the installation procedures presented in [http://robotpkg.openrobots.org/debian.html](http://robotpkg.openrobots.org/debian.html).
......@@ -43,3 +47,6 @@ If you have never added robotpkg as a softwares repository, please follow first
(you will need pinocchio and its Python bindings)
`python -m example_robot_data [anymal,hyq,solo,solo12,talos,talos_arm,talos_legs,tiago,tiago_no_hand,icub,ur5]`
This will work from the `python` subdirectory inside this repository, or if this package has been installed on your
system.
......@@ -5,6 +5,5 @@ SET(${PROJECT_NAME}_PYTHON_FILES
)
FOREACH(python ${${PROJECT_NAME}_PYTHON_FILES})
PYTHON_BUILD(. ${python})
INSTALL(FILES ${python} DESTINATION ${PYTHON_SITELIB}/${PY_NAME})
PYTHON_INSTALL_ON_SITE(${PY_NAME} ${python})
ENDFOREACH(python ${${PROJECT_NAME}_PYTHON_FILES})
# flake8: noqa
from .robots_loader import (getModelPath, loadANYmal, loadHyQ, loadICub, loadSolo, loadTalos, loadTalosArm,
loadTalosLegs, loadTiago, loadTiagoNoHand, loadUR, readParamsFromSrdf)
......@@ -2,7 +2,6 @@ import sys
from os.path import dirname, exists, join
import numpy as np
import pinocchio
from pinocchio.robot_wrapper import RobotWrapper
......@@ -15,7 +14,7 @@ def getModelPath(subpath, printmsg=False):
if printmsg:
print("using %s as modelPath" % path)
return path
for path in (dirname(dirname(dirname(__file__))), dirname(dirname(__file__))):
for path in (dirname(dirname(dirname(dirname(__file__)))), dirname(dirname(dirname(__file__)))):
if exists(join(path, subpath.strip('/'))):
if printmsg:
print("using %s as modelPath" % path)
......
[flake8]
max-line-length = 119
exclude = example_robot_data/__init__.py
[yapf]
column_limit = 119
[isort]
line_length = 119
......@@ -3,5 +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" python)
ENDFOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment