Commit 7ac82002 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

finish reorganization + doc

parent 8e47dd01
# Gepetto softwares integration tests
## gv_talos
## Robots
Checks py-pinocchio, py-qt-gepetto-viewer-corba & example-robot-data. One can
provide an alternative robotpkg installation prefix as a script argument.
Load a robot in a viewer, and put it in a standard posture.
## HPP
Run examples available on the hpp-benchmark package.
## RBPRM
Run examples available on the hpp-rbprm-corba package.
## HPP
Run examples available on the hpp-benchmark package.
## Dependencies
- [hpp-benchmark](https://github.com/humanoid-path-planner/hpp_benchmark)
- [hpp-tutorial](https://github.com/humanoid-path-planner/hpp-tutorial)
- [ros-baxter-common](https://github.com/RethinkRobotics/baxter_common)
- :warning: [iai-maps](https://github.com/TeamSPoon/iai_maps) :warning: This is not yet packaged on robotpkg :warning:
```
py=27
qt=4
sudo apt install -qqy robotpkg-py${py}-qt${qt}-hpp-benchmark robotpkg-ros-baxter-common robotpkg-hpp-tutorial
```
## Available options
Look at `./hpp.py -h` to see the list of available scenarii.
## Run
```
hppcorbaserver &
gepetto-gui &
./hpp.py
```
#!/usr/bin/env python2
from argparse import ArgumentParser
from pathlib import Path
from subprocess import Popen
SCENARII = [
'baxter-manipulation-boxes', 'construction-set', 'hrp2-on-the-ground', 'pr2-in-iai-kitchen',
'pr2-manipulation-kitchen', 'pr2-manipulation-two-hand', 'romeo-placard'
]
parser = ArgumentParser()
parser.add_argument('scenario', nargs='?', default=SCENARII[0], choices=SCENARII)
parser.add_argument('--robotpkg_prefix', default='/opt/openrobots')
def main(robotpkg_prefix, scenario):
script = Path(robotpkg_prefix) / 'share/hpp_benchmark' / scenario / 'script.py'
Popen(['python2', str(script), '-N', '1', '--display', '--run'])
if __name__ == '__main__':
main(**vars(parser.parse_args()))
#!/usr/bin/env python2
from pathlib import Path
from subprocess import Popen
from integration_utils import wrap_with_processes
DEPS = ['hpp-tutorial']
PATCHES = {
'baxter_manipulation_boxes': [
('N = 20', 'N = 1'),
('#v = vf.createViewer ()', 'v = vf.createViewer()'),
('#pp = PathPlayer (v)', 'pp = PathPlayer(v)'),
]
}
def baxter_manipulation_boxes(rbprm_path, **kwargs):
script = Path(rbprm_path) / 'hpp_benchmark/future' / 'baxter-manipulation-boxes' / 'script.py'
temp = '/tmp/gepetto-integrations-hpp-benchmarks.py'
with open(temp, 'w') as f_out:
with script.open() as f_in:
for line in f_in:
for before, after in PATCHES['baxter_manipulation_boxes']:
line = line.replace(before, after)
f_out.write(line)
f_out.write('pp(0)')
Popen(['python2', temp])
if __name__ == '__main__':
wrap_with_processes(['gepetto-gui', 'hppcorbaserver'], baxter_manipulation_boxes, DEPS)
from argparse import ArgumentParser
from subprocess import CalledProcessError, Popen, check_call
from time import sleep
parser = ArgumentParser()
parser.add_argument('--robotpkg_prefix', default='/opt/openrobots')
parser.add_argument('--python', default=27)
parser.add_argument('--qt', default=4)
parser.add_argument(
'--rbprm_path', default='/local/gsaurel/humanoid-path-planner', help='TODO this scripts should be installed')
parser.add_argument(
'--hpp_doc_path', default='/local/gsaurel/humanoid-path-planner', help='TODO this scripts should be packaged')
def wrap_with_processes(processes, f, deps):
kwargs = vars(parser.parse_args())
check_installed(deps, **kwargs)
try:
plist = [Popen(process) for process in processes]
sleep(2)
f(**kwargs)
print('Done. Press Enter to exit')
raw_input()
finally:
for process in plist:
process.terminate()
def check_installed(pkgs, python, qt, **kwargs):
for pkg_name in pkgs:
pkg = 'robotpkg-' + pkg_name
pkg = pkg.replace('py-', 'py%i-' % python)
pkg = pkg.replace('qt-', 'qt%i-' % qt)
try:
check_call(['dpkg', '-s', pkg])
except CalledProcessError:
print('please run: sudo apt install -qqy %s' % pkg)
## RBPRM
Run examples available on the hpp-rbprm-corba package.
## Dependencies
- [pinocchio](https://github.com/stack-of-tasks/pinocchio)
- [hpp-gepetto-viewer](https://github.com/humanoid-path-planner/hpp-gepetto-viewer)
- [hpp-rbprm-corba](https://github.com/humanoid-path-planner/hpp-rbprm-corba)
- [osg-dae](https://github.com/gepetto/osg-dae)
```
py=27
qt=4
sudo apt install -qqy robotpkg-py${py}-pinocchio robotpkg-py${py}-qt${qt}-hpp-gepetto-viewer robotpkg-osg-dae robotpkg-hpp-rbprm-corba
```
## Run
```
hpp-rbprm-server &
gepetto-gui &
./rbprm.py
```
#!/usr/bin/env python2
from argparse import ArgumentParser
from pathlib import Path
from subprocess import Popen
from integration_utils import wrap_with_processes
parser = ArgumentParser()
parser.add_argument(
'--rbprm_path', default='/local/gsaurel/humanoid-path-planner', help='TODO this scripts should be installed')
DEPS = ['py-qt-hpp-gepetto-viewer', 'hpp-rbprm-corba', 'osg-dae', 'py-pinocchio']
def main(rbprm_path, **kwargs):
def main(rbprm_path):
path = Path(rbprm_path) / 'hpp-rbprm-corba/script/scenarios/demos'
Popen(['python2', 'darpa_hyq.py'], cwd=str(path))
if __name__ == '__main__':
wrap_with_processes(['gepetto-gui', 'hpp-rbprm-server'], main, DEPS)
main(**vars(parser.parse_args()))
# Robots
Load a robot in a viewer, and put it in a standard posture.
## Dependencies
- [pinocchio](../../../stack-of-tasks/pinocchio)
- [gepetto-viewer-corba](../../../gepetto/gepetto-viewer-corba)
- [example-robot-data](../../../gepetto/example-robot-data)
```
py=27
qt=4
sudo apt install -qqy robotpkg-py${py}-pinocchio robotpkg-py${py}-qt${qt}-gepetto-viewer-corba robotpkg-example-robot-data
```
## Available options
Look at `./robots.py -h` to see the list of available robots.
## Run
```
gepetto-gui &
./robots.py
```
#!/usr/bin/env python2
from argparse import ArgumentParser
from pathlib import Path
import pinocchio as pin
from pinocchio.robot_wrapper import RobotWrapper
from integration_utils import wrap_with_processes
ROBOTS = {
'talos': 'talos_data/robots/talos_reduced.urdf',
'hyq': 'hyq_description/robots/hyq_no_sensors.urdf',
}
DEPS = ['py-pinocchio', 'py-qt-gepetto-viewer-corba', 'example-robot-data']
parser = ArgumentParser()
parser.add_argument('robot', nargs='?', default=ROBOTS.keys()[0], choices=ROBOTS.keys())
parser.add_argument('--robotpkg_prefix', default='/opt/openrobots')
def main(robotpkg_prefix, **kwargs):
def main(robotpkg_prefix, robot):
pkg = Path(robotpkg_prefix) / 'share/example-robot-data'
urdf = 'talos_data/robots/talos_reduced.urdf'
urdf = ROBOTS[robot]
robot = RobotWrapper.BuildFromURDF(str(pkg / urdf), [str(pkg)], pin.JointModelFreeFlyer())
robot.initDisplay()
robot.loadDisplayModel("pinocchio")
......@@ -20,4 +26,4 @@ def main(robotpkg_prefix, **kwargs):
if __name__ == '__main__':
wrap_with_processes(['gepetto-gui'], main, DEPS)
main(**vars(parser.parse_args()))
Supports Markdown
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