class mrpt::hwdrivers::CSICKTim561Eth

#include <mrpt/hwdrivers/CSICKTim561Eth_2050101.h>

class CSICKTim561Eth: public mrpt::hwdrivers::C2DRangeFinderAbstract
{
public:
    // construction

    CSICKTim561Eth(std::string _ip = std::string("192.168.0.1"), unsigned int _port = 2111);

    //
methods

    virtual void doProcessSimple(
        bool& outThereIsObservation,
        mrpt::obs::CObservation2DRangeScan& outObservation,
        bool& hardwareError
        );

    virtual bool turnOn();
    virtual bool turnOff();
    bool rebootDev();
    void setSensorPose(const mrpt::poses::CPose3D& _pose);
    virtual void doProcess();
    virtual void initialize();
};

Inherited Members

public:
    // enums

    enum TSensorState;

    // structs

    struct TMsg;

    //
fields

    bool logging_enable_console_output {true};
    bool logging_enable_keep_record {false};

    //
methods

    CGenericSensor& operator = (const CGenericSensor&);
    virtual void doProcess() = 0;
    void logStr(const VerbosityLevel level, std::string_view msg_str) const;
    void logFmt(const VerbosityLevel level, const char* fmt, ...) const;
    void void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const;
    void setLoggerName(const std::string& name);
    std::string getLoggerName() const;
    void setMinLoggingLevel(const VerbosityLevel level);
    void setVerbosityLevel(const VerbosityLevel level);
    VerbosityLevel getMinLoggingLevel() const;
    void getLogAsString(std::string& log_contents) const;
    std::string getLogAsString() const;
    void writeLogToFile(const std::optional<std::string> fname_in = std::nullopt) const;
    void dumpLogToConsole() const;
    std::string getLoggerLastMsg() const;
    void getLoggerLastMsg(std::string& msg_str) const;
    void loggerReset();
    bool logDeregisterCallback(output_logger_callback_t userFunc);
    void showPreview(bool enable = true);
    void bindIO(const std::shared_ptr<mrpt::io::CStream>& streamIO);
    void getObservation(bool& outThereIsObservation, mrpt::obs::CObservation2DRangeScan& outObservation, bool& hardwareError);
    virtual void doProcess();

    virtual void doProcessSimple(
        bool& outThereIsObservation,
        mrpt::obs::CObservation2DRangeScan& outObservation,
        bool& hardwareError
        ) = 0;

    virtual bool turnOn() = 0;
    virtual bool turnOff() = 0;
    double getEstimatedScanPeriod() const;
    TSensorState getState() const;
    void enableVerbose(bool enabled = true);
    void loadConfig(const mrpt::config::CConfigFileBase& configSource, const std::string& section);
    virtual void initialize();
    void getObservations(TListObservations& lstObjects);
    TListObservations getObservations();
    virtual void setPathForExternalImages(] const std::string& directory);
    void setExternalImageFormat(const std::string& ext);
    void setExternalImageJPEGQuality(const unsigned int quality);
    static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors();
    static std::array<std::string, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names();
    static void registerClass(const TSensorClassId* pNewClass);
    static CGenericSensor* createSensor(const std::string& className);
    static Ptr createSensorPtr(const std::string& className);

Construction

CSICKTim561Eth(
    std::string _ip = std::string("192.168.0.1"),
    unsigned int _port = 2111
    )

Constructor.

Default Lidar IP: 192.168.0.1 Default IP_port: 2111 Maximum Range: 10 Meters Default SensorPose: Depend on robot(0, 270, 105)mm, orientation(0, 21.25, 0)

Note that there is default arguments, here you can customize IP Adress and TCP Port of your device

Methods

virtual void doProcessSimple(
    bool& outThereIsObservation,
    mrpt::obs::CObservation2DRangeScan& outObservation,
    bool& hardwareError
    )

This function acquire a laser scan from the device.

If an error occured, hardwareError will be set to true. The new laser scan will be stored in the outObservation argument.

Parameters:

This

method throw exception if the frame received from the TIM 561 contain the following bad parameters:

  • Status is not OK

  • Data in the scan aren’t DIST1(may be RSSIx or DIST2).

virtual bool turnOn()

This method must be called before trying to get a laser scan.

virtual bool turnOff()

This method could be called manually to stop communication with the device.

Method is also called by destructor.

bool rebootDev()

This method could be called manually to reboot the device.

void setSensorPose(const mrpt::poses::CPose3D& _pose)

A method to set the sensor pose on the robot.

Equivalent to setting the sensor pose via loading it from a config file.

virtual void doProcess()

This method must be called periodically.

Period depend on the process_rate in the configuration file.

virtual void initialize()

Initialize the sensor according to the parameters previously read in the configuration file.