Commit 92d9e01e authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

gv_talos.py

parent 46332bd0
# Gepetto softwares integration tests
## gv_talos
Checks py-pinocchio, py-qt-gepetto-viewer-corba & example-robot-data. One can
provide an alternative robotpkg installation prefix as a script argument.
#!/usr/bin/env python2
from argparse import ArgumentParser
from pathlib import Path
from subprocess import Popen
import pinocchio as pin
from pinocchio.robot_wrapper import RobotWrapper
parser = ArgumentParser()
parser.add_argument('robotpkg_prefix', nargs='?', default='/opt/openrobots')
def main(robotpkg_prefix):
pkg = Path(robotpkg_prefix) / 'share/example-robot-data'
urdf = 'talos_data/robots/talos_reduced.urdf'
robot = RobotWrapper.BuildFromURDF(str(pkg / urdf), [str(pkg)], pin.JointModelFreeFlyer())
robot.initDisplay()
robot.loadDisplayModel("pinocchio")
robot.display(robot.q0)
if __name__ == '__main__':
gepetto_gui = Popen('gepetto-gui')
try:
main(**vars(parser.parse_args()))
finally:
gepetto_gui.terminate()
print('Done. Press Enter to exit')
raw_input()
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