gepetto.path_player.PathPlayer Class Reference

displays a path by sampling configurations along the path. More...

Inheritance diagram for gepetto.path_player.PathPlayer:
[legend]
Collaboration diagram for gepetto.path_player.PathPlayer:
[legend]

Public Member Functions

def __init__ (self, publisher, client=None, dt=0.01, speed=1)
 
def setDt (self, dt)
 
def setSpeed (self, speed)
 
def __call__ (self, pathId)
 
def displayPath (self, pathId, color=[0.85, jointName=0)
 Display the path of the desired joint By default, display the path of the root. More...
 
def displayVelocityPath (self, pathId, jointName=0)
 Display the path with a color variation according to the velocity along the path green for velocity close to 0, red for velocity close to the velocity bound. More...
 
def generatePlot (self, pathId, play=False, jointNames=None, cursor=False, filename=None)
 Generate a plot with the following datas: More...
 
def toFile (self, pathId, fname)
 
def toFileAppend (self, pathId, fname)
 
def getTrajFromFile (self, fname)
 
def fromFile (self, fname)
 

Public Attributes

 tau
 

Static Public Attributes

 client
 
 publisher
 
 dt
 
 speed
 
 start
 
 end
 

Detailed Description

displays a path by sampling configurations along the path.

Constructor & Destructor Documentation

def gepetto.path_player.PathPlayer.__init__ (   self,
  publisher,
  client = None,
  dt = 0.01,
  speed = 1 
)

Member Function Documentation

def gepetto.path_player.PathPlayer.__call__ (   self,
  pathId 
)
def gepetto.path_player.PathPlayer.displayPath (   self,
  pathId,
  color = [0.85,
  jointName = 0 
)

Display the path of the desired joint By default, display the path of the root.

References gepetto.path_player.PathPlayer.dt, gepetto.path_player.PathPlayer.end, and gepetto.path_player.PathPlayer.start.

def gepetto.path_player.PathPlayer.displayVelocityPath (   self,
  pathId,
  jointName = 0 
)

Display the path with a color variation according to the velocity along the path green for velocity close to 0, red for velocity close to the velocity bound.

This method assume that the path is represented by instances of the KinodynamicPath class

References gepetto.path_player.PathPlayer.dt, gepetto.path_player.PathPlayer.end, and gepetto.path_player.PathPlayer.start.

def gepetto.path_player.PathPlayer.fromFile (   self,
  fname 
)
def gepetto.path_player.PathPlayer.generatePlot (   self,
  pathId,
  play = False,
  jointNames = None,
  cursor = False,
  filename = None 
)

Generate a plot with the following datas:

  • abscissa: time.
  • ordinate: parameter values of the joint names.

If play is True, the path is played when the data to be plotted are generated.

If cursor is True, filename must be a string which will be formatted with one integer (frame index). For each frame, a cursor is drawn at the current time and the plot is written to the formatted filename.

If cursor is False, only one plot is generated. Then,

  • If filename is None, the plot is shown in a new window;
  • If filename is a string, the plot is written to filename.

References gepetto.path_player.PathPlayer.dt, gepetto.path_player.PathPlayer.end, gepetto.path_player.PathPlayer.speed, and gepetto.path_player.PathPlayer.start.

def gepetto.path_player.PathPlayer.getTrajFromFile (   self,
  fname 
)
def gepetto.path_player.PathPlayer.setDt (   self,
  dt 
)
def gepetto.path_player.PathPlayer.setSpeed (   self,
  speed 
)
def gepetto.path_player.PathPlayer.toFile (   self,
  pathId,
  fname 
)
def gepetto.path_player.PathPlayer.toFileAppend (   self,
  pathId,
  fname 
)

Member Data Documentation

gepetto.path_player.PathPlayer.client
static
gepetto.path_player.PathPlayer.publisher
static
gepetto.path_player.PathPlayer.tau