From 99ff778b702daadc96100cd9f671943f201f73bf Mon Sep 17 00:00:00 2001 From: Valenza Florian <fvalenza@laas.fr> Date: Wed, 15 Jun 2016 15:18:54 +0200 Subject: [PATCH] [Python] Added example of loading and displaying romeo. --- python/display.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 python/display.py diff --git a/python/display.py b/python/display.py new file mode 100644 index 000000000..338cf55f5 --- /dev/null +++ b/python/display.py @@ -0,0 +1,25 @@ +import unittest +import pinocchio as se3 +import numpy as np + +from pinocchio.robot_wrapper import RobotWrapper + +# Warning : the paths are here hard-coded. This file is only here as an example +list_py = ["/local/fvalenza/devel/src/pinocchio/models","titi"] +robot = RobotWrapper("/local/fvalenza/devel/src/pinocchio/models/romeo.urdf",list_py, se3.JointModelFreeFlyer()) + +robot.initDisplay() +robot.loadDisplayModel("world/pinocchio") + +q0 = np.matrix([ + 0, 0, 0.840252, 0, 0, 0, 1, # Free flyer + 0, 0, -0.3490658, 0.6981317, -0.3490658, 0, # left leg + 0, 0, -0.3490658, 0.6981317, -0.3490658, 0, # right leg + 0, # chest + 1.5, 0.6, -0.5, -1.05, -0.4, -0.3, -0.2, # left arm + 0, 0, 0, 0, # head + 1.5, -0.6, 0.5, 1.05, -0.4, -0.3, -0.2, # right arm +]).T + +robot.display(q0) + -- GitLab