parameters: (self,q,name="ghost",robot=0)
docstring: Sets the configuration of the ghost to q.  If the ghost is named, place its name
          in prefixname.
docstring_summary: Sets the configuration of the ghost to q.  If the ghost is named, place its name
          in prefixname.
docstring_tokens: Sets the configuration of the ghost to q . If the ghost is named place its name in prefixname .
function: def setGhostConfig(self,q,name="ghost",robot=0):
          """Sets the configuration of the ghost to q.  If the ghost is named, place its name
          in prefixname."""
          if robot < 0 or robot >= self.world.numRobots():
              raise ValueError("Invalid robot specified")
          robot = self.world.robot(robot) 
  
          q_original = robot.getConfig()
  
          if len(q) != robot.numLinks():
              raise ValueError("Config must be correct size: %d != %d"%(len(q),robot.numLinks()))
          robot.setConfig(q)
  
          self.beginRpc(strict=False)
          rpcs = []
          for i in range(robot.numLinks()):
              T = robot.link(i).getTransform()
              p = robot.link(i).getParent()
  
              if p>=0:
                  Tp = robot.link(p).getTransform()
                  T = se3.mul(se3.inv(Tp),T)
  
              mat = se3.homogeneous(T)
              #mat is now a 4x4 homogeneous matrix 
  
              linkname = name+robot.link(i).getName()
              #send to the ghost link with name "name"...
              self._do_rpc({'type':'set_transform','object':linkname,'matrix':[mat[0][0],mat[0][1],mat[0][2],mat[0][3],mat[1][0],mat[1][1],mat[1][2],mat[1][3],mat[2][0],mat[2][1],mat[2][2],mat[2][3],mat[3][0],mat[3][1],mat[3][2],mat[3][3]]})
          self.endRpc(strict=False)
  
          robot.setConfig(q_original)
function_tokens: def setGhostConfig ( self , q , name = "ghost" , robot = 0 ) : if robot < 0 or robot >= self . world . numRobots ( ) : raise ValueError ( "Invalid robot specified" ) robot = self . world . robot ( robot ) q_original = robot . getConfig ( ) if len ( q ) != robot . numLinks ( ) : raise ValueError ( "Config must be correct size: %d != %d" % ( len ( q ) , robot . numLinks ( ) ) ) robot . setConfig ( q ) self . beginRpc ( strict = False ) rpcs = [ ] for i in range ( robot . numLinks ( ) ) : T = robot . link ( i ) . getTransform ( ) p = robot . link ( i ) . getParent ( ) if p >= 0 : Tp = robot . link ( p ) . getTransform ( ) T = se3 . mul ( se3 . inv ( Tp ) , T ) mat = se3 . homogeneous ( T ) #mat is now a 4x4 homogeneous matrix  linkname = name + robot . link ( i ) . getName ( ) #send to the ghost link with name "name"... self . _do_rpc ( { 'type' : 'set_transform' , 'object' : linkname , 'matrix' : [ mat [ 0 ] [ 0 ] , mat [ 0 ] [ 1 ] , mat [ 0 ] [ 2 ] , mat [ 0 ] [ 3 ] , mat [ 1 ] [ 0 ] , mat [ 1 ] [ 1 ] , mat [ 1 ] [ 2 ] , mat [ 1 ] [ 3 ] , mat [ 2 ] [ 0 ] , mat [ 2 ] [ 1 ] , mat [ 2 ] [ 2 ] , mat [ 2 ] [ 3 ] , mat [ 3 ] [ 0 ] , mat [ 3 ] [ 1 ] , mat [ 3 ] [ 2 ] , mat [ 3 ] [ 3 ] ] } ) self . endRpc ( strict = False ) robot . setConfig ( q_original )