Public Member Functions | Static Public Attributes | Private Attributes | List of all members
OpenRTM_aist.PublisherPeriodic.PublisherPeriodic Class Reference

PublisherPeriodic class. More...

Inheritance diagram for OpenRTM_aist.PublisherPeriodic.PublisherPeriodic:
Inheritance graph
[legend]

Public Member Functions

def __del__ (self)
 Destructor. More...
 
def __init__ (self)
 Constructor. More...
 
def activate (self)
 activation More...
 
def bufferIsEmpty (self)
 Whether a buffer is empty. More...
 
def convertReturn (self, status, data)
 Convertion from BufferStatus to DataPortStatus. More...
 
def createTask (self, prop)
 Setting Taskbool PublisherNew::createTask(const coil::Properties& prop) More...
 
def deactivate (self)
 deactivation More...
 
def init (self, prop)
 Initialization. More...
 
def invokeListener (self, status, data)
 Call listeners according to the DataPortStatus. More...
 
def isActive (self)
 If publisher is active state. More...
 
def onBufferEmpty (self)
 Notify an ON_BUFFER_EMPTY event to listenersinline void onBufferEmpty() More...
 
def onBufferFull (self, data)
 Notify an ON_BUFFER_FULL event to listeners. More...
 
def onBufferRead (self, data)
 Notify an ON_BUFFER_READ event to listeners. More...
 
def onBufferWrite (self, data)
 Notify an ON_BUFFER_WRITE event to listeners. More...
 
def onBufferWriteTimeout (self, data)
 Notify an ON_BUFFER_WRITE_TIMEOUT event to listeners. More...
 
def onReceived (self, data)
 Notify an ON_RECEIVED event to listeners. More...
 
def onReceiverError (self, data)
 Notify an ON_RECEIVER_ERROR event to listeners. More...
 
def onReceiverFull (self, data)
 Notify an ON_RECEIVER_FULL event to listeners. More...
 
def onReceiverTimeout (self, data)
 Notify an ON_RECEIVER_TIMEOUT event to listeners. More...
 
def onSend (self, data)
 Notify an ON_SEND event to listners. More...
 
def onSenderEmpty (self)
 Notify an ON_SENDER_EMPTY event to listenersinline void onSenderEmpty() More...
 
def onSenderError (self)
 Notify an ON_SENDER_ERROR event to listenersinline void onSenderError() More...
 
def pushAll (self)
 push all policy More...
 
def pushFifo (self)
 push "fifo" policy More...
 
def pushNew (self)
 push "new" policy More...
 
def pushSkip (self)
 push "skip" policy More...
 
def setBuffer (self, buffer)
 Setting buffer pointer. More...
 
def setConsumer (self, consumer)
 Store InPort consumer. More...
 
def setListener (self, info, listeners)
 Set the listener. More...
 
def setPushPolicy (self, prop)
 Setting PushPolicyvoid PublisherNew::setPushPolicy(const coil::Properties& prop) More...
 
def svc (self)
 Thread execution function A task execution function to be executed by coil::PeriodicTask. More...
 
def write (self, data, sec, usec)
 Write data. More...
 
- Public Member Functions inherited from OpenRTM_aist.PublisherBase.PublisherBase
def activate (self)
 virtual ReturnCode activate() = 0; More...
 
def deactivate (self)
 virtual ReturnCode deactivate() = 0; More...
 
def init (self, prop)
 Initializing configuration. More...
 
def isActive (self)
 virtual bool isActive() = 0; More...
 
def release (self)
 Release the Publisher. More...
 
def setBuffer (self, buffer)
 virtual ReturnCode setBuffer(BufferBase<cdrMemoryStream>* buffer) = 0; More...
 
def setConsumer (self, consumer)
 virtual ReturnCode setConsumer(InPortConsumer* consumer) = 0; More...
 
def setListener (self, info, listeners)
 
def write (self, data, sec, usec)
 
- Public Member Functions inherited from OpenRTM_aist.DataPortStatus.DataPortStatus
def __init__ (self)
 
def toString (status)
 Convert DataPortStatus into the string. More...
 

Static Public Attributes

int ALL = 0
 
int FIFO = 1
 
int NEW = 3
 
int SKIP = 2
 
- Static Public Attributes inherited from OpenRTM_aist.DataPortStatus.DataPortStatus
int BUFFER_EMPTY = 4
 
int BUFFER_ERROR = 2
 
int BUFFER_FULL = 3
 
int BUFFER_TIMEOUT = 5
 
int CONNECTION_LOST = 12
 
int INVALID_ARGS = 10
 
int PORT_ERROR = 1
 
int PORT_OK = 0
 DataPortStatus return codes. More...
 
int PRECONDITION_NOT_MET = 11
 
int RECV_EMPTY = 8
 
int RECV_TIMEOUT = 9
 
int SEND_FULL = 6
 
int SEND_TIMEOUT = 7
 
 toString = staticmethod(toString)
 
int UNKNOWN_ERROR = 13
 

Private Attributes

 _active
 
 _buffer
 
 _consumer
 
 _leftskip
 
 _listeners
 
 _profile
 
 _pushPolicy
 
 _readback
 
 _retcode
 
 _retmutex
 
 _rtcout
 
 _skipn
 
 _task
 

Detailed Description

PublisherPeriodic class.

Publisher for periodic data transmitting. Usually this class object exists in a Connector object, and it is associated with a buffer and a consumer. This publisher periodically gets data from the buffer and publish it into the consumer.

Definition at line 45 of file PublisherPeriodic.py.

Constructor & Destructor Documentation

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.__init__ (   self)

Constructor.

Definition at line 72 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.__del__ (   self)

Destructor.

Definition at line 100 of file PublisherPeriodic.py.

Member Function Documentation

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.activate (   self)

activation

This function activates the publisher. By calling this function, this publisher starts the thread that pushes data to InPort. If precondition such as initialization process and so on is not met, the error code PRECONDITION_NOT_MET is returned.

Returns
PORT_OK normal return PRECONDITION_NOT_MET precondition is not met

PublisherBase::ReturnCode PublisherPeriodic::activate()

Definition at line 570 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.bufferIsEmpty (   self)

Whether a buffer is empty.

bool bufferIsEmpty()

Definition at line 1087 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.convertReturn (   self,
  status,
  data 
)

Convertion from BufferStatus to DataPortStatus.

This function converts return value from the buffer to DataPortStatus::Enum typed return value. The conversion rule is as follows. Callback functions are also shown, if it exists.

  • BUFFER_OK: PORT_OK
    • None
  • BUFFER_ERROR: BUFFER_ERROR
    • None
  • BUFFER_FULL: BUFFER_FULL
  • NOT_SUPPORTED: PORT_ERROR
    • None
  • TIMEOUT: BUFFER_TIMEOUT
  • PRECONDITION_NOT_MET: PRECONDITION_NOT_MET
    • None
  • other: PORT_ERROR
    • None
Parameters
statusBufferStatus
datacdrMemoryStream
Returns
DataPortStatus typed return code

PublisherBase::ReturnCodea PublisherPeriodic::convertReturn(BufferStatus::Enum status, const cdrMemoryStream& data)

Definition at line 829 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.createTask (   self,
  prop 
)

Setting Taskbool PublisherNew::createTask(const coil::Properties& prop)

Definition at line 172 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.deactivate (   self)

deactivation

This function deactivates the publisher. By calling this function, this publisher stops the thread that pushes data to InPort. If precondition such as initialization process and so on is not met, the error code PRECONDITION_NOT_MET is returned.

Returns
PORT_OK normal return PRECONDITION_NOT_MET precondition is not met

PublisherBase::ReturnCode PublisherPeriodic::deactivate()

Definition at line 603 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.init (   self,
  prop 
)

Initialization.

This function have to be called before using this class object. Properties object that includes certain configuration information should be given as an argument. At least, a numerical value of unit of Hz with the key of "dataport.publisher.push_rate" has to be set to the Properties object of argument. The value is the invocation cycle of data sending process. In case of 5 ms period or 200 Hz, the value should be set as 200.0. False will be returned, if there is no value with the key of "dataport.publisher.push_rate".

The following options are available.

  • publisher.thread_type: Thread type (string, default: default)
  • publisher.push_rate: Publisher sending period (numberical)
  • publisher.push_policy: Push policy (all, fifo, skip, new)
  • publisher.skip_count: The number of skip count in the "skip" policy
  • measurement.exec_time: Task execution time measurement (enable/disable)
  • measurement.exec_count: Task execution time measurement count (numerical, number of times)
  • measurement.period_time: Task period time measurement (enable/disable)
  • measurement.period_count: Task period time measurement count (number, count)
Parameters
propertyProperty objects that includes the control information of this Publisher
Returns
ReturnCode PORT_OK normal return INVALID_ARGS Properties with invalid values.

PublisherBase::ReturnCode PublisherPeriodic::init(coil::Properties& prop)

Definition at line 288 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.invokeListener (   self,
  status,
  data 
)

Call listeners according to the DataPortStatus.

Parameters
statusDataPortStatus
datacdrMemoryStream
Returns
Return code

PublisherPeriodic::ReturnCode PublisherPeriodic::invokeListener(DataPortStatus::Enum status, const cdrMemoryStream& data)

Definition at line 875 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.isActive (   self)

If publisher is active state.

A Publisher can be activated/deactivated synchronized with the data port. The active state and the non-active state are made transition by the "activate()" and the "deactivate()" functions respectively. This function confirms if the publisher is in active state.

Returns
Result of state confirmation (Active state:true, Inactive state:false)

bool PublisherPeriodic::isActive()

Definition at line 541 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferEmpty (   self)

Notify an ON_BUFFER_EMPTY event to listenersinline void onBufferEmpty()

Definition at line 1047 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferFull (   self,
  data 
)

Notify an ON_BUFFER_FULL event to listeners.

Parameters
datacdrMemoryStream

inline void onBufferFull(const cdrMemoryStream& data)

Definition at line 928 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferRead (   self,
  data 
)

Notify an ON_BUFFER_READ event to listeners.

Parameters
datacdrMemoryStream

inline void onBufferRead(const cdrMemoryStream& data)

Definition at line 958 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferWrite (   self,
  data 
)

Notify an ON_BUFFER_WRITE event to listeners.

Parameters
datacdrMemoryStream

inline void onBufferWrite(const cdrMemoryStream& data)

Definition at line 913 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferWriteTimeout (   self,
  data 
)

Notify an ON_BUFFER_WRITE_TIMEOUT event to listeners.

Parameters
datacdrMemoryStream

inline void onBufferWriteTimeout(const cdrMemoryStream& data)

Definition at line 943 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceived (   self,
  data 
)

Notify an ON_RECEIVED event to listeners.

Parameters
datacdrMemoryStream

inline void onReceived(const cdrMemoryStream& data)

Definition at line 988 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverError (   self,
  data 
)

Notify an ON_RECEIVER_ERROR event to listeners.

Parameters
datacdrMemoryStream

inline void onReceiverError(const cdrMemoryStream& data)

Definition at line 1033 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverFull (   self,
  data 
)

Notify an ON_RECEIVER_FULL event to listeners.

Parameters
datacdrMemoryStream

inline void onReceiverFull(const cdrMemoryStream& data)

Definition at line 1003 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverTimeout (   self,
  data 
)

Notify an ON_RECEIVER_TIMEOUT event to listeners.

Parameters
datacdrMemoryStream

inline void onReceiverTimeout(const cdrMemoryStream& data)

Definition at line 1018 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSend (   self,
  data 
)

Notify an ON_SEND event to listners.

Parameters
datacdrMemoryStream

inline void onSend(const cdrMemoryStream& data)

Definition at line 973 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSenderEmpty (   self)

Notify an ON_SENDER_EMPTY event to listenersinline void onSenderEmpty()

Definition at line 1060 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSenderError (   self)

Notify an ON_SENDER_ERROR event to listenersinline void onSenderError()

Definition at line 1073 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushAll (   self)

push all policy

PublisherBase::ReturnCode PublisherPeriodic::pushAll()

Definition at line 647 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushFifo (   self)

push "fifo" policy

PublisherBase::ReturnCode PublisherPeriodic::pushFifo()

Definition at line 677 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushNew (   self)

push "new" policy

PublisherBase::ReturnCode PublisherPeriodic::pushNew()

Definition at line 741 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushSkip (   self)

push "skip" policy

PublisherBase::ReturnCode PublisherPeriodic::pushSkip()

Definition at line 705 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.setBuffer (   self,
  buffer 
)

Setting buffer pointer.

This operation sets a buffer that is associated with this object. If the buffer object is NULL, INVALID_ARGS will be returned.

Parameters
bufferA pointer to a CDR buffer object.
Returns
ReturnCode PORT_OK normal return INVALID_ARGS given argument has invalid value

PublisherBase::ReturnCode PublisherPeriodic::setBuffer(CdrBufferBase* buffer)

Definition at line 356 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.setConsumer (   self,
  consumer 
)

Store InPort consumer.

This operation sets a consumer that is associated with this object. If the consumer object is NULL, INVALID_ARGS will be returned.

Parameters
consumerA pointer to a consumer object.
Returns
ReturnCode PORT_OK normal return INVALID_ARGS given argument has invalid value

PublisherBase::ReturnCode PublisherPeriodic::setConsumer(InPortConsumer* consumer)

Definition at line 320 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.setListener (   self,
  info,
  listeners 
)

Set the listener.

This function sets ConnectorListeners listener object to the Publisher. By setting ConnectorListeners containing various listeners objects, these listeners are called at the time of reading and writing of a buffer, and transmission of data etc. Since the ownership of the ConnectorListeners object is owned by Port or RTObject, the Publisher never deletes the ConnectorListeners object. If the given ConnectorListeners' pointer is NULL, this function returns INVALID_ARGS.

Parameters
infoConnectorInfo that is localized object of ConnectorProfile
listenersConnectorListeners that holds various listeners
Returns
PORT_OK Normal return INVALID_ARGS Invalid arguments

PublisherBase::ReturnCode PublisherPeriodic::setListener(ConnectorInfo& info, ConnectorListeners* listeners)

Definition at line 402 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.setPushPolicy (   self,
  prop 
)

Setting PushPolicyvoid PublisherNew::setPushPolicy(const coil::Properties& prop)

Definition at line 125 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.svc (   self)

Thread execution function A task execution function to be executed by coil::PeriodicTask.

int PublisherPeriodic::svc(void)

Definition at line 619 of file PublisherPeriodic.py.

def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.write (   self,
  data,
  sec,
  usec 
)

Write data.

This function writes data into the buffer associated with this Publisher. If a Publisher object calls this function, without initializing correctly such as a consumer, a buffer, listeners, etc., error code PRECONDITION_NOT_MET will be returned and no operation of the writing to a buffer etc. will be performed.

Since writing into the buffer and sending data to InPort are performed asynchronously, occasionally this function returns return-codes such as CONNECTION_LOST and BUFFER_FULL that indicate the result of sending data to InPort. In this case, writing data into buffer will not be performed.

When publisher writes data to the buffer, if the buffer is filled, returns error, is returned with timeout and returns precondition error, error codes BUFFER_FULL, BUFFER_ERROR, BUFFER_TIMEOUT and PRECONDITION_NOT_MET will be returned respectively.

In other cases, PROT_ERROR will be returned.

Parameters
dataData to be wrote to the buffer
secTimeout time in unit seconds
nsecTimeout time in unit nano-seconds
Returns
PORT_OK Normal return PRECONDITION_NO_MET Precondition does not met. A consumer, a buffer, listenes are not set properly. CONNECTION_LOST detected that the connection has been lost BUFFER_FULL The buffer is full status. BUFFER_ERROR Some kind of error occurred in the buffer. NOT_SUPPORTED Some kind of operation that is not supported has been performed. TIMEOUT Timeout occurred when writing to the buffer.

PublisherBase::ReturnCode PublisherPeriodic::write(const cdrMemoryStream& data, unsigned long sec, unsigned long usec)

Definition at line 492 of file PublisherPeriodic.py.

Member Data Documentation

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._active
private

Definition at line 81 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._buffer
private

Definition at line 75 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._consumer
private

Definition at line 74 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._leftskip
private

Definition at line 83 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._listeners
private

Definition at line 85 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._profile
private

Definition at line 84 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._pushPolicy
private

Definition at line 79 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._readback
private

Definition at line 82 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._retcode
private

Definition at line 77 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._retmutex
private

Definition at line 78 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._rtcout
private

Definition at line 73 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._skipn
private

Definition at line 80 of file PublisherPeriodic.py.

OpenRTM_aist.PublisherPeriodic.PublisherPeriodic._task
private

Definition at line 76 of file PublisherPeriodic.py.

int OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.ALL = 0
static

Definition at line 50 of file PublisherPeriodic.py.

int OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.FIFO = 1
static

Definition at line 51 of file PublisherPeriodic.py.

int OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.NEW = 3
static

Definition at line 53 of file PublisherPeriodic.py.

int OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.SKIP = 2
static

Definition at line 52 of file PublisherPeriodic.py.


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


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:38