rci::Synchronizer Class Reference

Synchronizer Different synchronizers may be for example: * Update with a given frequency ** Send data every time ** Send only if new data * Update only if new data (event-based) * Triggered from robot side (e.g. More...

#include <Synchronizer.h>

Collaboration diagram for rci::Synchronizer:

List of all members.

Public Member Functions

 Synchronizer (const std::string &name)
virtual ~Synchronizer ()
virtual void process ()
 Synchronous processing (synchronisation of commands and sensor values with the robot).
virtual void processAsync ()=0
 Asynchronous processing (synchronisation of commands and sensor values with the robot).
virtual void waitForProcessAsync ()=0
 Waits until asynchronous processing (synchronisation of commands and sensor values with the robot) is done.
virtual bool start ()
 Starts synchronizing.
virtual bool stop ()
 Stops synchronizing, e.g.
virtual bool tooBusy () const
 Returns, if the synchronizer is (too) busy right now.

Protected Attributes

bool _onlyReceive
 Only true for the first time.
bool busy
std::string name

Friends

std::ostream & operator<< (std::ostream &os, const Synchronizer &val)

Detailed Description

Synchronizer Different synchronizers may be for example: * Update with a given frequency ** Send data every time ** Send only if new data * Update only if new data (event-based) * Triggered from robot side (e.g.

FRI)

Definition at line 49 of file Synchronizer.h.


Constructor & Destructor Documentation

rci::Synchronizer::Synchronizer ( const std::string &  name  ) 

Definition at line 33 of file Synchronizer.cpp.

rci::Synchronizer::~Synchronizer (  )  [virtual]

Definition at line 37 of file Synchronizer.cpp.


Member Function Documentation

void rci::Synchronizer::process (  )  [virtual]

Synchronous processing (synchronisation of commands and sensor values with the robot).

After calling this, you can safely access new sensor values. Generic implementation of this method calls processAsync and then waitForProcessAsync.

Definition at line 40 of file Synchronizer.cpp.

References processAsync(), and waitForProcessAsync().

Here is the call graph for this function:

virtual void rci::Synchronizer::processAsync (  )  [pure virtual]

Asynchronous processing (synchronisation of commands and sensor values with the robot).

This method will return immediately, you will have to waitForProcessAsync to finish to have new sensor values and safely access them.

Referenced by process().

Here is the caller graph for this function:

bool rci::Synchronizer::start (  )  [virtual]

Starts synchronizing.

For some backends this has to be stopped, e.g. for control mode switches.

Definition at line 45 of file Synchronizer.cpp.

References busy.

bool rci::Synchronizer::stop (  )  [virtual]

Stops synchronizing, e.g.

to have time for control mode switches.

Definition at line 50 of file Synchronizer.cpp.

References busy.

bool rci::Synchronizer::tooBusy (  )  const [virtual]

Returns, if the synchronizer is (too) busy right now.

This is important to know in case of robots where control has to be paused in order to make a certain action (e.g. control mode switch).

Definition at line 55 of file Synchronizer.cpp.

References busy.

virtual void rci::Synchronizer::waitForProcessAsync (  )  [pure virtual]

Waits until asynchronous processing (synchronisation of commands and sensor values with the robot) is done.

You will need for this to know that new sensor values arrived and you can read them savely.

Referenced by process().

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Synchronizer val 
) [friend]

Member Data Documentation

Only true for the first time.

Definition at line 108 of file Synchronizer.h.

bool rci::Synchronizer::busy [protected]

Definition at line 113 of file Synchronizer.h.

Referenced by start(), stop(), and tooBusy().

std::string rci::Synchronizer::name [protected]

Definition at line 118 of file Synchronizer.h.


The documentation for this class was generated from the following files:
Generated on Thu Aug 2 14:03:08 2012 for RCI by  doxygen 1.6.3