MIRA
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
PyUnitWrapper Class Reference

#include <python/UnitWrapper.h>

Inheritance diagram for PyUnitWrapper:
Inheritance graph
[legend]

Classes

class  BaseCallback
 
class  Callback
 
class  CallbackInterval
 

Public Member Functions

 PyUnitWrapper (PyObject *self)
 
 PyUnitWrapper (PyObject *self, uint32 flags)
 
 PyUnitWrapper (PyObject *self, const Duration &cycleTime)
 
 PyUnitWrapper (PyObject *self, const Duration &cycleTime, uint32 flags)
 
virtual ~PyUnitWrapper ()
 
void checkinCycleTime (const std::string &ns, const std::string &name, const Duration &cycleTime)
 
void checkin (const std::string &ns, const std::string &name)
 
void checkout ()
 
boost::python::handle self ()
 
void reflect (BaseReflectorWrapper &r)
 
void initialize ()
 
void process ()
 
void finalize ()
 
void bootup (const std::string &message)
 
void warning (const std::string &category, const std::string &message)
 
void error (const std::string &category, const std::string &message)
 
void ok (const std::string &category)
 
void spin ()
 
std::string getNamespace ()
 
std::string getName ()
 
std::string getGlobalName ()
 
std::string getID ()
 
std::string getGlobalID ()
 
const DurationgetCycleTime ()
 
const Authority::FlagsgetAuthorityFlags ()
 
uint32 getAuthorityFlagsAsUInt32 ()
 
std::string resolveName (const std::string &name)
 
bool waitForService (const std::string &service)
 
bool waitForServiceDuration (const std::string &service, const Duration &d)
 
std::string waitForServiceInterface (const std::string &service)
 
std::string waitForServiceInterfaceDuration (const std::string &service, const Duration &d)
 
bool existsService (const std::string &service)
 
boost::python::list queryServicesForInterface (const std::string &interface)
 
void publishService ()
 
bool doesChannelExist (const std::string &channelID)
 
bool waitForChannel (const std::string &channelID)
 
bool waitForChannelDuration (const std::string &channelID, const Duration &d)
 
mira::Channel< void > getChannel (const std::string &channelID)
 
Pose2 getTransform2Latest (const std::string &target, const std::string &source)
 
Pose2 getTransform2 (const std::string &target, const std::string &source, const Time &time)
 
Pose3 getTransform3Latest (const std::string &target, const std::string &source)
 
Pose3 getTransform3 (const std::string &target, const std::string &source, const Time &time)
 
void publishTransform2Now (const std::string &node, const Pose2 &t)
 
void publishTransform2 (const std::string &node, const Pose2 &t, const Time &timestamp)
 
void publishTransform3Now (const std::string &node, const Pose3 &t)
 
void publishTransform3 (const std::string &node, const Pose3 &t, const Time &timestamp)
 
void publishTransformIndirect2Now (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Pose2 &transform)
 
void publishTransformIndirect2 (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Pose2 &transform, const Time &timestamp)
 
void publishTransformIndirect3Now (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Pose3 &transform)
 
void publishTransformIndirect3 (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Pose3 &transform, const Time &timestamp)
 
void addTransformLink (const std::string &childID, const std::string &parentID)
 
boost::python::object channelPublish (const std::string &channelID, boost::python::object type)
 Untyped publish method that is called from the unit or from the entity that wants to publish directly. More...
 
boost::python::object subscribe (const std::string &channelID, boost::python::object type)
 Untyped subscribe method that is called from the unit or from the entity that wants to subscribe directly. More...
 
boost::python::object subscribeCb (const std::string &channelID, boost::python::object type, boost::python::object callable)
 See above. More...
 
boost::python::object subscribeIntervalCb (const std::string &channelID, boost::python::object type, boost::python::object callable, const Duration &storageDuration)
 See above. More...
 
void unsubscribe (const std::string &channelID, boost::python::object type)
 Untyped unsubscribe method that is called from the unit. More...
 
bool isSubscribedOn (const std::string &channelID)
 Check if subscribed on the channel. More...
 
void setUnit (PyUnit *unit)
 
PyUnitgetUnit ()
 
PyUnitgetUnitPtr ()
 
bool isValid () const
 

Protected Member Functions

template<typename T >
Channel< T > subscribe_internal (const std::string &channelID, boost::python::object callable, const Duration &storageDuration)
 Typed subscribe method that is called from within the subscribe methods contained in the type wrappers. More...
 
template<typename T >
Channel< T > subscribe_internal (const std::string &channelID, boost::python::object callable)
 Typed subscribe method that is called from within the subscribe methods contained in the type wrappers. More...
 
template<typename T >
Channel< T > subscribe_internal (const std::string &channelID)
 Typed subscribe method that is called from within the subscribe methods contained in the type wrappers. More...
 
template<typename T >
void unsubscribe_internal (const std::string &channelID)
 Typed unsubscribe method that is called from within the unsubscribe methods contained in the type wrappers. More...
 
template<typename T >
Channel< T > publish_internal (const std::string &channelID)
 Typed publish method that is called from within the subscribe methods contained in the type wrappers. More...
 

Protected Attributes

PyObject * mSelf
 
Duration mCycleTime
 
Authority::Flags mFlags
 
std::vector< boost::shared_ptr< BaseCallback > > mCallbacks
 

Friends

template<typename T >
Channel< T > subscribe (PyUnitWrapper &unit, const std::string &channelID)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > subscribeCb (PyUnitWrapper &unit, const std::string &channelID, boost::python::object callable)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > subscribeIntervalCb (PyUnitWrapper &unit, const std::string &channelID, boost::python::object callable, const Duration &storageDuration)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > publish (PyUnitWrapper &unit, const std::string &channelID)
 Typed publish method every wrapped type must contain. More...
 
template<typename T >
void unsubscribe (PyUnitWrapper &unit, const std::string &channelID)
 Typed unsubscribe method every wrapped type must contain. More...
 

Constructor & Destructor Documentation

◆ PyUnitWrapper() [1/4]

PyUnitWrapper ( PyObject *  self)
inline

◆ PyUnitWrapper() [2/4]

PyUnitWrapper ( PyObject *  self,
uint32  flags 
)
inline

◆ PyUnitWrapper() [3/4]

PyUnitWrapper ( PyObject *  self,
const Duration cycleTime 
)
inline

◆ PyUnitWrapper() [4/4]

PyUnitWrapper ( PyObject *  self,
const Duration cycleTime,
uint32  flags 
)
inline

◆ ~PyUnitWrapper()

virtual ~PyUnitWrapper ( )
virtual

Member Function Documentation

◆ checkinCycleTime()

void checkinCycleTime ( const std::string &  ns,
const std::string &  name,
const Duration cycleTime 
)

◆ checkin()

void checkin ( const std::string &  ns,
const std::string &  name 
)
inline

◆ checkout()

void checkout ( )

◆ self()

boost::python::handle self ( )
inline

◆ reflect()

void reflect ( BaseReflectorWrapper r)
virtual

Implements PyUnitWrapperBase.

◆ initialize()

void initialize ( )
virtual

Implements PyUnitWrapperBase.

◆ process()

void process ( )
virtual

Implements PyUnitWrapperBase.

◆ finalize()

void finalize ( )
virtual

Implements PyUnitWrapperBase.

◆ bootup()

void bootup ( const std::string &  message)

◆ warning()

void warning ( const std::string &  category,
const std::string &  message 
)

◆ error()

void error ( const std::string &  category,
const std::string &  message 
)

◆ ok()

void ok ( const std::string &  category)

◆ spin()

void spin ( )

◆ getNamespace()

std::string getNamespace ( )

◆ getName()

std::string getName ( )

◆ getGlobalName()

std::string getGlobalName ( )

◆ getID()

std::string getID ( )

◆ getGlobalID()

std::string getGlobalID ( )

◆ getCycleTime()

const Duration& getCycleTime ( )

◆ getAuthorityFlags()

const Authority::Flags& getAuthorityFlags ( )

◆ getAuthorityFlagsAsUInt32()

uint32 getAuthorityFlagsAsUInt32 ( )

◆ resolveName()

std::string resolveName ( const std::string &  name)

◆ waitForService()

bool waitForService ( const std::string &  service)

◆ waitForServiceDuration()

bool waitForServiceDuration ( const std::string &  service,
const Duration d 
)

◆ waitForServiceInterface()

std::string waitForServiceInterface ( const std::string &  service)

◆ waitForServiceInterfaceDuration()

std::string waitForServiceInterfaceDuration ( const std::string &  service,
const Duration d 
)

◆ existsService()

bool existsService ( const std::string &  service)

◆ queryServicesForInterface()

boost::python::list queryServicesForInterface ( const std::string &  interface)

◆ publishService()

void publishService ( )

◆ doesChannelExist()

bool doesChannelExist ( const std::string &  channelID)

◆ waitForChannel()

bool waitForChannel ( const std::string &  channelID)

◆ waitForChannelDuration()

bool waitForChannelDuration ( const std::string &  channelID,
const Duration d 
)

◆ getChannel()

mira::Channel<void> getChannel ( const std::string &  channelID)

◆ getTransform2Latest()

Pose2 getTransform2Latest ( const std::string &  target,
const std::string &  source 
)

◆ getTransform2()

Pose2 getTransform2 ( const std::string &  target,
const std::string &  source,
const Time time 
)

◆ getTransform3Latest()

Pose3 getTransform3Latest ( const std::string &  target,
const std::string &  source 
)

◆ getTransform3()

Pose3 getTransform3 ( const std::string &  target,
const std::string &  source,
const Time time 
)

◆ publishTransform2Now()

void publishTransform2Now ( const std::string &  node,
const Pose2 t 
)

◆ publishTransform2()

void publishTransform2 ( const std::string &  node,
const Pose2 t,
const Time timestamp 
)

◆ publishTransform3Now()

void publishTransform3Now ( const std::string &  node,
const Pose3 t 
)

◆ publishTransform3()

void publishTransform3 ( const std::string &  node,
const Pose3 t,
const Time timestamp 
)

◆ publishTransformIndirect2Now()

void publishTransformIndirect2Now ( const std::string &  frameID,
const std::string &  targetID,
const std::string &  sourceID,
const Pose2 transform 
)

◆ publishTransformIndirect2()

void publishTransformIndirect2 ( const std::string &  frameID,
const std::string &  targetID,
const std::string &  sourceID,
const Pose2 transform,
const Time timestamp 
)

◆ publishTransformIndirect3Now()

void publishTransformIndirect3Now ( const std::string &  frameID,
const std::string &  targetID,
const std::string &  sourceID,
const Pose3 transform 
)

◆ publishTransformIndirect3()

void publishTransformIndirect3 ( const std::string &  frameID,
const std::string &  targetID,
const std::string &  sourceID,
const Pose3 transform,
const Time timestamp 
)

◆ addTransformLink()

void addTransformLink ( const std::string &  childID,
const std::string &  parentID 
)

◆ channelPublish()

boost::python::object channelPublish ( const std::string &  channelID,
boost::python::object  type 
)

Untyped publish method that is called from the unit or from the entity that wants to publish directly.

This method calls the typed publish method of the passed type object.

◆ subscribe()

boost::python::object subscribe ( const std::string &  channelID,
boost::python::object  type 
)

Untyped subscribe method that is called from the unit or from the entity that wants to subscribe directly.

If type is None, an untyped subscribe is called. If type is a primitive type, a subscribe with the respective primitive type is done. If type is a type wrapper, this method calls the typed subscribe method of that type wrapper.

◆ subscribeCb()

boost::python::object subscribeCb ( const std::string &  channelID,
boost::python::object  type,
boost::python::object  callable 
)

See above.

Further, a callback can be provided.

◆ subscribeIntervalCb()

boost::python::object subscribeIntervalCb ( const std::string &  channelID,
boost::python::object  type,
boost::python::object  callable,
const Duration storageDuration 
)

See above.

Subscribes on a channel toFurther, a callback can be provided.

◆ unsubscribe()

void unsubscribe ( const std::string &  channelID,
boost::python::object  type 
)

Untyped unsubscribe method that is called from the unit.

◆ isSubscribedOn()

bool isSubscribedOn ( const std::string &  channelID)

Check if subscribed on the channel.

◆ subscribe_internal() [1/3]

Channel<T> subscribe_internal ( const std::string &  channelID,
boost::python::object  callable,
const Duration storageDuration 
)
inlineprotected

Typed subscribe method that is called from within the subscribe methods contained in the type wrappers.

◆ subscribe_internal() [2/3]

Channel<T> subscribe_internal ( const std::string &  channelID,
boost::python::object  callable 
)
inlineprotected

Typed subscribe method that is called from within the subscribe methods contained in the type wrappers.

◆ subscribe_internal() [3/3]

Channel<T> subscribe_internal ( const std::string &  channelID)
inlineprotected

Typed subscribe method that is called from within the subscribe methods contained in the type wrappers.

This version does not include a callable method.

◆ unsubscribe_internal()

void unsubscribe_internal ( const std::string &  channelID)
inlineprotected

Typed unsubscribe method that is called from within the unsubscribe methods contained in the type wrappers.

◆ publish_internal()

Channel<T> publish_internal ( const std::string &  channelID)
inlineprotected

Typed publish method that is called from within the subscribe methods contained in the type wrappers.

◆ setUnit()

void setUnit ( PyUnit unit)
inlineinherited

◆ getUnit()

PyUnit& getUnit ( )
inlineinherited

◆ getUnitPtr()

PyUnit* getUnitPtr ( )
inlineinherited

◆ isValid()

bool isValid ( ) const
inlineinherited

Friends And Related Function Documentation

◆ subscribe

Channel<T> subscribe ( PyUnitWrapper unit,
const std::string &  channelID 
)
friend

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally. Same as above without callable object.

◆ subscribeCb

Channel<T> subscribeCb ( PyUnitWrapper unit,
const std::string &  channelID,
boost::python::object  callable 
)
friend

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ subscribeIntervalCb

Channel<T> subscribeIntervalCb ( PyUnitWrapper unit,
const std::string &  channelID,
boost::python::object  callable,
const Duration storageDuration 
)
friend

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ publish

Channel<T> publish ( PyUnitWrapper unit,
const std::string &  channelID 
)
friend

Typed publish method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ unsubscribe

void unsubscribe ( PyUnitWrapper unit,
const std::string &  channelID 
)
friend

Typed unsubscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally. Same as above without callable object.

Member Data Documentation

◆ mSelf

PyObject* mSelf
protected

◆ mCycleTime

Duration mCycleTime
protected

◆ mFlags

Authority::Flags mFlags
protected

◆ mCallbacks

std::vector<boost::shared_ptr<BaseCallback> > mCallbacks
protected

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