Skip to content
Snippets Groups Projects
Commit 08ab8ee2 authored by jcarpent's avatar jcarpent
Browse files

[Examples] Update python example

parent fb16012c
Branches
Tags
No related merge requests found
import pinocchio as pin
from pinocchio.romeo_wrapper import RomeoWrapper
DISPLAY = False
## Load Romeo with RomeoWrapper
import os
current_path = os.getcwd()
......@@ -8,8 +10,8 @@ current_path = os.getcwd()
# The model of Romeo is contained in the path PINOCCHIO_GIT_REPOSITORY/models/romeo
model_path = current_path + "/" + "../../models/romeo"
mesh_dir = model_path
urdf_filename = "romeo.urdf"
urdf_model_path = model_path + "/urdf/" + urdf_filename
urdf_filename = "romeo_small.urdf"
urdf_model_path = model_path + "/romeo_description/urdf/" + urdf_filename
robot = RomeoWrapper(urdf_model_path, [mesh_dir])
......@@ -22,3 +24,17 @@ q0 = robot.q0
com = robot.com(q0)
# This last command is similar to
com2 = pin.centerOfMass(model,data,q0)
## load model into gepetto-gui
if DISPLAY:
import gepetto.corbaserver
cl = gepetto.corbaserver.Client()
gui = cl.gui
if gui.nodeExists("world"):
gui.deleteNode("world","ON")
robot.initDisplay(loadModel=False)
robot.loadDisplayModel("pinocchio")
robot.display(robot.q0)
gui = robot.viewer.gui
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment