OpenRTM-aist-Python 2.0.0
|
Public Member Functions | |
def | __init__ (self) |
def | __del__ (self) |
def | exit (self) |
def | setPushPolicy (self, prop) |
def | createTask (self, prop) |
def | init (self, prop) |
def | setConsumer (self, consumer) |
def | setBuffer (self, buffer) |
def | setListener (self, info, listeners) |
def | write (self, data, sec, usec) |
def | isActive (self) |
def | activate (self) |
def | deactivate (self) |
def | svc (self) |
def | pushAll (self) |
push all policy More... | |
def | pushFifo (self) |
push "fifo" policy More... | |
def | pushSkip (self) |
push "skip" policy More... | |
def | pushNew (self) |
push "new" policy More... | |
def | convertReturn (self, status, data) |
def | invokeListener (self, status, data) |
def | onBufferWrite (self, data) |
def | onBufferFull (self, data) |
def | onBufferWriteTimeout (self, data) |
def | onBufferRead (self, data) |
def | onSend (self, data) |
def | onReceived (self, data) |
def | onReceiverFull (self, data) |
def | onReceiverTimeout (self, data) |
def | onReceiverError (self, data) |
def | onBufferEmpty (self) |
def | onSenderEmpty (self) |
def | onSenderError (self) |
def | bufferIsEmpty (self) |
Public Member Functions inherited from OpenRTM_aist.PublisherBase.PublisherBase | |
def | init (self, prop) |
def | release (self) |
Public Member Functions inherited from OpenRTM_aist.DataPortStatus.DataPortStatus | |
def | toString (status) |
Additional Inherited Members | |
Static Public Attributes inherited from OpenRTM_aist.DataPortStatus.DataPortStatus | |
int | PORT_OK = 0 |
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.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.__init__ | ( | self | ) |
Constructor
Reimplemented from OpenRTM_aist.DataPortStatus.DataPortStatus.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.__del__ | ( | self | ) |
Destructor
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.
PublisherBase::ReturnCode PublisherPeriodic::activate()
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.bufferIsEmpty | ( | self | ) |
Whether a buffer is empty.
bool bufferIsEmpty()
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.
status | BufferStatus |
data | cdrMemoryStream |
PublisherBase::ReturnCodea PublisherPeriodic::convertReturn(BufferStatus::Enum status, const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.createTask | ( | self, | |
prop | |||
) |
Setting Task
bool PublisherNew::createTask(const coil::Properties& prop)
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.
PublisherBase::ReturnCode PublisherPeriodic::deactivate()
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.exit | ( | self | ) |
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
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.
property | Property objects that includes the control information of this Publisher |
PublisherBase::ReturnCode PublisherPeriodic::init(coil::Properties& prop)
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.invokeListener | ( | self, | |
status, | |||
data | |||
) |
Call listeners according to the DataPortStatus
status | DataPortStatus |
data | cdrMemoryStream |
PublisherPeriodic::ReturnCode PublisherPeriodic::invokeListener(DataPortStatus::Enum status, const cdrMemoryStream& data)
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.
bool PublisherPeriodic::isActive()
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferEmpty | ( | self | ) |
Notify an ON_BUFFER_EMPTY event to listeners
inline void onBufferEmpty()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferFull | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_FULL event to listeners
data | cdrMemoryStream |
inline void onBufferFull(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferRead | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_READ event to listeners
data | cdrMemoryStream |
inline void onBufferRead(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferWrite | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_WRITE event to listeners
data | cdrMemoryStream |
inline void onBufferWrite(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onBufferWriteTimeout | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_WRITE_TIMEOUT event to listeners
data | cdrMemoryStream |
inline void onBufferWriteTimeout(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceived | ( | self, | |
data | |||
) |
Notify an ON_RECEIVED event to listeners
data | cdrMemoryStream |
inline void onReceived(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverError | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_ERROR event to listeners
data | cdrMemoryStream |
inline void onReceiverError(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverFull | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_FULL event to listeners
data | cdrMemoryStream |
inline void onReceiverFull(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onReceiverTimeout | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_TIMEOUT event to listeners
data | cdrMemoryStream |
inline void onReceiverTimeout(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSend | ( | self, | |
data | |||
) |
Notify an ON_SEND event to listners
data | cdrMemoryStream |
inline void onSend(const cdrMemoryStream& data)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSenderEmpty | ( | self | ) |
Notify an ON_SENDER_EMPTY event to listeners
inline void onSenderEmpty()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.onSenderError | ( | self | ) |
Notify an ON_SENDER_ERROR event to listeners
inline void onSenderError()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushAll | ( | self | ) |
push all policy
PublisherBase::ReturnCode PublisherPeriodic::pushAll()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushFifo | ( | self | ) |
push "fifo" policy
PublisherBase::ReturnCode PublisherPeriodic::pushFifo()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushNew | ( | self | ) |
push "new" policy
PublisherBase::ReturnCode PublisherPeriodic::pushNew()
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.pushSkip | ( | self | ) |
push "skip" policy
PublisherBase::ReturnCode PublisherPeriodic::pushSkip()
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.
buffer | A pointer to a CDR buffer object. |
PublisherBase::ReturnCode PublisherPeriodic::setBuffer(CdrBufferBase* buffer)
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
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.
consumer | A pointer to a consumer object. |
PublisherBase::ReturnCode PublisherPeriodic::setConsumer(InPortConsumer* consumer)
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
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.
info | ConnectorInfo that is localized object of ConnectorProfile |
listeners | ConnectorListeners that holds various listeners |
PublisherBase::ReturnCode PublisherPeriodic::setListener(ConnectorInfo& info, ConnectorListeners* listeners)
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.setPushPolicy | ( | self, | |
prop | |||
) |
Setting PushPolicy
void PublisherNew::setPushPolicy(const coil::Properties& prop)
def OpenRTM_aist.PublisherPeriodic.PublisherPeriodic.svc | ( | self | ) |
Thread execution function A task execution function to be executed by coil::PeriodicTask.
int PublisherPeriodic::svc(void)
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.
data | Data to be wrote to the buffer |
sec | Timeout time in unit seconds |
nsec | Timeout time in unit nano-seconds |
PublisherBase::ReturnCode PublisherPeriodic::write(const cdrMemoryStream& data, unsigned long sec, unsigned long usec)
Reimplemented from OpenRTM_aist.PublisherBase.PublisherBase.