29 m_sensorLabel(
"UNNAMED_SENSOR"),
30 m_grab_decimation_counter(0),
31 m_state( ssInitializing ),
33 m_path_for_external_images (),
34 m_external_images_format (
"png"),
35 m_external_images_jpeg_quality (95)
37 const char * sVerbose = getenv(
"MRPT_HWDRIVERS_VERBOSE");
38 m_verbose = (sVerbose!=NULL) && atoi(sVerbose)!=0;
61 for (
size_t i=0;i<objs.size();i++)
63 const CSerializablePtr &
obj = objs[i];
71 timestamp = CActionPtr(
obj)->timestamp;
76 timestamp = CObservationPtr(
obj)->timestamp;
107 return it==regs.end() ? NULL : it->second->ptrCreateObject();
123 regs[ pNewClass->
className ] = pNewClass;
TListObservations m_objList
The queue of objects to be returned by getObservations.
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
void appendObservations(const std::vector< mrpt::utils::CSerializablePtr > &obj)
This method must be called by derived classes to enqueue a new observation in the list to be returned...
size_t m_grab_decimation_counter
Used when "m_grab_decimation" is enabled.
A class acquiring a CCriticalSection at its constructor, and releasing it at destructor.
double m_process_rate
See CGenericSensor.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
synch::CCriticalSection m_csObjList
The critical section for m_objList.
std::multimap< mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > TListObservations
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
std::string m_sensorLabel
See CGenericSensor.
#define THROW_EXCEPTION(msg)
Contains classes for various device interfaces.
void getObservations(TListObservations &lstObjects)
Returns a list of enqueued objects, emptying it (thread-safe).
static CGenericSensor * createSensor(const std::string &className)
Creates a sensor by a name of the class.
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
GLsizei GLsizei GLuint * obj
void loadConfig(const mrpt::utils::CConfigFileBase &configSource, const std::string §ion)
Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensor...
This class allows loading and storing values and vectors of different types from a configuration text...
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
virtual ~CGenericSensor()
Destructor.
const char * className
Class name.
static void registerClass(const TSensorClassId *pNewClass)
Register a class into the internal list of "CGenericSensor" descendents.
static registered_sensor_classes_t & get_registered_sensor_classes()
Access to singleton.
This namespace contains representation of robot actions and observations.
std::map< std::string, const TSensorClassId * > registered_sensor_classes_t
Used in registerClass.
size_t m_max_queue_len
See CGenericSensor.
GLsizei const GLchar ** string
Declares a class for storing a robot action.
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
virtual void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string §ion)=0
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes)
size_t m_grab_decimation
If set to N>=2, only 1 out of N observations will be saved to m_objList.
std::pair< mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > TListObsPair
Declares a class that represents any robot's observation.
double read_double(const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const
class HWDRIVERS_IMPEXP CGenericSensor
A structure for runtime ID class type information in the context of hwdrivers::CGenericSensor.