class mrpt::apps::CRawlogProcessorFilterObservations

A specialization of CRawlogProcessorOnEachObservation that handles the common case of filtering entries in a rawlog depending on the return value of a user function.

#include <mrpt/apps/CRawlogProcessor.h>

class CRawlogProcessorFilterObservations: public mrpt::apps::CRawlogProcessorOnEachObservation
{
public:
    //
fields

    mrpt::io::CFileGZOutputStream& m_out_rawlog;
    size_t m_entries_removed;
    size_t m_entries_parsed;
    bool m_we_are_done_with_this_rawlog;

    // construction

    CRawlogProcessorFilterObservations(
        mrpt::io::CFileGZInputStream& in_rawlog,
        TCLAP::CmdLine& cmdline,
        bool enable_verbose,
        mrpt::io::CFileGZOutputStream& out_rawlog
        );

    //
methods

    virtual bool tellIfThisObsPasses(mrpt::obs::CObservation::Ptr& obs) = 0;
    virtual bool tellIfThisActPasses(mrpt::obs::CAction::Ptr&);
    virtual bool processOneObservation(mrpt::obs::CObservation::Ptr& obs);
    virtual bool processOneAction(mrpt::obs::CAction::Ptr& act);

    void OnPostProcess(
        mrpt::obs::CActionCollection::Ptr& actions,
        mrpt::obs::CSensoryFrame::Ptr& SF,
        mrpt::obs::CObservation::Ptr& obs
        );
};

Inherited Members

public:
    //
fields

    uint64_t m_filSize;
    size_t m_rawlogEntry;
    double m_timToParse;

    //
methods

    virtual bool processOneEntry(mrpt::obs::CActionCollection::Ptr& actions, mrpt::obs::CSensoryFrame::Ptr& SF, mrpt::obs::CObservation::Ptr& obs) = 0;
    virtual bool processOneEntry(mrpt::obs::CActionCollection::Ptr& actions, mrpt::obs::CSensoryFrame::Ptr& SF, mrpt::obs::CObservation::Ptr& obs);
    virtual bool processOneObservation(mrpt::obs::CObservation::Ptr& obs) = 0;
    virtual bool processOneAction(mrpt::obs::CAction::Ptr&);
    void doProcessRawlog();
    virtual void OnPostProcess(] mrpt::obs::CActionCollection::Ptr& actions, ] mrpt::obs::CSensoryFrame::Ptr& SF, ] mrpt::obs::CObservation::Ptr& obs);

Fields

bool m_we_are_done_with_this_rawlog

Set to true to indicate that we are sure we don’t have to keep on reading.

Methods

virtual bool tellIfThisObsPasses(mrpt::obs::CObservation::Ptr& obs) = 0

To be implemented by users: return false means entry must be removed.

virtual bool tellIfThisActPasses(mrpt::obs::CAction::Ptr&)

To be implemented by users: return false means entry must be removed.