class mola::FrontEndBase

Overview

Virtual interface for SLAM front-ends.

Instructions for implementing new front-ends: Raw observations arrive via calls to the virtual method onNewObservation(), which must be implemented. Minimum time should be spent there, just copy the incoming data (smart pointer). Actual processing can be normally done by any of these two ways:

  • Wait until spinOnce() is called, at the rate specified in the yaml file (default=1 Hz), or

  • Use your own logic to enqueue a task into a worker thread pool (preferred).

#include <FrontEndBase.h>

class FrontEndBase:
    public mola::ExecutableBase,
    public mola::RawDataConsumer
{
public:
    // methods

    virtual void onNewObservation(const CObservation::Ptr& o) = 0;
    virtual void initialize(const Yaml& cfg);
};

// direct descendants

class LidarOdometry;

Inherited Members

public:
    // methods

    virtual void initialize(const Yaml& cfg) = 0;

Methods

virtual void onNewObservation(const CObservation::Ptr& o) = 0

To be called whenever a new observation arrives. It should return as fast as possible, enqueuing the data for processing in another thread.

virtual void initialize(const Yaml& cfg)

Loads common parameters for all front-ends.

These parameters are handled here:

  • raw_data_source : A list of one (e.g. raw_data_source: ‘moduleName ) or multiple (e.g. raw_data_source: [moduleName1, moduleName2]`) MOLA module names to which to subscribe for input raw observations.

Recall that module names are given in the name: field of the mola-cli launch YAML file.

Note that no individual sensor label is read in this abstract class since it is up to the derived classes to specify whether to subscribe to one or more sensor sources, and use descriptive names in the case of multiple sensors.