amino  1.0-beta2
Lightweight Robot Utility Library
amino.scenegraph.SceneGraph Class Reference

A scene graph. More...

Public Member Functions

def __init__ (self, ptr=None)
 
def __del__ (self)
 
def add_frame_fixed (self, parent, name, tf=QuatTrans.identity(), geom=None)
 Adds a new fixed frame to the scene.
 
def add_frame_revolute (self, parent, name, tf=QuatTrans.identity(), config_name=None, axis=(0, 0, 1), offset=0, geom=None)
 Adds a new revolute frame to the scene.
 
def add_frame_prismatic (self, parent, name, tf=QuatTrans.identity(), config_name=None, axis=(0, 0, 1), offset=0, geom=None, limits=None)
 Adds a new prismatic frame to the scene.
 
def remove_frame (self, name)
 Removes a frame from the scene.
 
def attach_geom (self, name, geom)
 Attaches geometry to the named frame.
 
def reparent (self, new_parent, frame, rel_tf=QuatTrans.identity())
 Change the parent of frame in the scenegraph.
 
def load (self, filename, name, root="")
 Loads a scene plugin into this scene. More...
 
def init (self)
 Initializes the scene, must be called after all frames are added.
 
def allow_collision (self, i, j, allowed=1)
 Set allowed collisions between frames id0 and id1.
 
def config_count (self)
 Number of configuration variables in the scene.
 
def frame_count (self)
 Number of frames in the scene.
 
def config_id (self, name)
 Returns the config id for string name.
 
def frame_id (self, name)
 Returns the frame id for string name.
 
def config_name (self, i)
 Returns the config name for the id.
 
def frame_name (self, i)
 Returns the frame name for the id. More...
 
def ensure_config_id (self, value)
 Ensures value is a config id, converting strings if necessary. More...
 
def ensure_config_name (self, value)
 Ensures value is a string config name, converting int ids if necessary. More...
 
def ensure_frame_id (self, value)
 Ensures value is a frame id, converting strings if necessary. More...
 
def ensure_frame_id_actual (self, value)
 Ensures value is a frame id, converting strings if necessary. More...
 
def ensure_frame_name (self, value)
 Ensures value is a string frame name, converting int ids if necessary. More...
 
def config_vector (self, config, vector=None)
 Create or convert to a configuration vector. More...
 
def copy_config (self, config)
 Copy configuration as a vector.
 
def config_dict (self, vector)
 Convert vector to a dict.
 
def get_parent (self, frame)
 Get the name of the parent of the input frame.
 
def __getitem__ (self, key)
 Return a SubSceneGraph for the chain from root to tip. More...
 
def copy (self)
 Create a copy of the scenegraph.
 

Static Public Attributes

 restype
 
 argtypes
 

Detailed Description

A scene graph.

Definition at line 335 of file scenegraph.py.

Member Function Documentation

◆ __getitem__()

def amino.scenegraph.SceneGraph.__getitem__ (   self,
  key 
)

Return a SubSceneGraph for the chain from root to tip.

Parameters
keya slice starting at the root and ending at the tip.
Exceptions
LookupErrorinvalid slice or frames

Definition at line 619 of file scenegraph.py.

◆ config_vector()

def amino.scenegraph.SceneGraph.config_vector (   self,
  config,
  vector = None 
)

Create or convert to a configuration vector.

Exceptions
IndexErrorprovided vector is the wrong size

Definition at line 578 of file scenegraph.py.

◆ ensure_config_id()

def amino.scenegraph.SceneGraph.ensure_config_id (   self,
  value 
)

Ensures value is a config id, converting strings if necessary.

Exceptions
IndexErrorvalue is out range.
ValueErrorconfig name is invalid.

Definition at line 498 of file scenegraph.py.

◆ ensure_config_name()

def amino.scenegraph.SceneGraph.ensure_config_name (   self,
  value 
)

Ensures value is a string config name, converting int ids if necessary.

Exceptions
IndexErrorvalue is out of range.
ValueErrorconfig name is invalid.

Definition at line 514 of file scenegraph.py.

◆ ensure_frame_id()

def amino.scenegraph.SceneGraph.ensure_frame_id (   self,
  value 
)

Ensures value is a frame id, converting strings if necessary.

Exceptions
IndexErrorvalue is out range.
ValueErrorframe name is invalid.

Definition at line 531 of file scenegraph.py.

◆ ensure_frame_id_actual()

def amino.scenegraph.SceneGraph.ensure_frame_id_actual (   self,
  value 
)

Ensures value is a frame id, converting strings if necessary.

   The difference between this function and ensure_frame_id() is
   that this function throws errors if given reserved frame ids,
   FRAME_ROOT and FRAME_NONE.
Exceptions
IndexErrorvalue is out range.

Definition at line 551 of file scenegraph.py.

◆ ensure_frame_name()

def amino.scenegraph.SceneGraph.ensure_frame_name (   self,
  value 
)

Ensures value is a string frame name, converting int ids if necessary.

Exceptions
IndexErrorvalue is out of range.
ValueErrorframe name is invalid.

Definition at line 563 of file scenegraph.py.

◆ frame_name()

def amino.scenegraph.SceneGraph.frame_name (   self,
  i 
)

Returns the frame name for the id.

Exceptions
IndexErrorvalue is out of range.

Definition at line 485 of file scenegraph.py.

◆ load()

def amino.scenegraph.SceneGraph.load (   self,
  filename,
  name,
  root = "" 
)

Loads a scene plugin into this scene.

Parameters
filnameplugin name, passed directly to dlopen().
namescene name, as provided to the scene compiler.
rootparent frame for the loaded scene.
Exceptions
LookupErrorthe shared object or named scene could not be found.

Definition at line 435 of file scenegraph.py.


The documentation for this class was generated from the following file: