namespace mrpt::hwdrivers::testing

Overview

namespace testing {

// classes

class FakeTcpDevice;
class MockStream;

// global variables

constexpr char STX = 0x02;
constexpr char ETX = 0x03;

// global functions

std::string scanTelegram(
    const std::vector<unsigned>& rangesMm,
    const std::string& status = "0",
    const std::string& channel = "DIST1"
    );

template <class SENSOR>
void pollScan(
    SENSOR& sensor,
    bool& thereIsObs,
    mrpt::obs::CObservation2DRangeScan& obs,
    bool& hwError
    );

template <class SENSOR>
mrpt::hwdrivers::CGenericSensor::TListObservations pollObservations(SENSOR& sensor);

} // namespace testing

Global Functions

std::string scanTelegram(
    const std::vector<unsigned>& rangesMm,
    const std::string& status = "0",
    const std::string& channel = "DIST1"
    )

A “sRA LMDscandata” telegram with the given ranges (in millimeters), status word and data channel name.

Tokens 1..26 follow the layout the driver expects, then one hexadecimal number per range.

template <class SENSOR>
void pollScan(
    SENSOR& sensor,
    bool& thereIsObs,
    mrpt::obs::CObservation2DRangeScan& obs,
    bool& hwError
    )

The drivers give the device only a few tens of milliseconds to answer each scan request, and a busy machine may miss one: real users call the driver repeatedly, so do the same, up to a limit.

template <class SENSOR>
mrpt::hwdrivers::CGenericSensor::TListObservations pollObservations(SENSOR& sensor)

Like pollScan(), through the generic sensor interface.