Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gepetto.viewer.Viewer Class Reference

Simultaneous control of hppcorbaserver and gepetto-viewer-server. More...

Inheritance diagram for gepetto.viewer.Viewer:
[legend]
Collaboration diagram for gepetto.viewer.Viewer:
[legend]

Public Member Functions

def __init__ (self, problemSolver, viewerClient=None, collisionURDF=False, displayName=None)
 Constructor. More...
 
def createWindowAndScene (self, viewerClient, name)
 
def buildRobotBodies (self)
 
def addLandmark (self, linkname, size)
 Add a landmark. More...
 
def displayPathMap (self, nameRoadmap, pathID, radiusSphere, sizeAxis=1, colorNode=[1, colorEdge=[1, joint=0)
 Display the part of the roadmap used by the solution path. More...
 
def displayRoadmap (self, nameRoadmap, radiusSphere, sizeAxis=1, colorNode=[1.0, colorEdge=[0.85, joint=0)
 Display the roadmap created by problem.solve() More...
 
def solveAndDisplay (self, nameRoadmap, numberIt, radiusSphere, sizeAxis=1, colorNode=[1.0, colorEdge=[0.85, joint=0)
 build the roadmap and diplay it during construction (delete existing roadmap if problem already solved ) More...
 
def loadObstacleModel (self, package, filename, prefix, meshPackageName=None, guiOnly=False)
 Load obstacles from a urdf 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 toggleVisual (self, visual)
 
def drawRobotAABB (self)
 

Public Attributes

 problemSolver
 
 robot
 
 collisionURDF
 
 color
 
 client
 
 displayName
 
 windowName
 
 windowId
 
 sceneName
 
 robotBodies
 
 robotConfig
 

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def gepetto.viewer.Viewer.__init__ (   self,
  problemSolver,
  viewerClient = None,
  collisionURDF = False,
  displayName = None 
)

Constructor.

Parameters
problemSolverobject of type ProblemSolver
viewerClientif not provided, a new client to gepetto-viewer-server is created.

The robot loaded in hppcorbaserver is loaded into gepetto-viewer-server.

Member Function Documentation

◆ __call__()

def gepetto.viewer.Viewer.__call__ (   self,
  args 
)

◆ addLandmark()

def gepetto.viewer.Viewer.addLandmark (   self,
  linkname,
  size 
)

◆ buildRobotBodies()

def gepetto.viewer.Viewer.buildRobotBodies (   self)

◆ computeObjectPosition()

def gepetto.viewer.Viewer.computeObjectPosition (   self)

◆ createWindowAndScene()

def gepetto.viewer.Viewer.createWindowAndScene (   self,
  viewerClient,
  name 
)

◆ displayPathMap()

def gepetto.viewer.Viewer.displayPathMap (   self,
  nameRoadmap,
  pathID,
  radiusSphere,
  sizeAxis = 1,
  colorNode = [1,
  colorEdge = [1,
  joint = 0 
)

Display the part of the roadmap used by the solution path.

Parameters
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

References hpp::corbaserver::benchmark::Benchmark.client, hpp::corbaserver::robot::Robot.client, gui::matplotlib_example::Plugin.client, hpp::corbaserver::problem_solver::ProblemSolver.client, gui::blenderexport::Plugin.client, gui::pythonwidget::Plugin.client, gepetto.path_player.PathPlayer.client, gepetto.viewer.Viewer.client, gepetto.gui.path_graph.Plugin.client, gepetto.viewer.Viewer.problemSolver, hpp::corbaserver::benchmark::Benchmark.robot, hpp::corbaserver::problem_solver::ProblemSolver.robot, gepetto.viewer.Viewer.robot, and gepetto.viewer.Viewer.sceneName.

◆ displayRoadmap()

def gepetto.viewer.Viewer.displayRoadmap (   self,
  nameRoadmap,
  radiusSphere,
  sizeAxis = 1,
  colorNode = [1.0,
  colorEdge = [0.85,
  joint = 0 
)

Display the roadmap created by problem.solve()

Parameters
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

References hpp::corbaserver::benchmark::Benchmark.client, hpp::corbaserver::robot::Robot.client, gui::matplotlib_example::Plugin.client, hpp::corbaserver::problem_solver::ProblemSolver.client, gui::blenderexport::Plugin.client, gui::pythonwidget::Plugin.client, gepetto.path_player.PathPlayer.client, gepetto.viewer.Viewer.client, gepetto.gui.path_graph.Plugin.client, gepetto.viewer.Viewer.problemSolver, hpp::corbaserver::benchmark::Benchmark.robot, hpp::corbaserver::problem_solver::ProblemSolver.robot, gepetto.viewer.Viewer.robot, and gepetto.viewer.Viewer.sceneName.

Referenced by gepetto.viewer.Viewer.solveAndDisplay().

◆ drawRobotAABB()

def gepetto.viewer.Viewer.drawRobotAABB (   self)

◆ loadObstacleModel()

def gepetto.viewer.Viewer.loadObstacleModel (   self,
  package,
  filename,
  prefix,
  meshPackageName = None,
  guiOnly = False 
)

Load obstacles from a urdf file.

Parameters
packageros package containing the urdf file,
filenamename of the urdf file without extension,
prefixprefix added to object names in case the same file is loaded several times,
meshPackageNameros package containing the geometry files (collada, stl,...) if different from package
guiOnlywhether to control only gepetto-viewer-server

References hpp::corbaserver::benchmark::Benchmark.client, hpp::corbaserver::robot::Robot.client, gui::matplotlib_example::Plugin.client, hpp::corbaserver::problem_solver::ProblemSolver.client, gui::blenderexport::Plugin.client, gui::pythonwidget::Plugin.client, gepetto.path_player.PathPlayer.client, gepetto.viewer.Viewer.client, gepetto.gui.path_graph.Plugin.client, gepetto.viewer.Viewer.collisionURDF, gepetto.viewer.Viewer.computeObjectPosition(), gepetto.viewer.Viewer.problemSolver, and gepetto.viewer.Viewer.sceneName.

Referenced by gepetto.viewer.Viewer.solveAndDisplay().

◆ moveObstacle()

def gepetto.viewer.Viewer.moveObstacle (   self,
  name,
  position,
  guiOnly = False 
)

Move Obstacle.

Parameters
nameName of the object
positionPosition of the object as a 7-d vector (translation-quaternion)
guiOnlywhether to control only gepetto-viewer-server

References gepetto.viewer.Viewer.computeObjectPosition(), and gepetto.viewer.Viewer.problemSolver.

◆ publishRobots()

def gepetto.viewer.Viewer.publishRobots (   self)

◆ solveAndDisplay()

def gepetto.viewer.Viewer.solveAndDisplay (   self,
  nameRoadmap,
  numberIt,
  radiusSphere,
  sizeAxis = 1,
  colorNode = [1.0,
  colorEdge = [0.85,
  joint = 0 
)

build the roadmap and diplay it during construction (delete existing roadmap if problem already solved )

Parameters
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)

References hpp::corbaserver::benchmark::Benchmark.client, hpp::corbaserver::robot::Robot.client, gui::matplotlib_example::Plugin.client, hpp::corbaserver::problem_solver::ProblemSolver.client, gui::blenderexport::Plugin.client, gui::pythonwidget::Plugin.client, gepetto.path_player.PathPlayer.client, gepetto.viewer.Viewer.client, gepetto.gui.path_graph.Plugin.client, gepetto.viewer.Viewer.displayRoadmap(), gepetto.viewer.Viewer.loadObstacleModel(), gepetto.viewer.Viewer.problemSolver, hpp::corbaserver::problem_solver::ProblemSolver.robot, hpp::corbaserver::benchmark::Benchmark.robot, and gepetto.viewer.Viewer.robot.

◆ startCapture()

def gepetto.viewer.Viewer.startCapture (   self,
  filename,
  extension 
)

◆ stopCapture()

def gepetto.viewer.Viewer.stopCapture (   self)

◆ toggleVisual()

def gepetto.viewer.Viewer.toggleVisual (   self,
  visual 
)

Member Data Documentation

◆ client

gepetto.viewer.Viewer.client

◆ collisionURDF

gepetto.viewer.Viewer.collisionURDF

◆ color

gepetto.viewer.Viewer.color

◆ displayName

gepetto.viewer.Viewer.displayName

◆ problemSolver

gepetto.viewer.Viewer.problemSolver

◆ robot

gepetto.viewer.Viewer.robot

◆ robotBodies

gepetto.viewer.Viewer.robotBodies

◆ robotConfig

gepetto.viewer.Viewer.robotConfig

◆ sceneName [1/2]

string gepetto.viewer.Viewer.sceneName = '0_scene_hpp_'
static

◆ sceneName [2/2]

gepetto.viewer.Viewer.sceneName

◆ windowId

gepetto.viewer.Viewer.windowId

◆ windowName

gepetto.viewer.Viewer.windowName