Go to the documentation of this file.
25 CGenericSensor::CGenericSensor()
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 !=
nullptr) && atoi(sVerbose) != 0;
54 const std::vector<mrpt::serialization::CSerializable::Ptr>& objs)
62 for (
size_t i = 0; i < objs.size(); i++)
72 timestamp =
dynamic_cast<CAction*
>(
obj.get())->timestamp;
107 return it == regs.end() ? nullptr : it->second->ptrCreateObject();
138 sect,
"process_rate", 0);
std::multimap< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr > TListObservations
const char * className
Class name.
virtual ~CGenericSensor()
Destructor.
std::shared_ptr< CSerializable > Ptr
double read_double(const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const
GLsizei GLsizei GLuint * obj
Contains classes for various device interfaces.
size_t m_max_queue_len
See CGenericSensor.
double m_process_rate
See CGenericSensor.
#define THROW_EXCEPTION(msg)
static CGenericSensor * createSensor(const std::string &className)
Creates a sensor by a name of the class.
This namespace contains representation of robot actions and observations.
size_t m_grab_decimation_counter
Used when "m_grab_decimation" is enabled.
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
std::map< std::string, const TSensorClassId * > registered_sensor_classes_t
Used in registerClass.
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
This class allows loading and storing values and vectors of different types from a configuration text...
static void registerClass(const TSensorClassId *pNewClass)
Register a class into the internal list of "CGenericSensor" descendents.
std::mutex m_csObjList
The critical section for m_objList.
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...
void getObservations(TListObservations &lstObjects)
Returns a list of enqueued objects, emptying it (thread-safe).
std::string m_sensorLabel
See CGenericSensor.
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
A structure for runtime ID class type information in the context of hwdrivers::CGenericSensor.
TListObservations m_objList
The queue of objects to be returned by getObservations.
virtual void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string §ion)=0
Loads specific configuration for the device from a given source of configuration parameters,...
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
std::pair< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr > TListObsPair
Declares a class that represents any robot's observation.
GLsizei const GLchar ** string
void loadConfig(const mrpt::config::CConfigFileBase &configSource, const std::string §ion)
Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensor...
Declares a class for storing a robot action.
static registered_sensor_classes_t & get_registered_sensor_classes()
Access to singleton.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
size_t m_grab_decimation
If set to N>=2, only 1 out of N observations will be saved to m_objList.
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 | |