Welcome to dynamic-graph-python’s documentation!

Python module dynamic_graph implements bindings for dynamic-graph library. To each main C++ class is associated a Python class. Main classes are listed below.

Entity

maps dynamicgraph::Entity C++ class.

class dynamic_graph.entity.Entity(className, instanceName)

This class binds dynamicgraph::Entity C++ class

boundAllNewCommands()

For all commands that are not attribute of the object instance nor of the class, a new attribute of the instance is created to bound the command.

boundClassCommands()

This static function has to be called from a class heritating from Entity. It should be called only once. It parses the list of commands obtained from c++, and bind each of them to a python class method.

boundNewCommand(cmdName)

At construction, all existing commands are bound directly in the class. This method enables to bound new commands dynamically. These new bounds are not made with the class, but directly with the object instance.

commands()

Return the list of commands.

displaySignals()

Print the list of signals into standard output: temporary.

globalHelp()

Print a short description of each command.

hasSignal(name)

Indicates if a signal with the given name exists in the entity

help(comm=None)

With no arg, print the global help. With arg the name of a specific command, print the help associated to the command.

static initEntity(name)

Common constructor of specialized Entity classes. This function is bound by the factory to each new class derivated from the Entity class as the constructor of the new class.

obj = None

Store list of entities created via python

signal(name)

Get a signal of the entity from signal name

signals()

Return the list of signals

SignalBase

maps dynamicgraph::SignalBase C++ class.

class dynamic_graph.signal_base.SignalBase(name='', obj=None)

This class binds dynamicgraph::SignalBase<int> C++ class

displayDependencies(iter)

Print signal dependencies in a string

getClassName()

Get class name of signal

getName()

Get name of signal

getPlugged()

Return the plugged signal.

isPlugged()

Return whether a signal is plugged.

name

Get name of signal

recompute(time)

Force signal to recompute the value at given time.

time

Get time of signal

unplug()

Unplug a PTR signal.

value

Setter and getter for the value of a signal

Binds C++ SignalBase<int>::get() and set() methods. Values are passed through string streams. A string is interpreted as respectively:

  • a matrix (tuple of tuple) if string fits ‘[n,m]((x_11,x_12,…,x_1m),…,(x_n1,x_n2,…,x_nm))’ format where n and m are integers, x_ij are floating point numbers,
  • a tuple if string fits ‘[n](x_1, x_2, …, x_n)’ format,
  • an integer,
  • a floating point number.

If string fits none of the above formats, no conversion is performed.

For instance, is s binds a signal of type vector,
>>> s.value = (2.5, .1, 1e2)
will call SignalBase<int>::set(“[3](2.5,0.1,100.0)”) and
>>> s.value
(2.5, 0.1, 100.0)

Other funtions of the module

Copyright (c) 2010 CNRS Author: Florent Lamiraux

dynamic_graph.plug(signalOut, signalIn)

Plug an output signal into an input signal

Indices and tables