Public Member Functions | Public Attributes
bridge_client.GenericActionClient Class Reference

The GenericActionClient launches a ROS node that will stream XML data from the machine tool and will launch a ROS action client if the machine tool requests an action. More...

Inheritance diagram for bridge_client.GenericActionClient:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
 Constructor for a GenericActionClient.
def action_client
 ROS Action client function that compiles and sends the action goal to the dedicated ROS action server.
def setup_topic_data
 This function captures the topic package, type, action goals, and action state conversion from ROS to MTConnect as required for the ROS action client.
def xml_callback
 Callback function that launches a ROS action client if the machine tool data item tag is 'ACTIVE'.

Public Attributes

 action_goals
 action_list
 action_service
 adapter
 config
 conn
 di_dict
 handshake
 lib_manifests
 lock
 msg_parameters
 mtool
 ns
 package
 port
 service
 service_handle
 type_handle
 url
 url_port
 xml_goal

Detailed Description

The GenericActionClient launches a ROS node that will stream XML data from the machine tool and will launch a ROS action client if the machine tool requests an action.

For example, if the machine tool requests a MaterialLoad action, it will change the MaterialLoad Event tag from 'READY' to 'ACTIVE'. Once this change is captured by this class, the class launches a ROS MaterialLoadAction client. Subsequently, the MaterialLoadAction server must be executed to process the action. If not, the system waits until the MaterialLoadAction server is available.

Actions and goals are specified by a configuration file that must be included with the main program during execution. If this file is not provided, the node will terminate with an error message indicating the need for this file.

Command line example:

bridge_client.py -i bridge_client_config.yaml bridge_client.py -input bridge_client_config.yaml

The class contains the following methods: setup_topic_data -- utilizes introspection to set up class instance variables. action_client -- function triggered by the xml_callback that executes a ROS action. xml_callback -- parses xml stream and launches action client. Completes 'READY' handshake with machine tool.

Definition at line 72 of file bridge_client.py.


Constructor & Destructor Documentation

Constructor for a GenericActionClient.

Definition at line 74 of file bridge_client.py.


Member Function Documentation

def bridge_client.GenericActionClient.action_client (   self,
  cb_data 
)

ROS Action client function that compiles and sends the action goal to the dedicated ROS action server.

The function will block until the server becomes available. After the goal result is received from the dedicated ROS action server, the function sets the robot data item via the MTConnect adapter.

Parameters:
cb_data,:tuple containing the following parameters:
name,:string containing the data item name for the robot action
goals,:dictionary of data_item:goal pairs in str:str or str:float format
handle,:Python <module 'mtconnect_msgs.msg'>

Definition at line 190 of file bridge_client.py.

This function captures the topic package, type, action goals, and action state conversion from ROS to MTConnect as required for the ROS action client.

This task is completed for each topic specified in the configuration file.

This function then performs a relative import of the topic via the getattr(import_module) function. Data is stored in the following class attributes:

self.lib_manifests --> used to track which manifests have been loaded. self.type_handle --> used for ROS SimpleActionClient, stores package name with action messages. self.action_list --> used for ROS SimpleActionClient, stores CNC action request strings. self.action_goals --> data structure for message class instances of the topic type.

Definition at line 156 of file bridge_client.py.

Callback function that launches a ROS action client if the machine tool data item tag is 'ACTIVE'.

Once the action is completed, it completes the handshake signal between the machine tool and the robot via the MTConnect adapter.

Parameters:
chunk,:xml data, read from response.read()

Definition at line 273 of file bridge_client.py.


Member Data Documentation

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 156 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.

Definition at line 74 of file bridge_client.py.


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


mtconnect_ros_bridge
Author(s): Stephen L. Wiedmann
autogenerated on Mon Jan 6 2014 11:30:45