class mrpt::hwdrivers::CSICKTim561Eth
Overview
#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: // typedefs typedef std::shared_ptr<CGenericSensor> Ptr; typedef std::multimap<mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr> TListObservations; typedef std::pair<mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr> TListObsPair; // enums enum TSensorState; // structs struct TMsg; // fields bool logging_enable_console_output {true}; bool logging_enable_keep_record {false}; // methods 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 setVerbosityLevel(const VerbosityLevel level); void setVerbosityLevelForCallbacks(const VerbosityLevel level); void setMinLoggingLevel(const VerbosityLevel level); VerbosityLevel getMinLoggingLevel() const; VerbosityLevel getMinLoggingLevelForCallbacks() const; bool isLoggingLevelVisible(VerbosityLevel level) 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(); void logRegisterCallback(output_logger_callback_t userFunc); bool logDeregisterCallback(output_logger_callback_t userFunc); COutputLogger& operator = (const COutputLogger&); COutputLogger& operator = (COutputLogger&&); static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors(); static const std::array<const char*, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names(); virtual const mrpt::hwdrivers::TSensorClassId* GetRuntimeClass() const = 0; TSensorState getState() const; double getProcessRate() const; std::string getSensorLabel() const; void setSensorLabel(const std::string& sensorLabel); void enableVerbose(bool enabled = true); bool isVerboseEnabled() const; CGenericSensor& operator = (const CGenericSensor&); virtual void loadConfig(const mrpt::config::CConfigFileBase& configSource, const std::string& section); virtual void initialize(); virtual void doProcess() = 0; virtual TListObservations getObservations(); virtual void setPathForExternalImages(] const std::string& directory); virtual void setExternalImageFormat(const std::string& ext); virtual void setExternalImageJPEGQuality(const unsigned int quality); virtual unsigned int getExternalImageJPEGQuality() const; static void registerClass(const TSensorClassId* pNewClass); static CGenericSensor* createSensor(const std::string& className); static Ptr createSensorPtr(const std::string& className); 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;
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 occurred, 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:
|
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.