4 from numpy.linalg
import pinv,norm
5 import pinocchio
as pin
6 import gepetto.corbaserver
12 Class Display: Example of a class implementing a client for the Gepetto-viewer server. The main 13 method of the class is 'place', that sets the position/rotation of a 3D visual object in a scene. 17 This function connect with the Gepetto-viewer server and open a window with the given name. 18 If the window already exists, it is kept in the current state. Otherwise, the newly-created 19 window is set up with a scene named 'world'. 24 self.
viewer=gepetto.corbaserver.Client()
26 print "Error while starting the viewer client. " 27 print "Check whether Gepetto-viewer is properly started" 32 windowID = self.
viewer.gui.getWindowID (windowName)
33 print "Warning: window '"+windowName+
"' already created." 34 print "The previously created objects will not be destroyed and do not have to be created again." 37 windowID = self.
viewer.gui.createWindow (windowName)
39 self.
viewer.gui.createScene(
"world")
40 self.
viewer.gui.addSceneToWindow(
"world",windowID)
45 def place(self,objName,M,refresh=True):
47 This function places (ie changes both translation and rotation) of the object 48 names "objName" in place given by the SE3 object "M". By default, immediately refresh 49 the layout. If multiple objects have to be placed at the same time, do the refresh 50 only at the end of the list. 52 self.
viewer.gui.applyConfiguration(objName,
53 pin.se3ToXYZQUATtuple(M))
54 if refresh: self.
viewer.gui.refresh()
def __init__(self, windowName="pinocchio")
def place(self, objName, M, refresh=True)