A class for grabing "range images" from a MESA imaging SwissRanger 3D cameras (SR-2, SR-3000, SR-4k).
NOTES:
As with any other CGenericSensor class, the normal sequence of methods to be called is:
This sensor can be also used from within rawlog-grabber.
Definition at line 103 of file CSwissRanger3DCamera.h.
#include <mrpt/hwdrivers/CSwissRanger3DCamera.h>

Public Types | |
| enum | TSensorState { ssInitializing = 0, ssWorking, ssError } |
| The current state of the sensor. More... | |
| typedef std::multimap < mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > | TListObservations |
| typedef std::pair < mrpt::system::TTimeStamp, mrpt::utils::CSerializablePtr > | TListObsPair |
Public Member Functions | |||
| CSwissRanger3DCamera () | |||
| Default ctor. | |||
| ~CSwissRanger3DCamera () | |||
| Default ctor. | |||
| virtual void | initialize () | ||
Initializes the 3D camera - should be invoked after calling loadConfig()
| |||
| virtual void | doProcess () | ||
| To be called at a high rate (>XX Hz), this method populates the internal buffer of received observations. | |||
| void | getNextObservation (mrpt::slam::CObservation3DRangeScan &out_obs, bool &there_is_obs, bool &hardware_error) | ||
| The main data retrieving function, to be called after calling loadConfig() and initialize(). | |||
| bool | open () | ||
| return false on error - Called automatically from initialize(), no need normally for the user to call this. | |||
| void | close () | ||
| bool | isOpen () const | ||
| whether the camera is open and comms work ok. To be called after initialize() | |||
| size_t | getRowCount () const | ||
| Get the row count in the camera images, loaded automatically upon camera open(). | |||
| size_t | getColCount () const | ||
| Get the col count in the camera images, loaded automatically upon camera open(). | |||
| unsigned int | getCameraSerialNumber () const | ||
| Get the camera serial number, loaded automatically upon camera open(). | |||
| double | getMaxRange () const | ||
| Returns the maximum camera range, as deduced from its operating frequency. | |||
| virtual void | setPathForExternalImages (const std::string &directory) | ||
| Set the path where to save off-rawlog image files (this class DOES take into account this path). | |||
| bool | getMesaLibVersion (std::string &out_version) const | ||
| Get the version of the MESA library. | |||
| virtual const mrpt::hwdrivers::TSensorClassId * | GetRuntimeClass () const =0 | ||
| TSensorState | getState () const | ||
| The current state of the sensor. | |||
| double | getProcessRate () const | ||
| std::string | getSensorLabel () const | ||
| void | setSensorLabel (const std::string &sensorLabel) | ||
| 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_sensorSpecific"
| |||
| void | getObservations (TListObservations &lstObjects) | ||
| Returns a list of enqueued objects, emptying it (thread-safe). | |||
| void | setExternalImageFormat (const std::string &ext) | ||
| Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg". | |||
| void | setExternalImageJPEGQuality (const unsigned int quality) | ||
| The quality of JPEG compression, when external images is enabled and the format is "jpg". | |||
| unsigned int | getExternalImageJPEGQuality () const | ||
Capture configuration methods (apart from loadConfig) | |||
| void | setOpenFromUSB (bool USB) | ||
| true: open from USB, false: open from ethernet. | |||
| bool | getOpenFromUSBMode () const | ||
| void | setOpenIPAddress (const std::string &IP) | ||
| std::string | getOpenIPAddress () const | ||
| void | setSave3D (bool save) | ||
| void | setSaveRangeImage (bool save) | ||
| void | setSaveIntensityImage (bool save) | ||
| void | setSaveConfidenceImage (bool save) | ||
| void | enableImageHistEqualization (bool enable) | ||
| bool | isEnabledImageHistEqualization () const | ||
| void | enableMedianFilter (bool enable) | ||
| bool | isEnabledMedianFilter () const | ||
| void | enableMedianCrossFilter (bool enable) | ||
| bool | isEnabledMedianCrossFilter () const | ||
| void | enableConvGray (bool enable) | ||
| bool | isEnabledConvGray () const | ||
| void | enableDenoiseANF (bool enable) | ||
| bool | isEnabledDenoiseANF () const | ||
| void | enablePreviewWindow (bool enable=true) | ||
| bool | isEnabledPreviewWindow () const | ||
Static Public Member Functions | |
| static void | registerClass (const TSensorClassId *pNewClass) |
| Register a class into the internal list of "CGenericSensor" descendents. | |
| static CGenericSensor * | createSensor (const std::string &className) |
| Creates a sensor by a name of the class. | |
| static CGenericSensorPtr | createSensorPtr (const std::string &className) |
| Just like createSensor, but returning a smart pointer to the newly created sensor object. | |
Protected Member Functions | |||
| virtual void | loadConfig_sensorSpecific (const mrpt::utils::CConfigFileBase &configSource, const std::string §ion) | ||
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)
| |||
| void | internal_resendParamsToCamera () const | ||
| 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 by getObservations. | |||
| void | appendObservation (const mrpt::utils::CSerializablePtr &obj) | ||
| Like appendObservations() but for just one observation. | |||
Protected Attributes | |
| mrpt::poses::CPose3D | m_sensorPoseOnRobot |
| bool | m_save_3d |
| Save the 3D point cloud (default: true) | |
| bool | m_save_range_img |
| Save the 2D range image (default: true) | |
| bool | m_save_intensity_img |
| Save the 2D intensity image (default: true) | |
| bool | m_save_confidence |
| Save the estimated confidence 2D image (default: false) | |
| bool | m_enable_img_hist_equal |
| bool | m_enable_median_filter |
| bool | m_enable_mediancross_filter |
| bool | m_enable_conv_gray |
| bool | m_enable_denoise_anf |
| bool | m_open_from_usb |
| true: USB, false: ETH | |
| size_t | m_usb_serial |
| std::string | m_ip_address |
| size_t | m_rows |
| size_t | m_cols |
| Size of camera images, set on open() | |
| unsigned int | m_cam_serial_num |
| Serial number of the camera, set on open() | |
| double | m_maxRange |
| Max range, as deducted from the camera frequency. | |
| bool | m_preview_window |
| Show preview window while grabbing. | |
| mrpt::gui::CDisplayWindowPtr | m_win_range |
| mrpt::gui::CDisplayWindowPtr | m_win_int |
| void * | m_cam |
| opaque handler to SRCAM. NULL means it's not open yet. | |
| mrpt::utils::TCamera | m_cameraParams |
| size_t | m_grab_decimation_counter |
| Used when "m_grab_decimation" is enabled. | |
| TSensorState | m_state |
| std::string | m_path_for_external_images |
| The path where to save off-rawlog images: empty means save images embedded in the rawlog. | |
| std::string | m_external_images_format |
| The extension ("jpg","gif","png",...) that determines the format of images saved externally. | |
| unsigned int | m_external_images_jpeg_quality |
| For JPEG images, the quality (default=95%). | |
Common settings to any sensor, loaded in "loadConfig" | |
| double | m_process_rate |
| See CGenericSensor. | |
| size_t | m_max_queue_len |
| See CGenericSensor. | |
| size_t | m_grab_decimation |
| If set to N>=2, only 1 out of N observations will be saved to m_objList. | |
| std::string | m_sensorLabel |
| See CGenericSensor. | |
|
inherited |
Definition at line 84 of file CGenericSensor.h.
|
inherited |
Definition at line 85 of file CGenericSensor.h.
|
inherited |
The current state of the sensor.
| Enumerator | |
|---|---|
| ssInitializing | |
| ssWorking | |
| ssError | |
Definition at line 90 of file CGenericSensor.h.
| mrpt::hwdrivers::CSwissRanger3DCamera::CSwissRanger3DCamera | ( | ) |
Default ctor.
| mrpt::hwdrivers::CSwissRanger3DCamera::~CSwissRanger3DCamera | ( | ) |
Default ctor.
|
inlineprotectedinherited |
Like appendObservations() but for just one observation.
Definition at line 155 of file CGenericSensor.h.
|
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:
If several observations are passed at once in the vector, they'll be considered as a block regarding the grabbing decimation factor.
| void mrpt::hwdrivers::CSwissRanger3DCamera::close | ( | ) |
|
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:
|
inlinestaticinherited |
Just like createSensor, but returning a smart pointer to the newly created sensor object.
Definition at line 188 of file CGenericSensor.h.
|
virtual |
To be called at a high rate (>XX Hz), this method populates the internal buffer of received observations.
This method is mainly intended for usage within rawlog-grabber or similar programs. For an alternative, see getNextObservation()
| This | method must throw an exception with a descriptive message if some critical error is found. |
Implements mrpt::hwdrivers::CGenericSensor.
|
inline |
Definition at line 180 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 183 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 171 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 177 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 174 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 186 of file CSwissRanger3DCamera.h.
|
inline |
Get the camera serial number, loaded automatically upon camera open().
Definition at line 145 of file CSwissRanger3DCamera.h.
|
inline |
Get the col count in the camera images, loaded automatically upon camera open().
Definition at line 142 of file CSwissRanger3DCamera.h.
|
inlineinherited |
Definition at line 241 of file CGenericSensor.h.
|
inline |
Returns the maximum camera range, as deduced from its operating frequency.
Definition at line 148 of file CSwissRanger3DCamera.h.
| bool mrpt::hwdrivers::CSwissRanger3DCamera::getMesaLibVersion | ( | std::string & | out_version | ) | const |
Get the version of the MESA library.
| void mrpt::hwdrivers::CSwissRanger3DCamera::getNextObservation | ( | mrpt::slam::CObservation3DRangeScan & | out_obs, |
| bool & | there_is_obs, | ||
| bool & | hardware_error | ||
| ) |
The main data retrieving function, to be called after calling loadConfig() and initialize().
| out_obs | The output retrieved observation (only if there_is_obs=true). |
| there_is_obs | If set to false, there was no new observation. |
| hardware_error | True on hardware/comms error. |
|
inherited |
Returns a list of enqueued objects, emptying it (thread-safe).
The objects must be freed by the invoker.
|
inline |
Definition at line 161 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 164 of file CSwissRanger3DCamera.h.
|
inlineinherited |
Definition at line 100 of file CGenericSensor.h.
|
inline |
Get the row count in the camera images, loaded automatically upon camera open().
Definition at line 140 of file CSwissRanger3DCamera.h.
|
pure virtualinherited |
|
inlineinherited |
Definition at line 102 of file CGenericSensor.h.
|
inlineinherited |
The current state of the sensor.
Definition at line 98 of file CGenericSensor.h.
|
virtual |
Initializes the 3D camera - should be invoked after calling loadConfig()
| This | method must throw an exception with a descriptive message if some critical error is found. |
Reimplemented from mrpt::hwdrivers::CGenericSensor.
|
protected |
|
inline |
Definition at line 181 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 184 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 172 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 178 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 175 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 187 of file CSwissRanger3DCamera.h.
| bool mrpt::hwdrivers::CSwissRanger3DCamera::isOpen | ( | ) | const |
whether the camera is open and comms work ok. To be called after initialize()
|
inherited |
Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific"
| This | method throws an exception with a descriptive message if some critical parameter is missing or has an invalid value. |
|
protectedvirtual |
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)
| This | method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value. |
Implements mrpt::hwdrivers::CGenericSensor.
| bool mrpt::hwdrivers::CSwissRanger3DCamera::open | ( | ) |
return false on error - Called automatically from initialize(), no need normally for the user to call this.
|
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.
Referenced by mrpt::hwdrivers::CGenericSensor::CLASSINIT_GENERIC_SENSOR::CLASSINIT_GENERIC_SENSOR().
|
inlineinherited |
Set the extension ("jpg","gif","png",...) that determines the format of images saved externally The default is "jpg".
Definition at line 233 of file CGenericSensor.h.
|
inlineinherited |
The quality of JPEG compression, when external images is enabled and the format is "jpg".
Definition at line 238 of file CGenericSensor.h.
|
inline |
true: open from USB, false: open from ethernet.
Definition at line 160 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 163 of file CSwissRanger3DCamera.h.
|
virtual |
Set the path where to save off-rawlog image files (this class DOES take into account this path).
An empty string (the default value at construction) means to save images embedded in the rawlog, instead of on separate files.
| std::exception | If the directory doesn't exists and cannot be created. |
Reimplemented from mrpt::hwdrivers::CGenericSensor.
|
inline |
Definition at line 166 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 169 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 168 of file CSwissRanger3DCamera.h.
|
inline |
Definition at line 167 of file CSwissRanger3DCamera.h.
|
inlineinherited |
Definition at line 103 of file CGenericSensor.h.
|
protected |
opaque handler to SRCAM. NULL means it's not open yet.
Definition at line 235 of file CSwissRanger3DCamera.h.
|
protected |
Serial number of the camera, set on open()
Definition at line 229 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 237 of file CSwissRanger3DCamera.h.
|
protected |
Size of camera images, set on open()
Definition at line 228 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 220 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 221 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 217 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 218 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 219 of file CSwissRanger3DCamera.h.
|
protectedinherited |
The extension ("jpg","gif","png",...) that determines the format of images saved externally.
Definition at line 139 of file CGenericSensor.h.
|
protectedinherited |
For JPEG images, the quality (default=95%).
Definition at line 140 of file CGenericSensor.h.
|
protectedinherited |
If set to N>=2, only 1 out of N observations will be saved to m_objList.
Definition at line 127 of file CGenericSensor.h.
|
protectedinherited |
Used when "m_grab_decimation" is enabled.
Definition at line 132 of file CGenericSensor.h.
|
protected |
Definition at line 226 of file CSwissRanger3DCamera.h.
|
protectedinherited |
See CGenericSensor.
Definition at line 126 of file CGenericSensor.h.
|
protected |
Max range, as deducted from the camera frequency.
Definition at line 230 of file CSwissRanger3DCamera.h.
|
protected |
true: USB, false: ETH
Definition at line 224 of file CSwissRanger3DCamera.h.
|
protectedinherited |
The path where to save off-rawlog images: empty means save images embedded in the rawlog.
Definition at line 138 of file CGenericSensor.h.
|
protected |
Show preview window while grabbing.
Definition at line 232 of file CSwissRanger3DCamera.h.
|
protectedinherited |
See CGenericSensor.
Definition at line 125 of file CGenericSensor.h.
|
protected |
Definition at line 228 of file CSwissRanger3DCamera.h.
|
protected |
Save the 3D point cloud (default: true)
Definition at line 212 of file CSwissRanger3DCamera.h.
|
protected |
Save the estimated confidence 2D image (default: false)
Definition at line 215 of file CSwissRanger3DCamera.h.
|
protected |
Save the 2D intensity image (default: true)
Definition at line 214 of file CSwissRanger3DCamera.h.
|
protected |
Save the 2D range image (default: true)
Definition at line 213 of file CSwissRanger3DCamera.h.
|
protectedinherited |
See CGenericSensor.
Definition at line 128 of file CGenericSensor.h.
|
protected |
Definition at line 210 of file CSwissRanger3DCamera.h.
|
protectedinherited |
Definition at line 134 of file CGenericSensor.h.
|
protected |
Definition at line 225 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 233 of file CSwissRanger3DCamera.h.
|
protected |
Definition at line 233 of file CSwissRanger3DCamera.h.
| Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013 |