Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
naoqi_driver.naoqi_node.NaoqiNode Class Reference
Inheritance diagram for naoqi_driver.naoqi_node.NaoqiNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_proxy
def get_version
def is_looping
def run

Public Attributes

 pip
 pport

Private Member Functions

def __on_ros_shutdown

Private Attributes

 __name
 __naoqi_version
 __proxies
 NAOqi stuff dict from a modulename to a proxy.
 __stop_thread
 ROS stuff.

Detailed Description

A ROS Node wrapper that can help you connect to NAOqi and deal with ROS shutdown
To start your node, just call:
my_node = MyNode('my_node')
my_node.start() # that will spawn your node in a thread (and run whatever is in the run() function
rospy.spin()
# when killing ROS, the node will automatically stop its main loop, exit, and then unsubscribe from ALMemory events
# and call whatever you have in unsubscribe()
Then, if your node needs to process data, you just needs to have a run function:

def run(Self):
    #do some initialization
    while self.is_looping():
        # do something
    # do some post processing

Definition at line 39 of file naoqi_node.py.


Constructor & Destructor Documentation

def naoqi_driver.naoqi_node.NaoqiNode.__init__ (   self,
  name 
)
:param name: the name of the ROS node

Definition at line 56 of file naoqi_node.py.


Member Function Documentation

Callback function called whenever rospy.spin() stops

Definition at line 95 of file naoqi_node.py.

def naoqi_driver.naoqi_node.NaoqiNode.get_proxy (   self,
  name,
  warn = True 
)
Returns a proxy to a specific module. If it has not been created yet, it is created
:param name: the name of the module to create a proxy for
:return: a proxy to the corresponding module

Definition at line 128 of file naoqi_node.py.

Returns the NAOqi version.
A proxy for ALMemory is automatically created if needed as self.memProxy.
You can then simply have code that runs or not depending on the NAOqi version.
E.g. if distutils.version.LooseVersion('1.6') < get_version()    ....
:return: a distutils.version.LooseVersion object with the NAOqi version

Definition at line 147 of file naoqi_node.py.

:return: whether the thread is supposed to be running

Definition at line 122 of file naoqi_node.py.

This is a virtual method that corresponds to the code of the Node that runs continuously
It should have a while loop calling the self.is_looping() function
# code example
#do some initialization
while self.is_looping():
    # do something
# do some post processing

Reimplemented in naoqi_joint_states.NaoqiJointStates.

Definition at line 108 of file naoqi_node.py.


Member Data Documentation

Definition at line 58 of file naoqi_node.py.

Definition at line 58 of file naoqi_node.py.

NAOqi stuff dict from a modulename to a proxy.

Definition at line 60 of file naoqi_node.py.

ROS stuff.

Definition at line 61 of file naoqi_node.py.

Definition at line 60 of file naoqi_node.py.

Definition at line 60 of file naoqi_node.py.


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


naoqi_driver_py
Author(s): Armin Hornung, Armin Hornung, Stefan Osswald, Daniel Maier, Miguel Sarabia, Severin Lemaignan
autogenerated on Wed Aug 16 2017 02:28:07