core.backend package¶
Submodules¶
core.backend.config_interpreter module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
-
core.backend.config_interpreter.getConfig(configfilename='configuration.xml', config_id_to_use=None)[source]¶ Read in the configuration file with path configfilename.
If config_id_to_use is set, use a configuration with this specific id.
Parameters: - configfilename – the xml-file containing configuration(s) (default configuration.xml)
- config_id_to_use – use this specific configuration from within the configuration file (default None)
-
core.backend.config_interpreter.recursiveGet(domparent, parent)[source]¶ Get information from dom element domparent and place in an abstraction called parent.
Recursively increase depth, stepping untill the deepest level of domparent. use objects from
core.aero.objectsto create an abstraction.Parameters: - domparent – the (current) dom parent
- parent – the parent to which abstractions of the domparent are to be added
core.backend.config_matcher module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
-
core.backend.config_matcher.matchConfig(configuration, available_mods)[source]¶ Start matching modules and settings specified in configuration to available modules in available_mods.
Parameters: - configuration – the abstraction of a configuration
- available_mods – list of all available modules (can be delivered by
core.aero.scan.getAvailableModules())
-
core.backend.config_matcher.recursiveMatch(parent, available_mods)[source]¶ Find a the abstraction of an object mentioned in parent in available_mods and return.
Also step into every level of parent recusively and finally return is an abstraction of parent with all children abstracted.
Parameters: - parent – the to-be-implemented object
- available_mods – list of all available modules (can be delivered by
core.aero.scan.getAvailableModules()
core.backend.helpers module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
-
core.backend.helpers.findModuleById(available_mods, module_id)[source]¶ Find a module from list of modules (available_mods) by its module_id and return the module.
Return None if the module is there is not a module with id module_id in available_mods.
Parameters: - available_mods – list of all available modules
- module_id – id of the module to find
-
core.backend.helpers.getElements(node)[source]¶ Return a list of al dom elements in the element node.
Parameters: node – the parent element
-
core.backend.helpers.getElementsOnFirstLevel(parent, element)[source]¶ Return a list of elements below parent, that have tagname element.
Parameters: - parent – the parent element
- element – tagname of elements to return in the list
-
core.backend.helpers.getElementsOnFirstLevelExceptTag(parent, element)[source]¶ Return all elements below parent except for the ones tagged element.
Parameters: - parent – the parent dom object
- elemnt – the tag-name of elements not to return
-
core.backend.helpers.getOptionalAttribute(element, attribute)[source]¶ Return the value of an attribute from an element, but do not crash/throw if attribute does not exist.
Return None if attribute is not in the parent element.
Parameters: - element – the parent element that (might) contain(s) the attribute
- attribute – the optional attribute to return the value of
-
core.backend.helpers.lookupMessageType(message_type)[source]¶ Look up a message type from a list given its acronym message_type and returns the full message type.
If the message_type is not an acronym from the list, return message_type.
Parameters: message_type – the acronym to look up, or a non acronym message type
core.backend.objects module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
-
class
core.backend.objects.Cmdline_argument(executable_id, argument)[source]¶ An argument to use when starting a specific rosnode. Used for instance when starting rviz with a configuration file.
Parameters: - executable_id – id of the executable this argument is used for
- argument – string of all arguments to use for this executable
-
class
core.backend.objects.Configuration(id)[source]¶ A Configuration is a list of settings, usually from a configuration file, used to setup an experiment.
it contains: :param id: unique id for this configuration :param modules_to_add: list of modules needed in this configuration :param connections_to_add: list of connections needed :param namespaces: list of :class:Namespace in this configuration
-
class
core.backend.objects.Connection_to_add(publisher, listener)[source]¶ Representation of a connection desired to add to a configuration
Parameters: - publisher – topic of the publisher to be connected
- subscriber – topic of the subscriber to be connected
-
class
core.backend.objects.Executable(id, pkg, executable)[source]¶ An executable represents a ROS node that can be launched through a ROS launch file, generated by the AeroWorks infrastructure.
-
addInput(interface)[source]¶ Adds an input to the list of executable inputs (
inputs).Parameters: interface ( Interface) – The interface to add
-
addOutput(interface)[source]¶ Adds an output to the list of executable outputs (
outputs).Parameters: interface ( Interface) – The interface to add
-
addParameter(parameter)[source]¶ Adds a parameter to the list of executable parameters (
params).Parameters: parameter ( Parameter) – The parameter to add
-
args= None¶ A string with default arguments
-
executable= None¶ The ROS node executable to launch. E.g. “joy_node”.
-
id= None¶ The ID of the executable, as given in the
viki.xml.
-
pkg= None¶ The ROS package that contains the executable. E.g.: “joy”
-
-
class
core.backend.objects.Interface(interface_type, name, message_type, required, link=None, namespace='base')[source]¶ An interface represents an in- or output of a module. This in- and outputs can be connected to other module’s in- and outputs.
-
link= None¶ Contains the reference to the executable within the module that actually provides the in- or output. E.g.: “test_node/test_topic”
-
message_type= None¶ Represents the message type the interface can handle. E.g.: “twist” or “standard_msgs/Empty”
-
name= None¶ Represents the name of the interface. E.g.: “cmd_vel”
-
namespace= None¶ Namespace used in the ros package for this topic, “base”, “global” or “private”; according to wiki.ros.org/Names
-
required= None¶ Defines if the interface is required to be connected. Execution will halt if this requirement is not met.
-
type= None¶ Represents the type of the interface. E.g.: “ros_topic”
-
-
class
core.backend.objects.Internal_Interface(publisher, listener)[source]¶ An internal_interface represents a connection between an in- and output within a module. At this point, implicitly only implemented for ros_topic type interfaces.
Note
In the future, this might be a specific case of
Interface.-
listener= None¶ Refers to the topic where the node is listening for messages. This topic is remapped to listen to the publisher. E.g. “node2_name/i_listen_here”
-
publisher= None¶ Refers to the topic on which messages are be published. E.g. “node_name/command_giver”
-
-
class
core.backend.objects.Launch_prefix(executable_id, prefix)[source]¶ A launch prefix that will be run before the actual ROSnode. Can be very useful to for instance start a node in debug mode.
Parameters: - executable_id – id of the executable this prefix is used for
- prefix – string of the prefix
-
class
core.backend.objects.Module(type, id)[source]¶ A module represents a separately distributable piece of software, that is able to work within the AeroWorks infrastructure.
-
addExecutable(executable)[source]¶ Adds an executable to the list of module executables (
executables). Those executables are ROS nodes.Parameters: executable ( Executable) – The executable to add.
-
addInput(interface)[source]¶ Adds an input to the list of module inputs (
inputs).Parameters: interface ( Interface) – The interface to add
-
addIntConnect(internal_interface)[source]¶ Adds an internal connection to the list of module internal connections (
config).Parameters: internal_interface ( Internal_Interface) – The connection to add
-
addMeta(key, value)[source]¶ Adds metadata to
meta.Parameters: - key (string) – The key of the metadata. E.g. “name”
- value (string) – The value of the metadata. E.g. “AeroWorks”
-
addOutput(interface)[source]¶ Adds an output to the list of module outputs (
outputs).Parameters: interface ( Interface) – The interface to add
-
config= None¶ A list of
Internal_Interfacedescribing all internal connections.
-
executables= None¶ A list of
Executabledescribing all executables (ROS nodes) in the module.
-
getExecutable(exec_id)[source]¶ Returns the executable with the id, within this module :param exec_id: the string id of the executable, as defined in the xml file :return: Executable
-
id= None¶ Represents the ID of the module, as defined in the
viki.xml. This is used for identifying and selecting the module throughout the process, so this value should be unique.
-
meta= None¶ Contains a dictionary with all module metadata, as defined in
viki.xml.
-
missing_packages= None¶ List with missing packages, initially empty
-
package_dependencies= None¶ List with names of dependent ROS packages
-
path= None¶ Contains the path to the module config
-
setPath(path)[source]¶ Sets the path for the current module.
Parameters: path (string) – The path where to find the module
-
type= None¶ Represents the type of the module, as defined in the
viki.xml. This categorization is added for the comfort of the user. Examples are “userinput”, “sensor”, “controller” and “vehicle”.
-
-
class
core.backend.objects.Module_to_add(role, type, id, supress_warning=False)[source]¶ An object representing a module that is desired to be in a configuration. It is a temporary container for all information to get the actual :class:Module classes, and contains an implementation where the :class:Module can be placed.
Parameters: - role – role of this module eg. userinput, vehicle, etc.
- id – unique id of the module
- type – type of module
- supress_warning – suppress warnings given in/by this module (not yet implemented)
- parameters_to_add – list of parameters that are to be added to class:Executable in this module
- args – list of command line arguments that are used to start this modules nodes
-
add_cmdline_arg(arg)[source]¶ Add a command line argument object arg to the list of arguments needed to run this module
Parameters: arg – The command line argument object to add
-
class
core.backend.objects.Namespace(id)[source]¶ A namespace is in itself basically a :class:Configuration , which can in turn contain multiple namespaces.
Parameters: - id – unique id for this configuration
- modules_to_add – list of modules needed in this configuration
- connections_to_add – list of connections needed
- namespaces – list of *namespace*s
-
class
core.backend.objects.Parameter(name, type, default=None, value=None)[source]¶ A Parameter represents a param in the rosparam server
Parameters: - name – The name of the parameter
- default – A default value, when no specific value is given
- type – Type of parameter
- value – Value of the parameter
core.backend.scan module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
-
core.backend.scan.getAvailableModules(viki_config)[source]¶ Return a list of modules available in the framework at this moment.
- Run through the entire project tree searching for files called ‘viki.xml’.
- Create an abstraction from each .xml file as objects from
core.aero.objects. - Put abstraction in a list
- Return list when done.
core.backend.writeLaunch module¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License
Module contents¶
VIKI: more than a GUI for ROS, https://github.com/UT-RAM/viki version: 0.2 - Alice copyright: Robin Hoogervorst, Alex Kamphuis, Cees Trouwborst, 2016 licensed under the MIT License