DetectorGraph  2.0
Public Member Functions | List of all members
DetectorGraph::Lag< T > Class Template Reference

Produces a Lagged<T> for T. More...

Collaboration diagram for DetectorGraph::Lag< T >:

Public Member Functions

 Lag (Graph *graph)
 
virtual void Evaluate (const T &currentTopicState)
 Pure-virtual method that should Evaluate a piece of input data. More...
 
- Public Member Functions inherited from DetectorGraph::Detector
 Detector (Graph *graph)
 Constructor. More...
 
virtual ~Detector ()
 Destructor. More...
 
virtual VertexType GetVertexType () const
 Returns kDetectorVertex to identify this subclass of Vertex. More...
 
void ProcessVertex ()
 Consume data in the topics. More...
 
- Public Member Functions inherited from DetectorGraph::Vertex
 Vertex ()
 
virtual ~Vertex ()
 
VertexSearchState GetState () const
 
void SetState (VertexSearchState aNewState)
 
void InsertEdge (Vertex *aVertex)
 
void RemoveEdge (Vertex *aVertex)
 
VertexPtrContainerGetOutEdges ()
 
void MarkFutureEdge (Vertex *aVertex)
 
VertexPtrContainerGetInEdges ()
 
VertexPtrContainerGetFutureOutEdges ()
 
VertexPtrContainerGetFutureInEdges ()
 
const char * GetName () const
 
- Public Member Functions inherited from DetectorGraph::FuturePublisher< Lagged< T > >
 FuturePublisher ()
 
void SetGraph (Graph *aGraph)
 
void PublishOnFutureEvaluation (const Lagged< T > &aData)
 Publish a new version of T to the Graph for future evaluation. More...
 

Additional Inherited Members

- Public Types inherited from DetectorGraph::Vertex
enum  VertexSearchState { kVertexClear, kVertexProcessing, kVertexDone }
 Enum used for topological sort & traverse context keeping. More...
 
enum  VertexType { kTopicVertex, kDetectorVertex, kTestVertex }
 
typedef std::list< Vertex * > VertexPtrContainer
 
- Protected Member Functions inherited from DetectorGraph::Detector
template<class TTopicState >
void Subscribe (SubscriberInterface< TTopicState > *aSubscriber)
 Setup an subscription on a specific topic. More...
 
template<class TTopic >
void SetupPublishing (Publisher< TTopic > *aPublisher)
 Setup an advertisement on a specific topic. More...
 
template<class TTopic >
void SetupFuturePublishing (FuturePublisher< TTopic > *aFuturePublisher)
 Setup an future advertisement on a specific topic. More...
 
template<class TTopic >
void SetupTimeoutPublishing (TimeoutPublisher< TTopic > *aTimeoutPublisher, TimeoutPublisherService *aTimeoutPublisherService)
 Setup an timeout advertisement on a specific topic. More...
 
template<class TTopic >
void SetupPeriodicPublishing (const uint64_t aPeriodInMilliseconds, TimeoutPublisherService *aTimeoutPublisherService)
 Setup an periodic advertisement on a specific topic. More...
 
virtual void BeginEvaluation ()
 Called before any calls to SubscriberInterface::Evaluate. More...
 
virtual void CompleteEvaluation ()
 Called after all calls to SubscriberInterface::Evaluate. More...
 
- Protected Attributes inherited from DetectorGraph::Vertex
VertexSearchState mState
 
VertexPtrContainer mOutEdges
 
VertexPtrContainer mInEdges
 
VertexPtrContainer mFutureOutEdges
 
VertexPtrContainer mFutureInEdges
 
- Protected Attributes inherited from DetectorGraph::FuturePublisher< Lagged< T > >
GraphmGraph
 

Detailed Description

template<class T>
class DetectorGraph::Lag< T >

Produces a Lagged<T> for T.

This is a utility detector (and topic template) that performs a 1-lag on a TopicState. It's meant to enable closing feedback loops in a graph in an expressive and transparent way. It creates a Detector with the following relationships:

Lag

Adding a Lag<T> Detector to a graph is done simply by adding it to a graph as shown (from this example) below:

class RobotBrain : public ProcessorContainer
{
public:
RobotBrain()
: mPosePredictor(&mGraph)
, mKalmanPoseCorrector(&mGraph)
, mBeliefFeedback(&mGraph)
{
}
ExtendedKalmanPosePredictor mPosePredictor;
KalmanPoseCorrector mKalmanPoseCorrector;
Lag<LocalizationBelief> mBeliefFeedback;

Lagged<T> can then be used in any detector. In the same example:

class KalmanPoseCorrector : public Detector,
public SubscriberInterface< Lagged<LocalizationBelief> >,
public SubscriberInterface<GPSPosition>,
public Publisher<LocalizationBelief>
{
public:
KalmanPoseCorrector(Graph* graph) : Detector(graph), mCurrentBelief()
{
Subscribe< Lagged<LocalizationBelief> >(this);
Subscribe<GPSPosition>(this);
SetupPublishing<LocalizationBelief>(this);
}

Definition at line 93 of file lag.hpp.

Constructor & Destructor Documentation

◆ Lag()

template<class T>
DetectorGraph::Lag< T >::Lag ( Graph graph)
inline

Definition at line 98 of file lag.hpp.

Member Function Documentation

◆ Evaluate()

template<class T>
virtual void DetectorGraph::Lag< T >::Evaluate ( const T &  )
inlinevirtual

Pure-virtual method that should Evaluate a piece of input data.

Implements DetectorGraph::SubscriberInterface< T >.

Definition at line 104 of file lag.hpp.


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