hpp-gepetto-viewer
4.9.0
Display of hpp robots and obstacles in gepetto-viewer
|
Simultaneous control of hppcorbaserver and gepetto-viewer-server. More...
Public Member Functions | |
def | __init__ (self, problemSolver, viewerClient=None, ghost=False, collisionURDF=False, displayName=None, displayArrows=False, displayCoM=False) |
Constructor. More... | |
def | createWindowAndScene (self, viewerClient, name) |
def | addCallback (self, cb) |
def | buildRobotBodies (self) |
def | addLandmark (self, linkname, size) |
Add a landmark. More... | |
def | displayPathMap (self, nameRoadmap, pathID, radiusSphere=0.03, sizeAxis=0.09, colorNode=[1, colorEdge=[1, joint=None) |
Display the part of the roadmap used by the solution path. More... | |
def | displayRoadmap (self, nameRoadmap, radiusSphere=0.01, sizeAxis=0.03, colorNode=[1.0, colorEdge=[0.85, joint=None) |
Display the roadmap created by problem.solve() More... | |
def | solveAndDisplay (self, nameRoadmap, numberIt, radiusSphere=0.01, sizeAxis=0.03, colorNode=[1.0, colorEdge=[0.85, joint=None) |
build the roadmap and diplay it during construction (delete existing roadmap if problem already solved ) More... | |
def | loadObstacleModel (self, filename, prefix, guiOnly=False) |
Load obstacles from a urdf file. More... | |
def | loadPolyhedronObstacleModel (self, name, filename, guiOnly=False) |
Load polyhedron from a 3D mesh file. More... | |
def | moveObstacle (self, name, position, guiOnly=False) |
Move Obstacle. More... | |
def | computeObjectPosition (self) |
Synchronize object positions in gepetto-viewer-server. More... | |
def | publishRobots (self) |
def | __call__ (self, args) |
def | startCapture (self, filename, extension) |
Start a screen capture. More... | |
def | stopCapture (self) |
Stop a screen capture. More... | |
def | captureFrame (self, filename) |
Save current scene to image. More... | |
def | toggleVisual (self, visual) |
def | drawRobotAABB (self) |
Static Public Attributes | |
string | sceneName = '0_scene_hpp_' |
Default scene name Useful when debugging for creating an instance with a client to an existing server. More... | |
bool | removeLightSources = True |
Whether light sources in collada files should be removed at loading. More... | |
Simultaneous control of hppcorbaserver and gepetto-viewer-server.
This class implements clients to both
Operation that need to be synchronized between hppcorbaserver internal model and graphical user interface should be implemented by this class.
def gepetto.viewer.Viewer.__init__ | ( | self, | |
problemSolver, | |||
viewerClient = None , |
|||
ghost = False , |
|||
collisionURDF = False , |
|||
displayName = None , |
|||
displayArrows = False , |
|||
displayCoM = False |
|||
) |
Constructor.
problemSolver | object of type ProblemSolver |
viewerClient | if not provided, a new client to gepetto-viewer-server is created. |
displayArrow | if True, the publish method will display 2 arrows representing the velocity (green) and acceleration (red) of the root. This parameter can only be used if the robot have at least 6 extraDOF storing the velocity and acceleration of the root. |
displayCoM | if True, the publish method will also display a small red sphere representing the position of the CoM for the published configuration. |
The robot loaded in hppcorbaserver is loaded into gepetto-viewer-server.
def gepetto.viewer.Viewer.__call__ | ( | self, | |
args | |||
) |
def gepetto.viewer.Viewer.addCallback | ( | self, | |
cb | |||
) |
cb | Callable object, whose argument is a robot configuration. |
def gepetto.viewer.Viewer.addLandmark | ( | self, | |
linkname, | |||
size | |||
) |
Add a landmark.
def gepetto.viewer.Viewer.buildRobotBodies | ( | self | ) |
def gepetto.viewer.Viewer.captureFrame | ( | self, | |
filename | |||
) |
Save current scene to image.
def gepetto.viewer.Viewer.computeObjectPosition | ( | self | ) |
Synchronize object positions in gepetto-viewer-server.
Get position of objects from hppcorbaserver and forward to gepetto-viewer-server.
def gepetto.viewer.Viewer.createWindowAndScene | ( | self, | |
viewerClient, | |||
name | |||
) |
def gepetto.viewer.Viewer.displayPathMap | ( | self, | |
nameRoadmap, | |||
pathID, | |||
radiusSphere = 0.03 , |
|||
sizeAxis = 0.09 , |
|||
colorNode = [1 , |
|||
colorEdge = [1 , |
|||
joint = None |
|||
) |
Display the part of the roadmap used by the solution path.
nameRoadmap | : the name of the osgNode added to the scene |
pathID | : the id of the path we want to display |
radiusSphere | : the radius of the node |
sizeAxis | : size of axes (proportionnaly to the radius of the sphere) 0 = only sphere |
colorNode | : the color of the sphere for the nodes (default value : red) |
colorEdge | : the color of the edges (default value : light red) |
joint | : the link we want to display the configuration (by defaut, root link of the robot) BE CAREFULL : in the .py file wich init the robot, you must define a valid tf_root (this is the displayed joint by default) notes : the edges are always straight lines and doesn't represent the real path beetwen the configurations of the nodes |
def gepetto.viewer.Viewer.displayRoadmap | ( | self, | |
nameRoadmap, | |||
radiusSphere = 0.01 , |
|||
sizeAxis = 0.03 , |
|||
colorNode = [1.0 , |
|||
colorEdge = [0.85 , |
|||
joint = None |
|||
) |
Display the roadmap created by problem.solve()
radiusSphere | : the radius of the node |
sizeAxis | : size of axes (proportionnaly to the radius of the sphere) 0 = only sphere |
colorNode | : the color of the sphere for the nodes (default value : white) |
colorEdge | : the color of the edges (default value : yellow) |
joint | : the link we want to display the configuration (by defaut, root link of the robot) BE CAREFULL : in the .py file wich init the robot, you must define a valid tf_root (this is the displayed joint by default) notes : the edges are always straight lines and doesn't represent the real path beetwen the configurations of the nodes |
def gepetto.viewer.Viewer.drawRobotAABB | ( | self | ) |
def gepetto.viewer.Viewer.loadObstacleModel | ( | self, | |
filename, | |||
prefix, | |||
guiOnly = False |
|||
) |
Load obstacles from a urdf file.
filename | name of the urdf file, may contain "package://" |
prefix | prefix added to object names in case the same file is loaded several times, |
guiOnly | whether to control only gepetto-viewer-server |
def gepetto.viewer.Viewer.loadPolyhedronObstacleModel | ( | self, | |
name, | |||
filename, | |||
guiOnly = False |
|||
) |
Load polyhedron from a 3D mesh file.
filename | name of the 3D mesh file, may contain "package://" |
name | name of the object, |
guiOnly | whether to control only gepetto-viewer-server |
def gepetto.viewer.Viewer.moveObstacle | ( | self, | |
name, | |||
position, | |||
guiOnly = False |
|||
) |
Move Obstacle.
name | Name of the object |
position | Position of the object as a 7-d vector (translation-quaternion) |
guiOnly | whether to control only gepetto-viewer-server |
def gepetto.viewer.Viewer.publishRobots | ( | self | ) |
def gepetto.viewer.Viewer.solveAndDisplay | ( | self, | |
nameRoadmap, | |||
numberIt, | |||
radiusSphere = 0.01 , |
|||
sizeAxis = 0.03 , |
|||
colorNode = [1.0 , |
|||
colorEdge = [0.85 , |
|||
joint = None |
|||
) |
build the roadmap and diplay it during construction (delete existing roadmap if problem already solved )
nameRoadmap | : name of the new roadmap |
numberIt | : number of iteration beetwen to refresh of the roadmap (be careful, if numberIt is too low it can crash gepetto-viewer-server) |
radiusSphere | : the radius of the node |
sizeAxis | : size of axes (proportionnaly to the radius of the sphere) 0 = only sphere |
colorNode | : the color of the sphere for the nodes (default value : white) |
colorEdge | : the color of the edges (default value : yellow) |
joint | : the link we want to display the configuration (by defaut, root link of the robot) |
def gepetto.viewer.Viewer.startCapture | ( | self, | |
filename, | |||
extension | |||
) |
Start a screen capture.
def gepetto.viewer.Viewer.stopCapture | ( | self | ) |
Stop a screen capture.
def gepetto.viewer.Viewer.toggleVisual | ( | self, | |
visual | |||
) |
gepetto.viewer.Viewer.amax |
gepetto.viewer.Viewer.arrowMaxSize |
gepetto.viewer.Viewer.arrowMinSize |
gepetto.viewer.Viewer.arrowRadius |
gepetto.viewer.Viewer.callbacks |
gepetto.viewer.Viewer.client |
gepetto.viewer.Viewer.collisionURDF |
gepetto.viewer.Viewer.color |
gepetto.viewer.Viewer.colorAcceleration |
gepetto.viewer.Viewer.colorVelocity |
gepetto.viewer.Viewer.displayArrows |
gepetto.viewer.Viewer.displayCoM |
gepetto.viewer.Viewer.displayName |
gepetto.viewer.Viewer.guiObjectNames |
gepetto.viewer.Viewer.hppObjectNames |
gepetto.viewer.Viewer.problemSolver |
|
static |
Whether light sources in collada files should be removed at loading.
gepetto.viewer.Viewer.robot |
gepetto.viewer.Viewer.robotBodies |
gepetto.viewer.Viewer.robotConfig |
|
static |
Default scene name Useful when debugging for creating an instance with a client to an existing server.
gepetto.viewer.Viewer.sceneName |
gepetto.viewer.Viewer.vmax |
gepetto.viewer.Viewer.windowId |
gepetto.viewer.Viewer.windowName |