Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
mrpt::hwdrivers::CSickLaserUSB Class Referenceabstract

Detailed Description

This "software driver" implements the communication protocol for interfacing a SICK LMS2XX laser scanners through a custom USB RS-422 interface board.

NOTE that this class is for a custom hardware built at our lab (MAPIR, University of Malaga). For a generic serial interface, see the class CSickLaserSerial.

This class does not need to be bind, i.e. you do not need to call C2DRangeFinderAbstract::bindIO. However, calling it will have not effect. In this class the "bind" is ignored since it is designed for USB connections only, thus it internally generate the required object for simplicity of use. The serial number of the USB device is used to open it on the first call to "doProcess", thus you must call "loadConfig" before this, or manually call "setDeviceSerialNumber". The default serial number is "LASER001"

Warning: Avoid defining an object of this class in a global scope if you want to catch all potential exceptions during the constructors (like USB interface DLL not found, etc...)

PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
SICKUSB_serialNumber=LASER001
pose_x=0.21 ; Laser range scaner 3D position in the robot (meters)
pose_y=0
pose_z=0.34
pose_yaw=0 ; Angles in degrees
pose_pitch=0
pose_roll=0
//preview = true // Enable GUI visualization of captured data
// Optional: Exclusion zones to avoid the robot seeing itself:
//exclusionZone1_x = 0.20 0.30 0.30 0.20
//exclusionZone1_y = 0.20 0.30 0.30 0.20
// Optional: Exclusion zones to avoid the robot seeing itself:
//exclusionAngles1_ini = 20 // Deg
//exclusionAngles1_end = 25 // Deg

Definition at line 65 of file CSickLaserUSB.h.

#include <mrpt/hwdrivers/CSickLaserUSB.h>

Inheritance diagram for mrpt::hwdrivers::CSickLaserUSB:
Inheritance graph

Public Types

enum  TSensorState { ssInitializing = 0, ssWorking, ssError }
 The current state of the sensor. More...
 
using Ptr = std::shared_ptr< CGenericSensor >
 
using TListObservations = std::multimap< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr >
 
using TListObsPair = std::pair< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr >
 

Public Member Functions

 CSickLaserUSB ()
 Constructor. More...
 
virtual ~CSickLaserUSB ()
 Destructor. More...
 
void setDeviceSerialNumber (const std::string &deviceSerialNumber)
 Changes the serial number of the device to open (call prior to 'doProcess') More...
 
void doProcessSimple (bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
 Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it. More...
 
bool turnOn ()
 Enables the scanning mode (in this class this has no effect). More...
 
bool turnOff ()
 Disables the scanning mode (in this class this has no effect). More...
 
void showPreview (bool enable=true)
 Enables GUI visualization in real-time. More...
 
void bindIO (mrpt::io::CStream *streamIO)
 Binds the object to a given I/O channel. More...
 
void getObservation (bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
 Get the last observation from the sensor, if available, and unmarks it as being "the last one" (thus a new scan must arrive or subsequent calls will find no new observations). More...
 
void doProcess ()
 Main method for a CGenericSensor. More...
 
virtual const mrpt::hwdrivers::TSensorClassIdGetRuntimeClass () const =0
 
TSensorState getState () const
 The current state of the sensor
More...
 
double getProcessRate () const
 
std::string getSensorLabel () const
 
void setSensorLabel (const std::string &sensorLabel)
 
void enableVerbose (bool enabled=true)
 Enable or disable extra debug info dumped to std::cout during sensor operation. More...
 
bool isVerboseEnabled () const
 
void loadConfig (const mrpt::config::CConfigFileBase &configSource, const std::string &section)
 Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific". More...
 
virtual void initialize ()
 This method can or cannot be implemented in the derived class, depending on the need for it. More...
 
void getObservations (TListObservations &lstObjects)
 Returns a list of enqueued objects, emptying it (thread-safe). More...
 
virtual void setPathForExternalImages (const std::string &directory)
 Set the path where to save off-rawlog image files (will be ignored in those sensors where this is not applicable). More...
 
void setExternalImageFormat (const std::string &ext)
 Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg". More...
 
void setExternalImageJPEGQuality (const unsigned int quality)
 The quality of JPEG compression, when external images is enabled and the format is "jpg". More...
 
unsigned int getExternalImageJPEGQuality () const
 

Static Public Member Functions

static void registerClass (const TSensorClassId *pNewClass)
 Register a class into the internal list of "CGenericSensor" descendents. More...
 
static CGenericSensorcreateSensor (const std::string &className)
 Creates a sensor by a name of the class. More...
 
static CGenericSensor::Ptr createSensorPtr (const std::string &className)
 Just like createSensor, but returning a smart pointer to the newly created sensor object. More...
 

Static Public Attributes

static mrpt::system::TConsoleColor logging_levels_to_colors [NUMBER_OF_VERBOSITY_LEVELS]
 Map from VerbosityLevels to their corresponding mrpt::system::TConsoleColor. More...
 
static std::string logging_levels_to_names [NUMBER_OF_VERBOSITY_LEVELS]
 Map from VerbosityLevels to their corresponding names. More...
 

Protected Member Functions

void loadConfig_sensorSpecific (const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
 See the class documentation at the top for expected parameters. More...
 
void loadCommonParams (const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
 Should be call by derived classes at "loadConfig" (loads exclusion areas AND exclusion angles). More...
 
void filterByExclusionAreas (mrpt::obs::CObservation2DRangeScan &obs) const
 Mark as invalid those points which (x,y) coordinates fall within the exclusion polygons. More...
 
void filterByExclusionAngles (mrpt::obs::CObservation2DRangeScan &obs) const
 Mark as invalid those ranges in a set of forbiden angle ranges. More...
 
void processPreview (const mrpt::obs::CObservation2DRangeScan &obs)
 Must be called inside the capture method to allow optional GUI preview of scans. More...
 
void appendObservations (const std::vector< mrpt::serialization::CSerializable::Ptr > &obj)
 This method must be called by derived classes to enqueue a new observation in the list to be returned by getObservations. More...
 
void appendObservation (const mrpt::serialization::CSerializable::Ptr &obj)
 Like appendObservations() but for just one observation. More...
 

Protected Attributes

mrpt::io::CStreamm_stream
 The I/O channel (will be nullptr if not bound). More...
 
VerbosityLevel m_min_verbosity_level
 Provided messages with VerbosityLevel smaller than this value shall be ignored. More...
 
size_t m_grab_decimation_counter
 Used when "m_grab_decimation" is enabled. More...
 
TSensorState m_state
 
bool m_verbose
 
std::string m_path_for_external_images
 The path where to save off-rawlog images: empty means save images embedded in the rawlog. More...
 
std::string m_external_images_format
 The extension ("jpg","gif","png",...) that determines the format of images saved externally. More...
 
unsigned int m_external_images_jpeg_quality
 For JPEG images, the quality (default=95%). More...
 

Private Types

using registered_sensor_classes_t = std::map< std::string, const TSensorClassId * >
 Used in registerClass. More...
 

Private Member Functions

bool checkControllerIsConnected ()
 
bool waitContinuousSampleFrame (std::vector< float > &ranges, unsigned char &LMS_status, uint32_t &out_board_timestamp, bool &is_mm_mode)
 
std::string generateStringFromFormat (const char *fmt, va_list argp) const
 Helper method for generating a std::string instance from printf-like arguments. More...
 

Static Private Member Functions

static registered_sensor_classes_tget_registered_sensor_classes ()
 Access to singleton. More...
 

Private Attributes

mrpt::comms::CInterfaceFTDIm_usbConnection
 
std::string m_serialNumber
 
uint32_t m_timeStartUI
 Time of the first data packet, for synchronization purposes. More...
 
mrpt::system::TTimeStamp m_timeStartTT
 
poses::CPose3D m_sensorPose
 The sensor 6D pose: More...
 
mrpt::obs::CObservation2DRangeScan m_lastObservation
 
bool m_lastObservationIsNew
 
bool m_hardwareError
 
std::mutex m_csChangeStream
 For being thread-safe. More...
 
std::mutex m_csLastObservation
 
mrpt::obs::CObservation2DRangeScan::Ptr m_nextObservation
 A dynamic object used as buffer in doProcess. More...
 
mrpt::obs::CObservation2DRangeScan::TListExclusionAreasWithRanges m_lstExclusionPolys
 A list of optional exclusion polygons, in coordinates relative to the vehicle, that is, taking into account the "sensorPose". More...
 
std::vector< std::pair< double, double > > m_lstExclusionAngles
 A list of pairs of angles <init,end> such as all sensor ranges falling in those forbiden angles will be marked as invalid. More...
 
bool m_showPreview
 If true, shows a 3D window with a preview of the grabber data. More...
 
mrpt::gui::CDisplayWindow3D::Ptr m_win
 
std::string m_logger_name
 
std::deque< TMsgm_history
 
std::deque< output_logger_callback_t > m_listCallbacks
 
std::mutex m_csObjList
 The critical section for m_objList. More...
 
TListObservations m_objList
 The queue of objects to be returned by getObservations. More...
 

Logging methods

void logStr (const VerbosityLevel level, const std::string &msg_str) const
 Main method to add the specified message string to the logger. More...
 
void logFmt (const VerbosityLevel level, const char *fmt,...) const MRPT_printf_format_check(3
 Alternative logging method, which mimics the printf behavior. More...
 
void void logCond (const VerbosityLevel level, bool cond, const std::string &msg_str) const
 Log the given message only if the condition is satisfied. More...
 
void setLoggerName (const std::string &name)
 Set the name of the COutputLogger instance. More...
 
std::string getLoggerName () const
 Return the name of the COutputLogger instance. More...
 
void setMinLoggingLevel (const VerbosityLevel level)
 Set the minimum logging level for which the incoming logs are going to be taken into account. More...
 
void setVerbosityLevel (const VerbosityLevel level)
 alias of setMinLoggingLevel() More...
 
VerbosityLevel getMinLoggingLevel () const
 
bool isLoggingLevelVisible (VerbosityLevel level) const
 
void getLogAsString (std::string &log_contents) const
 Fill the provided string with the contents of the logger's history in std::string representation. More...
 
std::string getLogAsString () const
 Get the history of COutputLogger instance in a string representation. More...
 
void writeLogToFile (const std::string *fname_in=NULL) const
 Write the contents of the COutputLogger instance to an external file. More...
 
void dumpLogToConsole () const
 Dump the current contents of the COutputLogger instance in the terminal window. More...
 
std::string getLoggerLastMsg () const
 Return the last Tmsg instance registered in the logger history. More...
 
void getLoggerLastMsg (std::string &msg_str) const
 Fill inputtted string with the contents of the last message in history. More...
 
void loggerReset ()
 Reset the contents of the logger instance. More...
 
void logRegisterCallback (output_logger_callback_t userFunc)
 
bool logDeregisterCallback (output_logger_callback_t userFunc)
 
bool logging_enable_console_output
 [Default=true] Set it to false in case you don't want the logged messages to be dumped to the output automatically. More...
 
bool logging_enable_keep_record
 [Default=false] Enables storing all messages into an internal list. More...
 

Member Typedef Documentation

◆ Ptr

using mrpt::hwdrivers::CGenericSensor::Ptr = std::shared_ptr<CGenericSensor>
inherited

Definition at line 73 of file CGenericSensor.h.

◆ registered_sensor_classes_t

Used in registerClass.

Definition at line 124 of file CGenericSensor.h.

◆ TListObservations

Definition at line 77 of file CGenericSensor.h.

◆ TListObsPair

Definition at line 79 of file CGenericSensor.h.

Member Enumeration Documentation

◆ TSensorState

The current state of the sensor.

See also
CGenericSensor::getState
Enumerator
ssInitializing 
ssWorking 
ssError 

Definition at line 84 of file CGenericSensor.h.

Constructor & Destructor Documentation

◆ CSickLaserUSB()

CSickLaserUSB::CSickLaserUSB ( )

Constructor.

Definition at line 33 of file CSickLaserUSB.cpp.

References mrpt::hwdrivers::CGenericSensor::m_sensorLabel, m_usbConnection, MRPT_END, and MRPT_START.

◆ ~CSickLaserUSB()

CSickLaserUSB::~CSickLaserUSB ( )
virtual

Destructor.

Definition at line 45 of file CSickLaserUSB.cpp.

References m_usbConnection.

Member Function Documentation

◆ appendObservation()

void mrpt::hwdrivers::CGenericSensor::appendObservation ( const mrpt::serialization::CSerializable::Ptr obj)
inlineprotectedinherited

◆ appendObservations()

void CGenericSensor::appendObservations ( const std::vector< mrpt::serialization::CSerializable::Ptr > &  obj)
protectedinherited

This method must be called by derived classes to enqueue a new observation in the list to be returned by getObservations.

Passed objects must be created in dynamic memory and a smart pointer passed. Example of creation:

mrpt::obs::CObservationGPS::Ptr o = CObservationGPS::Ptr( new
CObservationGPS() );
o-> .... // Set data

If several observations are passed at once in the vector, they'll be considered as a block regarding the grabbing decimation factor.

Definition at line 53 of file CGenericSensor.cpp.

References CLASS_ID, mrpt::hwdrivers::CGenericSensor::m_csObjList, mrpt::hwdrivers::CGenericSensor::m_grab_decimation, mrpt::hwdrivers::CGenericSensor::m_grab_decimation_counter, mrpt::hwdrivers::CGenericSensor::m_objList, and THROW_EXCEPTION.

Referenced by mrpt::hwdrivers::CGenericSensor::appendObservation(), mrpt::hwdrivers::CNationalInstrumentsDAQ::doProcess(), and mrpt::hwdrivers::CKinect::doProcess().

◆ bindIO()

void C2DRangeFinderAbstract::bindIO ( mrpt::io::CStream streamIO)
inherited

Binds the object to a given I/O channel.

The stream object must not be deleted before the destruction of this class.

See also
comms::CSerialPort

Definition at line 43 of file C2DRangeFinderAbstract.cpp.

References mrpt::hwdrivers::C2DRangeFinderAbstract::m_csChangeStream, and mrpt::hwdrivers::C2DRangeFinderAbstract::m_stream.

Referenced by mrpt::hwdrivers::CHokuyoURG::ensureStreamIsOpen().

◆ checkControllerIsConnected()

bool CSickLaserUSB::checkControllerIsConnected ( )
private

◆ createSensor()

CGenericSensor * CGenericSensor::createSensor ( const std::string className)
staticinherited

Creates a sensor by a name of the class.

Typically the user may want to create a smart pointer around the returned pointer, whis is made with:

Returns
A pointer to a new class, or nullptr if class name is unknown.

Definition at line 103 of file CGenericSensor.cpp.

References mrpt::hwdrivers::CGenericSensor::get_registered_sensor_classes().

Referenced by mrpt::hwdrivers::CGenericSensor::createSensorPtr().

◆ createSensorPtr()

static CGenericSensor::Ptr mrpt::hwdrivers::CGenericSensor::createSensorPtr ( const std::string className)
inlinestaticinherited

Just like createSensor, but returning a smart pointer to the newly created sensor object.

Definition at line 219 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::createSensor().

◆ doProcess()

void C2DRangeFinderAbstract::doProcess ( )
virtualinherited

◆ doProcessSimple()

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

◆ dumpLogToConsole()

void COutputLogger::dumpLogToConsole ( ) const
inherited

Dump the current contents of the COutputLogger instance in the terminal window.

See also
writeToFile

Definition at line 179 of file COutputLogger.cpp.

◆ enableVerbose()

void mrpt::hwdrivers::CGenericSensor::enableVerbose ( bool  enabled = true)
inlineinherited

Enable or disable extra debug info dumped to std::cout during sensor operation.

Default: disabled unless the environment variable "MRPT_HWDRIVERS_VERBOSE" is set to "1" during object creation.

Definition at line 105 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_verbose.

◆ filterByExclusionAngles()

void C2DRangeFinderAbstract::filterByExclusionAngles ( mrpt::obs::CObservation2DRangeScan obs) const
protectedinherited

◆ filterByExclusionAreas()

void C2DRangeFinderAbstract::filterByExclusionAreas ( mrpt::obs::CObservation2DRangeScan obs) const
protectedinherited

◆ generateStringFromFormat()

std::string COutputLogger::generateStringFromFormat ( const char *  fmt,
va_list  argp 
) const
privateinherited

Helper method for generating a std::string instance from printf-like arguments.

Definition at line 99 of file COutputLogger.cpp.

References mrpt::system::os::vsnprintf().

◆ get_registered_sensor_classes()

CGenericSensor::registered_sensor_classes_t & CGenericSensor::get_registered_sensor_classes ( )
staticprivateinherited

◆ getExternalImageJPEGQuality()

unsigned int mrpt::hwdrivers::CGenericSensor::getExternalImageJPEGQuality ( ) const
inlineinherited

◆ getLogAsString() [1/2]

std::string COutputLogger::getLogAsString ( ) const
inherited

Get the history of COutputLogger instance in a string representation.

Definition at line 148 of file COutputLogger.cpp.

Referenced by mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::getDescriptiveReport().

◆ getLogAsString() [2/2]

void COutputLogger::getLogAsString ( std::string log_contents) const
inherited

Fill the provided string with the contents of the logger's history in std::string representation.

Definition at line 143 of file COutputLogger.cpp.

◆ getLoggerLastMsg() [1/2]

std::string COutputLogger::getLoggerLastMsg ( ) const
inherited

Return the last Tmsg instance registered in the logger history.

Definition at line 184 of file COutputLogger.cpp.

References mrpt::system::COutputLogger::TMsg::getAsString().

◆ getLoggerLastMsg() [2/2]

void COutputLogger::getLoggerLastMsg ( std::string msg_str) const
inherited

Fill inputtted string with the contents of the last message in history.

Definition at line 190 of file COutputLogger.cpp.

◆ getLoggerName()

std::string COutputLogger::getLoggerName ( ) const
inherited

Return the name of the COutputLogger instance.

See also
setLoggerName

Definition at line 132 of file COutputLogger.cpp.

Referenced by mrpt::system::COutputLogger::TMsg::TMsg().

◆ getMinLoggingLevel()

VerbosityLevel mrpt::system::COutputLogger::getMinLoggingLevel ( ) const
inlineinherited

◆ getObservation()

void C2DRangeFinderAbstract::getObservation ( bool &  outThereIsObservation,
mrpt::obs::CObservation2DRangeScan outObservation,
bool &  hardwareError 
)
inherited

Get the last observation from the sensor, if available, and unmarks it as being "the last one" (thus a new scan must arrive or subsequent calls will find no new observations).

Definition at line 53 of file C2DRangeFinderAbstract.cpp.

References mrpt::hwdrivers::C2DRangeFinderAbstract::m_csLastObservation, mrpt::hwdrivers::C2DRangeFinderAbstract::m_hardwareError, mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservation, and mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservationIsNew.

◆ getObservations()

void CGenericSensor::getObservations ( TListObservations lstObjects)
inherited

Returns a list of enqueued objects, emptying it (thread-safe).

The objects must be freed by the invoker.

Definition at line 91 of file CGenericSensor.cpp.

References mrpt::hwdrivers::CGenericSensor::m_csObjList, and mrpt::hwdrivers::CGenericSensor::m_objList.

◆ getProcessRate()

double mrpt::hwdrivers::CGenericSensor::getProcessRate ( ) const
inlineinherited

Definition at line 93 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_process_rate.

◆ GetRuntimeClass()

virtual const mrpt::hwdrivers::TSensorClassId* mrpt::hwdrivers::CGenericSensor::GetRuntimeClass ( ) const
pure virtualinherited

◆ getSensorLabel()

std::string mrpt::hwdrivers::CGenericSensor::getSensorLabel ( ) const
inlineinherited

Definition at line 94 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_sensorLabel.

◆ getState()

TSensorState mrpt::hwdrivers::CGenericSensor::getState ( ) const
inlineinherited

The current state of the sensor

Definition at line 92 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_state.

◆ initialize()

virtual void mrpt::hwdrivers::CGenericSensor::initialize ( )
inlinevirtualinherited

◆ isLoggingLevelVisible()

bool mrpt::system::COutputLogger::isLoggingLevelVisible ( VerbosityLevel  level) const
inlineinherited

◆ isVerboseEnabled()

bool mrpt::hwdrivers::CGenericSensor::isVerboseEnabled ( ) const
inlineinherited

Definition at line 106 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_verbose.

◆ loadCommonParams()

void C2DRangeFinderAbstract::loadCommonParams ( const mrpt::config::CConfigFileBase configSource,
const std::string iniSection 
)
protectedinherited

Should be call by derived classes at "loadConfig" (loads exclusion areas AND exclusion angles).

This loads a sequence of vertices of a polygon given by its (x,y) coordinates relative to the vehicle, that is, taking into account the "sensorPose".

  • exclusionZoneu_x
  • exclusionZoneu_y for u=1,2,3,... All points within the 2D polygon will be ignored, for any Z, unless an optional entry is found:
  • exclusionZoneu_z=[z_min z_max] In that case, only the points within the 2D polygon AND the given range in Z will be ignored.

The number of zones is variable, but they must start at 1 and be consecutive.

This also loads any other common params (e.g. 'preview')

See also
filterByExclusionAreas

Definition at line 98 of file C2DRangeFinderAbstract.cpp.

References ASSERT_, ASSERTMSG_, mrpt::DEG2RAD(), mrpt::format(), mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionAngles, mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionPolys, M_PI, mrpt::hwdrivers::C2DRangeFinderAbstract::m_showPreview, mrpt::config::CConfigFileBase::read_bool(), mrpt::config::CConfigFileBase::read_double(), and mrpt::config::CConfigFileBase::read_vector().

Referenced by loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboPeakLidar::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserSerial::loadConfig_sensorSpecific(), and mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific().

◆ loadConfig()

void CGenericSensor::loadConfig ( const mrpt::config::CConfigFileBase cfg,
const std::string sect 
)
inherited

◆ loadConfig_sensorSpecific()

void CSickLaserUSB::loadConfig_sensorSpecific ( const mrpt::config::CConfigFileBase configSource,
const std::string iniSection 
)
protectedvirtual

◆ logCond()

void COutputLogger::logCond ( const VerbosityLevel  level,
bool  cond,
const std::string msg_str 
) const
inherited

Log the given message only if the condition is satisfied.

See also
log, logFmt

Definition at line 120 of file COutputLogger.cpp.

◆ logDeregisterCallback()

bool COutputLogger::logDeregisterCallback ( output_logger_callback_t  userFunc)
inherited
Returns
true if an entry was found and deleted.

Definition at line 287 of file COutputLogger.cpp.

References getAddress().

◆ logFmt()

void COutputLogger::logFmt ( const VerbosityLevel  level,
const char *  fmt,
  ... 
) const
inherited

◆ loggerReset()

void COutputLogger::loggerReset ( )
inherited

Reset the contents of the logger instance.

Called upon construction.

Definition at line 195 of file COutputLogger.cpp.

References mrpt::system::LVL_INFO.

◆ logRegisterCallback()

void COutputLogger::logRegisterCallback ( output_logger_callback_t  userFunc)
inherited

Definition at line 274 of file COutputLogger.cpp.

◆ logStr()

void COutputLogger::logStr ( const VerbosityLevel  level,
const std::string msg_str 
) const
inherited

◆ processPreview()

void C2DRangeFinderAbstract::processPreview ( const mrpt::obs::CObservation2DRangeScan obs)
protectedinherited

◆ registerClass()

void CGenericSensor::registerClass ( const TSensorClassId pNewClass)
staticinherited

Register a class into the internal list of "CGenericSensor" descendents.

Used internally in the macros DEFINE_GENERIC_SENSOR, etc...

Can be used as "CGenericSensor::registerClass( SENSOR_CLASS_ID(CMySensor) );" if building custom sensors outside mrpt libraries in user code.

Definition at line 121 of file CGenericSensor.cpp.

References mrpt::hwdrivers::TSensorClassId::className, and mrpt::hwdrivers::CGenericSensor::get_registered_sensor_classes().

Referenced by mrpt::hwdrivers::CGenericSensor::CLASSINIT_GENERIC_SENSOR::CLASSINIT_GENERIC_SENSOR().

◆ setDeviceSerialNumber()

void mrpt::hwdrivers::CSickLaserUSB::setDeviceSerialNumber ( const std::string deviceSerialNumber)
inline

Changes the serial number of the device to open (call prior to 'doProcess')

Definition at line 104 of file CSickLaserUSB.h.

References m_serialNumber.

◆ setExternalImageFormat()

void mrpt::hwdrivers::CGenericSensor::setExternalImageFormat ( const std::string ext)
inlineinherited

Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg".

See also
setPathForExternalImages, setExternalImageJPEGQuality

Definition at line 278 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_external_images_format.

◆ setExternalImageJPEGQuality()

void mrpt::hwdrivers::CGenericSensor::setExternalImageJPEGQuality ( const unsigned int  quality)
inlineinherited

The quality of JPEG compression, when external images is enabled and the format is "jpg".

See also
setExternalImageFormat

Definition at line 285 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality.

◆ setLoggerName()

void COutputLogger::setLoggerName ( const std::string name)
inherited

◆ setMinLoggingLevel()

void COutputLogger::setMinLoggingLevel ( const VerbosityLevel  level)
inherited

Set the minimum logging level for which the incoming logs are going to be taken into account.

String messages with specified VerbosityLevel smaller than the min, will not be outputted to the screen and neither will a record of them be stored in by the COutputLogger instance

Definition at line 133 of file COutputLogger.cpp.

Referenced by mrpt::maps::CRandomFieldGridMap2D::enableVerbose(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::hwdrivers::CHokuyoURG::initialize(), and mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::loadParams().

◆ setPathForExternalImages()

virtual void mrpt::hwdrivers::CGenericSensor::setPathForExternalImages ( const std::string directory)
inlinevirtualinherited

Set the path where to save off-rawlog image files (will be ignored in those sensors where this is not applicable).

An empty string (the default value at construction) means to save images embedded in the rawlog, instead of on separate files.

Exceptions
std::exceptionIf the directory doesn't exists and cannot be created.

Reimplemented in mrpt::hwdrivers::CCameraSensor, mrpt::hwdrivers::CKinect, mrpt::hwdrivers::COpenNI2Sensor, mrpt::hwdrivers::COpenNI2_RGBD360, and mrpt::hwdrivers::CSwissRanger3DCamera.

Definition at line 267 of file CGenericSensor.h.

References MRPT_UNUSED_PARAM.

◆ setSensorLabel()

void mrpt::hwdrivers::CGenericSensor::setSensorLabel ( const std::string sensorLabel)
inlineinherited

Definition at line 95 of file CGenericSensor.h.

References mrpt::hwdrivers::CGenericSensor::m_sensorLabel.

◆ setVerbosityLevel()

void COutputLogger::setVerbosityLevel ( const VerbosityLevel  level)
inherited

◆ showPreview()

void mrpt::hwdrivers::C2DRangeFinderAbstract::showPreview ( bool  enable = true)
inlineinherited

Enables GUI visualization in real-time.

Definition at line 120 of file C2DRangeFinderAbstract.h.

References mrpt::hwdrivers::C2DRangeFinderAbstract::m_showPreview.

◆ turnOff()

bool CSickLaserUSB::turnOff ( )
virtual

Disables the scanning mode (in this class this has no effect).

Returns
If everything works "true", or "false" if there is any error.

Implements mrpt::hwdrivers::C2DRangeFinderAbstract.

Definition at line 156 of file CSickLaserUSB.cpp.

◆ turnOn()

bool CSickLaserUSB::turnOn ( )
virtual

Enables the scanning mode (in this class this has no effect).

Returns
If everything works "true", or "false" if there is any error.

Implements mrpt::hwdrivers::C2DRangeFinderAbstract.

Definition at line 152 of file CSickLaserUSB.cpp.

◆ waitContinuousSampleFrame()

bool CSickLaserUSB::waitContinuousSampleFrame ( std::vector< float > &  ranges,
unsigned char &  LMS_status,
uint32_t out_board_timestamp,
bool &  is_mm_mode 
)
private

◆ writeLogToFile()

void COutputLogger::writeLogToFile ( const std::string fname_in = NULL) const
inherited

Write the contents of the COutputLogger instance to an external file.

Upon call to this method, COutputLogger dumps the contents of all the logged commands so far to the specified external file. By default the filename is set to ${LOGGERNAME}.log except if the fname parameter is provided

See also
dumpToConsole, getAsString

Definition at line 154 of file COutputLogger.cpp.

References ASSERTMSG_, and mrpt::format().

Member Data Documentation

◆ logging_enable_console_output

bool mrpt::system::COutputLogger::logging_enable_console_output
inherited

[Default=true] Set it to false in case you don't want the logged messages to be dumped to the output automatically.

Definition at line 239 of file system/COutputLogger.h.

◆ logging_enable_keep_record

bool mrpt::system::COutputLogger::logging_enable_keep_record
inherited

[Default=false] Enables storing all messages into an internal list.

See also
writeLogToFile, getLogAsString

Definition at line 242 of file system/COutputLogger.h.

◆ logging_levels_to_colors

mrpt::system::TConsoleColor COutputLogger::logging_levels_to_colors
staticinherited
Initial value:

Map from VerbosityLevels to their corresponding mrpt::system::TConsoleColor.

Implementation file for the COutputLogger header class.

Handy for coloring the input based on the verbosity of the message

Definition at line 124 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::TMsg::dumpToConsole().

◆ logging_levels_to_names

std::string COutputLogger::logging_levels_to_names
staticinherited
Initial value:
=
{
"DEBUG",
"INFO ",
"WARN ",
"ERROR"
}

Map from VerbosityLevels to their corresponding names.

Handy for printing the current message VerbosityLevel along with the actual content

Definition at line 129 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::TMsg::getAsString().

◆ m_csChangeStream

std::mutex mrpt::hwdrivers::C2DRangeFinderAbstract::m_csChangeStream
privateinherited

For being thread-safe.

Definition at line 53 of file C2DRangeFinderAbstract.h.

Referenced by mrpt::hwdrivers::C2DRangeFinderAbstract::bindIO().

◆ m_csLastObservation

std::mutex mrpt::hwdrivers::C2DRangeFinderAbstract::m_csLastObservation
privateinherited

◆ m_csObjList

std::mutex mrpt::hwdrivers::CGenericSensor::m_csObjList
privateinherited

The critical section for m_objList.

Definition at line 118 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CGenericSensor::appendObservations(), and mrpt::hwdrivers::CGenericSensor::getObservations().

◆ m_external_images_format

std::string mrpt::hwdrivers::CGenericSensor::m_external_images_format
protectedinherited

The extension ("jpg","gif","png",...) that determines the format of images saved externally.

See also
setPathForExternalImages

Definition at line 157 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CSwissRanger3DCamera::getNextObservation(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), and mrpt::hwdrivers::CGenericSensor::setExternalImageFormat().

◆ m_external_images_jpeg_quality

unsigned int mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality
protectedinherited

◆ m_grab_decimation

size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation
protectedinherited

If set to N>=2, only 1 out of N observations will be saved to m_objList.

Definition at line 138 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CGenericSensor::appendObservations(), and mrpt::hwdrivers::CGenericSensor::loadConfig().

◆ m_grab_decimation_counter

size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation_counter
protectedinherited

Used when "m_grab_decimation" is enabled.

Definition at line 145 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CGenericSensor::appendObservations(), and mrpt::hwdrivers::CGenericSensor::loadConfig().

◆ m_hardwareError

bool mrpt::hwdrivers::C2DRangeFinderAbstract::m_hardwareError
privateinherited

◆ m_history

std::deque<TMsg> mrpt::system::COutputLogger::m_history
mutableprivateinherited

Definition at line 312 of file system/COutputLogger.h.

◆ m_lastObservation

mrpt::obs::CObservation2DRangeScan mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservation
privateinherited

◆ m_lastObservationIsNew

bool mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservationIsNew
privateinherited

◆ m_listCallbacks

std::deque<output_logger_callback_t> mrpt::system::COutputLogger::m_listCallbacks
privateinherited

Definition at line 314 of file system/COutputLogger.h.

◆ m_logger_name

std::string mrpt::system::COutputLogger::m_logger_name
privateinherited

Definition at line 310 of file system/COutputLogger.h.

◆ m_lstExclusionAngles

std::vector<std::pair<double, double> > mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionAngles
privateinherited

A list of pairs of angles <init,end> such as all sensor ranges falling in those forbiden angles will be marked as invalid.

Definition at line 64 of file C2DRangeFinderAbstract.h.

Referenced by mrpt::hwdrivers::C2DRangeFinderAbstract::filterByExclusionAngles(), and mrpt::hwdrivers::C2DRangeFinderAbstract::loadCommonParams().

◆ m_lstExclusionPolys

mrpt::obs::CObservation2DRangeScan::TListExclusionAreasWithRanges mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionPolys
privateinherited

A list of optional exclusion polygons, in coordinates relative to the vehicle, that is, taking into account the "sensorPose".

Definition at line 61 of file C2DRangeFinderAbstract.h.

Referenced by mrpt::hwdrivers::C2DRangeFinderAbstract::filterByExclusionAreas(), and mrpt::hwdrivers::C2DRangeFinderAbstract::loadCommonParams().

◆ m_max_queue_len

size_t mrpt::hwdrivers::CGenericSensor::m_max_queue_len
protectedinherited

See CGenericSensor.

Definition at line 135 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CGenericSensor::loadConfig().

◆ m_min_verbosity_level

VerbosityLevel mrpt::system::COutputLogger::m_min_verbosity_level
protectedinherited

Provided messages with VerbosityLevel smaller than this value shall be ignored.

Definition at line 252 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::getMinLoggingLevel(), and mrpt::system::COutputLogger::isLoggingLevelVisible().

◆ m_nextObservation

mrpt::obs::CObservation2DRangeScan::Ptr mrpt::hwdrivers::C2DRangeFinderAbstract::m_nextObservation
privateinherited

A dynamic object used as buffer in doProcess.

Definition at line 56 of file C2DRangeFinderAbstract.h.

Referenced by mrpt::hwdrivers::C2DRangeFinderAbstract::doProcess().

◆ m_objList

TListObservations mrpt::hwdrivers::CGenericSensor::m_objList
privateinherited

◆ m_path_for_external_images

std::string mrpt::hwdrivers::CGenericSensor::m_path_for_external_images
protectedinherited

The path where to save off-rawlog images: empty means save images embedded in the rawlog.

Definition at line 154 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CSwissRanger3DCamera::getNextObservation(), and mrpt::hwdrivers::CSwissRanger3DCamera::setPathForExternalImages().

◆ m_process_rate

double mrpt::hwdrivers::CGenericSensor::m_process_rate
protectedinherited

◆ m_sensorLabel

std::string mrpt::hwdrivers::CGenericSensor::m_sensorLabel
protectedinherited

See CGenericSensor.

Definition at line 140 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CCANBusReader::CCANBusReader(), mrpt::hwdrivers::CGPSInterface::CGPSInterface(), mrpt::hwdrivers::CGyroKVHDSP3000::CGyroKVHDSP3000(), mrpt::hwdrivers::CHokuyoURG::CHokuyoURG(), mrpt::hwdrivers::CIMUIntersense::CIMUIntersense(), mrpt::hwdrivers::CIMUXSens::CIMUXSens(), mrpt::hwdrivers::CIMUXSens_MT4::CIMUXSens_MT4(), mrpt::hwdrivers::CKinect::CKinect(), mrpt::hwdrivers::CNationalInstrumentsDAQ::CNationalInstrumentsDAQ(), mrpt::hwdrivers::CRoboPeakLidar::CRoboPeakLidar(), mrpt::hwdrivers::CSickLaserSerial::CSickLaserSerial(), CSickLaserUSB(), mrpt::hwdrivers::CSkeletonTracker::CSkeletonTracker(), mrpt::hwdrivers::CSwissRanger3DCamera::CSwissRanger3DCamera(), mrpt::hwdrivers::CVelodyneScanner::CVelodyneScanner(), mrpt::hwdrivers::CIMUXSens_MT4::doProcess(), mrpt::hwdrivers::CIMUXSens::doProcess(), mrpt::hwdrivers::CGyroKVHDSP3000::doProcess(), mrpt::hwdrivers::CIMUIntersense::doProcess(), mrpt::hwdrivers::CSkeletonTracker::doProcess(), mrpt::hwdrivers::CRoboPeakLidar::doProcessSimple(), doProcessSimple(), mrpt::hwdrivers::CCANBusReader::doProcessSimple(), mrpt::hwdrivers::CSickLaserSerial::doProcessSimple(), mrpt::hwdrivers::CHokuyoURG::doProcessSimple(), mrpt::hwdrivers::CGPSInterface::flushParsedMessagesNow(), mrpt::hwdrivers::CSwissRanger3DCamera::getNextObservation(), mrpt::hwdrivers::CKinect::getNextObservation(), mrpt::hwdrivers::CVelodyneScanner::getNextObservation(), mrpt::hwdrivers::CGenericSensor::getSensorLabel(), mrpt::hwdrivers::CNationalInstrumentsDAQ::grabbing_thread(), mrpt::hwdrivers::CGenericSensor::loadConfig(), mrpt::hwdrivers::CSkeletonTracker::processPreview(), mrpt::hwdrivers::C2DRangeFinderAbstract::processPreview(), mrpt::hwdrivers::CSkeletonTracker::processPreviewNone(), and mrpt::hwdrivers::CGenericSensor::setSensorLabel().

◆ m_sensorPose

poses::CPose3D mrpt::hwdrivers::CSickLaserUSB::m_sensorPose
private

The sensor 6D pose:

Definition at line 79 of file CSickLaserUSB.h.

Referenced by doProcessSimple(), and loadConfig_sensorSpecific().

◆ m_serialNumber

std::string mrpt::hwdrivers::CSickLaserUSB::m_serialNumber
private

◆ m_showPreview

bool mrpt::hwdrivers::C2DRangeFinderAbstract::m_showPreview
privateinherited

◆ m_state

TSensorState mrpt::hwdrivers::CGenericSensor::m_state
protectedinherited

◆ m_stream

mrpt::io::CStream* mrpt::hwdrivers::C2DRangeFinderAbstract::m_stream
protectedinherited

◆ m_timeStartTT

mrpt::system::TTimeStamp mrpt::hwdrivers::CSickLaserUSB::m_timeStartTT
private

Definition at line 75 of file CSickLaserUSB.h.

Referenced by doProcessSimple().

◆ m_timeStartUI

uint32_t mrpt::hwdrivers::CSickLaserUSB::m_timeStartUI
private

Time of the first data packet, for synchronization purposes.

Definition at line 74 of file CSickLaserUSB.h.

Referenced by doProcessSimple(), and waitContinuousSampleFrame().

◆ m_usbConnection

mrpt::comms::CInterfaceFTDI* mrpt::hwdrivers::CSickLaserUSB::m_usbConnection
private

◆ m_verbose

bool mrpt::hwdrivers::CGenericSensor::m_verbose
protectedinherited

◆ m_win

mrpt::gui::CDisplayWindow3D::Ptr mrpt::hwdrivers::C2DRangeFinderAbstract::m_win
privateinherited
mrpt::hwdrivers::CGenericSensor::Ptr
std::shared_ptr< CGenericSensor > Ptr
Definition: CGenericSensor.h:73
mrpt::system::COutputLogger::logStr
void logStr(const VerbosityLevel level, const std::string &msg_str) const
Main method to add the specified message string to the logger.
Definition: COutputLogger.cpp:61
mrpt::system::CONCOL_GREEN
@ CONCOL_GREEN
Definition: os.h:179
mrpt::system::CONCOL_BLUE
@ CONCOL_BLUE
Definition: os.h:178
mrpt::system::CONCOL_RED
@ CONCOL_RED
Definition: os.h:180
mrpt::hwdrivers::CGenericSensor::createSensor
static CGenericSensor * createSensor(const std::string &className)
Creates a sensor by a name of the class.
Definition: CGenericSensor.cpp:103
mrpt::system::COutputLogger::logFmt
void logFmt(const VerbosityLevel level, const char *fmt,...) const MRPT_printf_format_check(3
Alternative logging method, which mimics the printf behavior.
Definition: COutputLogger.cpp:80
mrpt::format
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
mrpt::obs::CObservationGPS::Ptr
std::shared_ptr< CObservationGPS > Ptr
Definition: CObservationGPS.h:72
mrpt::hwdrivers::CGenericSensor::appendObservation
void appendObservation(const mrpt::serialization::CSerializable::Ptr &obj)
Like appendObservations() but for just one observation.
Definition: CGenericSensor.h:179
mrpt::system::CONCOL_NORMAL
@ CONCOL_NORMAL
Definition: os.h:177
in
GLuint in
Definition: glext.h:7274
range
GLsizei range
Definition: glext.h:5907



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST