Demo entry 5870604

kviz module docs


Submitted by anonymous on Aug 25, 2016 at 04:29
Language: Python. Code size: 1.5 kB.

"""kviz API docs."""

def set_color(target,rgba_color):
	"""Sets the given RobotModel, RobotModelLink, named link, indexed link,
	or object name to some color (given as an (r,g,b) or (r,g,b,a) tuple)."""

def add_ghost(prefixname="ghost",robot=0):
	"""Adds a ghost configuration of the robot that can be posed independently.
	prefixname can be set to identify multiple ghosts. 

	Returns the identifier of the ghost for use in set_color.  The identifier is
	just prefixname + robot.getName()."""

def get_robot_config(robot=0):
	"""A convenience function.  Gets the robot's configuration in the visualization

def set_ghost_config(q,prefixname="ghost",robot=0):
	"""Sets the configuration of the ghost to q.  If the ghost is named, place its name
	in prefixname."""

def add_text(name="HUD_Text1",x=0,y=0,text=""):
	"""Adds a new piece of text displayed on the screen.  name is a unique identifier of
	the text, and x,y are the coordinates of upper left corner of the the text, in percent """

def update_text(name="HUD_Text1",text=""):
	"""Changes string used in the the named piece of text"""

def add_sphere(name="KVIZ_Sphere1",x=0,y=0,z=0,r=1):
	"""Adds a new sphere to the world with the given x,y,z position and radius r."""

def update_sphere(name="KVIZ_Sphere1",x=0,y=0,z=0,r=-1):
	"""Changes the position and or radius of the sphere.  If r < 0 then the radius is
	kept the same."""

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).