MRPT  2.0.1
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
mrpt::hwdrivers::CSwissRanger3DCamera Class Referenceabstract

Detailed Description

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.

PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
sensorLabel = CAM3D // A text description
preview_window = true // Show a window with a preview of the
*grabbed data in real-time
open_USB = true // false means ethernet (default: true)
USB_serial = 0x4000002f // only for open_USB=true. If not set, the
*first camera will be open. Serial is the last part of S/N (e.g. for the
*camera SN: 00-00-40-00-00-2F).
IP_address = 192.168.2.14 // only for open_USB=false. The IP of the
*camera.
// Options for the data to save in each CObservation3DRangeScan
save_3d = true // Save the 3D point cloud (default:
*true)
save_range_img = true // Save the 2D range image (default:
*true)
save_intensity_img = true // Save the 2D intensity image
*(default:
*true)
save_confidence = true // Save the estimated confidence 2D
*image
*(default: false)
enable_img_hist_equal = false // Enable intensity image histogram
*equalization (default: false)
enable_median_filter = true // Enable median filter in range
*(default: true)
enable_mediancross_filter = false // Enable median cross-filter
*(default:
*false)
enable_conv_gray = false // Enable intensity image scale with
*range
*(default: false)
enable_denoise_anf = true // Enable this noise filter
*(default:
*true)
// Camera calibration parameters: See mrpt::img::TCamera
// If not provided, a set of default parameters for a SR4000 camera will
*be loaded.
resolution = [176 144]
cx = 87.99958
cy = 68.99957
fx = 262.9201
fy = 262.9218
dist = [-8.258543e-01 6.561022e-01 2.699818e-06 -3.263559e-05 0]
// For externaly stored images, the format of image files (default=jpg)
//external_images_format = jpg
// (Only when external_images_format=jpg): Optional parameter to set the
*JPEG compression quality:
//external_images_jpeg_quality = 95 // [1-100]. Default: 95
pose_x=0.21 // Camera position in the robot (meters)
pose_y=0
pose_z=0.34
pose_yaw=0 // Angles in degrees
pose_pitch=0
pose_roll=0

Definition at line 109 of file CSwissRanger3DCamera.h.

#include <mrpt/hwdrivers/CSwissRanger3DCamera.h>

Inheritance diagram for mrpt::hwdrivers::CSwissRanger3DCamera:

Public Types

enum  TSensorState { ssInitializing = 0, ssWorking, ssError, ssUninitialized }
 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

 CSwissRanger3DCamera ()
 Default ctor. More...
 
 ~CSwissRanger3DCamera () override
 Default ctor. More...
 
void initialize () override
 Initializes the 3D camera - should be invoked after calling loadConfig() More...
 
void doProcess () override
 To be called at a high rate (>XX Hz), this method populates the internal buffer of received observations. More...
 
void getNextObservation (mrpt::obs::CObservation3DRangeScan &out_obs, bool &there_is_obs, bool &hardware_error)
 The main data retrieving function, to be called after calling loadConfig() and initialize(). More...
 
bool open ()
 return false on error - Called automatically from initialize(), no need normally for the user to call this. More...
 
void close ()
 
bool isOpen () const
 whether the camera is open and comms work ok. More...
 
size_t rows () const
 Get the row count in the camera images, loaded automatically upon camera open(). More...
 
size_t cols () const
 Get the col count in the camera images, loaded automatically upon camera open(). More...
 
unsigned int getCameraSerialNumber () const
 Get the camera serial number, loaded automatically upon camera open(). More...
 
double getMaxRange () const
 Returns the maximum camera range, as deduced from its operating frequency. More...
 
void setPathForExternalImages (const std::string &directory) override
 Set the path where to save off-rawlog image files (this class DOES take into account this path). More...
 
bool getMesaLibVersion (std::string &out_version) const
 Get the version of the MESA library. 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...
 
void getObservations (TListObservations &lstObjects)
 Returns a list of enqueued objects, emptying it (thread-safe). More...
 
virtual void setPathForExternalImages ([[maybe_unused]] 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
 
Capture configuration methods (apart from loadConfig)
void setOpenFromUSB (bool USB)
 true: open from USB, false: open from ethernet. More...
 
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. More...
 
static CGenericSensorcreateSensor (const std::string &className)
 Creates a sensor by a name of the class. More...
 
static Ptr createSensorPtr (const std::string &className)
 Just like createSensor, but returning a smart pointer to the newly created sensor object. More...
 

Protected Member Functions

void loadConfig_sensorSpecific (const mrpt::config::CConfigFileBase &configSource, const std::string &section) override
 See the class documentation at the top for expected parameters. More...
 
void internal_resendParamsToCamera () const
 
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::poses::CPose3D m_sensorPoseOnRobot
 
bool m_save_3d {true}
 Save the 3D point cloud (default: true) More...
 
bool m_save_range_img {true}
 Save the 2D range image (default: true) More...
 
bool m_save_intensity_img {true}
 Save the 2D intensity image (default: true) More...
 
bool m_save_confidence {false}
 Save the estimated confidence 2D image (default: false) More...
 
bool m_enable_img_hist_equal {false}
 
bool m_enable_median_filter {true}
 
bool m_enable_mediancross_filter {false}
 
bool m_enable_conv_gray {false}
 
bool m_enable_denoise_anf {true}
 
bool m_open_from_usb {true}
 true: USB, false: ETH More...
 
size_t m_usb_serial {0}
 
std::string m_ip_address
 
size_t m_rows {0}
 Size of camera images, set on open() More...
 
size_t m_cols {0}
 
unsigned int m_cam_serial_num {0}
 Serial number of the camera, set on open() More...
 
double m_maxRange {5}
 Max range, as deducted from the camera frequency. More...
 
bool m_preview_window {false}
 Show preview window while grabbing. More...
 
mrpt::gui::CDisplayWindow::Ptr m_win_range
 
mrpt::gui::CDisplayWindow::Ptr m_win_int
 
void * m_cam
 opaque handler to SRCAM. More...
 
mrpt::img::TCamera m_cameraParams
 
size_t m_grab_decimation_counter {0}
 Used when "m_grab_decimation" is enabled. More...
 
TSensorState m_state {ssInitializing}
 
bool m_verbose {false}
 
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 {95}
 For JPEG images, the quality (default=95%). More...
 
Common settings to any sensor, loaded in "loadConfig"
double m_process_rate {0}
 See CGenericSensor. More...
 
size_t m_max_queue_len {200}
 See CGenericSensor. More...
 
size_t m_grab_decimation {0}
 If set to N>=2, only 1 out of N observations will be saved to m_objList. More...
 
std::string m_sensorLabel
 See CGenericSensor. More...
 

Member Typedef Documentation

◆ Ptr

Definition at line 73 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 
ssUninitialized 

Definition at line 84 of file CGenericSensor.h.

Constructor & Destructor Documentation

◆ CSwissRanger3DCamera()

CSwissRanger3DCamera::CSwissRanger3DCamera ( )

◆ ~CSwissRanger3DCamera()

CSwissRanger3DCamera::~CSwissRanger3DCamera ( )
override

Default ctor.

Definition at line 77 of file CSwissRanger3DCamera.cpp.

References close().

Here is the call graph for this function:

Member Function Documentation

◆ appendObservation()

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

Like appendObservations() but for just one observation.

Definition at line 180 of file CGenericSensor.h.

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

Referenced by mrpt::hwdrivers::CIMUXSens_MT4::doProcess(), mrpt::hwdrivers::CIMUXSens::doProcess(), mrpt::hwdrivers::CGyroKVHDSP3000::doProcess(), mrpt::hwdrivers::CSkeletonTracker::doProcess(), doProcess(), mrpt::hwdrivers::C2DRangeFinderAbstract::doProcess(), mrpt::hwdrivers::CCANBusReader::doProcess(), mrpt::hwdrivers::CVelodyneScanner::doProcess(), and mrpt::hwdrivers::CGPSInterface::flushParsedMessagesNow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 48 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().

Here is the caller graph for this function:

◆ close()

void CSwissRanger3DCamera::close ( )

Definition at line 312 of file CSwissRanger3DCamera.cpp.

References m_cam.

Referenced by open(), and ~CSwissRanger3DCamera().

Here is the caller graph for this function:

◆ cols()

size_t mrpt::hwdrivers::CSwissRanger3DCamera::cols ( ) const
inline

Get the col count in the camera images, loaded automatically upon camera open().

Definition at line 163 of file CSwissRanger3DCamera.h.

References m_cols.

◆ 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 97 of file CGenericSensor.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSensorPtr()

static 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 210 of file CGenericSensor.h.

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

Referenced by mrpt::apps::RawlogGrabberApp::SensorThread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doProcess()

void CSwissRanger3DCamera::doProcess ( )
overridevirtual

To be called at a high rate (>XX Hz), this method populates the internal buffer of received observations.

This method will be invoked at a minimum rate of "process_rate" (Hz)

This method is mainly intended for usage within rawlog-grabber or similar programs. For an alternative, see getNextObservation()

Exceptions
Thismethod must throw an exception with a descriptive message if some critical error is found.
See also
getNextObservation
Exceptions
Thismethod must throw an exception with a descriptive message if some critical error is found.

Implements mrpt::hwdrivers::CGenericSensor.

Definition at line 128 of file CSwissRanger3DCamera.cpp.

References mrpt::hwdrivers::CGenericSensor::appendObservation(), getNextObservation(), mrpt::hwdrivers::CGenericSensor::m_state, mrpt::hwdrivers::CGenericSensor::ssError, mrpt::hwdrivers::CGenericSensor::ssWorking, and THROW_EXCEPTION.

Here is the call graph for this function:

◆ enableConvGray()

void mrpt::hwdrivers::CSwissRanger3DCamera::enableConvGray ( bool  enable)
inline

Definition at line 219 of file CSwissRanger3DCamera.h.

References internal_resendParamsToCamera(), and m_enable_conv_gray.

Here is the call graph for this function:

◆ enableDenoiseANF()

void mrpt::hwdrivers::CSwissRanger3DCamera::enableDenoiseANF ( bool  enable)
inline

Definition at line 225 of file CSwissRanger3DCamera.h.

References internal_resendParamsToCamera(), and m_enable_denoise_anf.

Here is the call graph for this function:

◆ enableImageHistEqualization()

void mrpt::hwdrivers::CSwissRanger3DCamera::enableImageHistEqualization ( bool  enable)
inline

Definition at line 194 of file CSwissRanger3DCamera.h.

References m_enable_img_hist_equal.

◆ enableMedianCrossFilter()

void mrpt::hwdrivers::CSwissRanger3DCamera::enableMedianCrossFilter ( bool  enable)
inline

Definition at line 209 of file CSwissRanger3DCamera.h.

References internal_resendParamsToCamera(), and m_enable_mediancross_filter.

Here is the call graph for this function:

◆ enableMedianFilter()

void mrpt::hwdrivers::CSwissRanger3DCamera::enableMedianFilter ( bool  enable)
inline

Definition at line 203 of file CSwissRanger3DCamera.h.

References internal_resendParamsToCamera(), and m_enable_median_filter.

Here is the call graph for this function:

◆ enablePreviewWindow()

void mrpt::hwdrivers::CSwissRanger3DCamera::enablePreviewWindow ( bool  enable = true)
inline

Definition at line 231 of file CSwissRanger3DCamera.h.

References m_preview_window.

◆ 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 106 of file CGenericSensor.h.

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

◆ getCameraSerialNumber()

unsigned int mrpt::hwdrivers::CSwissRanger3DCamera::getCameraSerialNumber ( ) const
inline

Get the camera serial number, loaded automatically upon camera open().

Definition at line 166 of file CSwissRanger3DCamera.h.

References m_cam_serial_num.

◆ getExternalImageJPEGQuality()

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

◆ getMaxRange()

double mrpt::hwdrivers::CSwissRanger3DCamera::getMaxRange ( ) const
inline

Returns the maximum camera range, as deduced from its operating frequency.

Definition at line 169 of file CSwissRanger3DCamera.h.

References m_maxRange.

◆ getMesaLibVersion()

bool CSwissRanger3DCamera::getMesaLibVersion ( std::string &  out_version) const

Get the version of the MESA library.

Returns
false on error

Definition at line 218 of file CSwissRanger3DCamera.cpp.

References mrpt::format().

Here is the call graph for this function:

◆ getNextObservation()

void CSwissRanger3DCamera::getNextObservation ( mrpt::obs::CObservation3DRangeScan out_obs,
bool &  there_is_obs,
bool &  hardware_error 
)

The main data retrieving function, to be called after calling loadConfig() and initialize().

Parameters
out_obsThe output retrieved observation (only if there_is_obs=true).
there_is_obsIf set to false, there was no new observation.
hardware_errorTrue on hardware/comms error.
See also
doProcess

Definition at line 347 of file CSwissRanger3DCamera.cpp.

References ASSERT_, mrpt::obs::CObservation3DRangeScan::cameraParams, mrpt::obs::CObservation3DRangeScan::confidenceImage, mrpt::gui::CDisplayWindow::Create(), do_init_table_16u_to_8u(), mrpt::system::fileNameStripInvalidChars(), mrpt::format(), mrpt::obs::CObservation3DRangeScan::hasConfidenceImage, mrpt::obs::CObservation3DRangeScan::hasIntensityImage, mrpt::obs::CObservation3DRangeScan::hasPoints3D, mrpt::obs::CObservation3DRangeScan::hasRangeImage, mrpt::obs::CObservation3DRangeScan::intensityImage, m_cam, m_cameraParams, m_enable_img_hist_equal, mrpt::hwdrivers::CGenericSensor::m_external_images_format, mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality, m_maxRange, mrpt::hwdrivers::CGenericSensor::m_path_for_external_images, m_preview_window, m_save_3d, m_save_confidence, m_save_intensity_img, m_save_range_img, mrpt::hwdrivers::CGenericSensor::m_sensorLabel, m_sensorPoseOnRobot, m_win_int, m_win_range, mrpt::obs::CObservation3DRangeScan::maxRange, mrpt::obs::CObservation3DRangeScan::points3D_x, mrpt::obs::CObservation3DRangeScan::points3D_y, mrpt::obs::CObservation3DRangeScan::points3D_z, mrpt::obs::CObservation3DRangeScan::range_is_depth, mrpt::obs::CObservation3DRangeScan::rangeImage, mrpt::obs::CObservation3DRangeScan::rangeUnits, mrpt::img::CImage::resize(), mrpt::img::CImage::saveToFile(), mrpt::img::TCamera::scaleToResolution(), mrpt::obs::CObservation::sensorLabel, mrpt::obs::CObservation3DRangeScan::sensorPose, mrpt::img::CImage::setExternalStorage(), mrpt::img::CImage::setFromMatrix(), mrpt::math::CMatrixDynamic< T >::setSize(), mrpt::obs::CObservation3DRangeScan::stdError, table_16u_to_8u, table_16u_to_8u_init, mrpt::obs::CObservation::timestamp, mrpt::system::timestampTotime_t(), and trim().

Referenced by doProcess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 85 of file CGenericSensor.cpp.

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

Referenced by TEST().

Here is the caller graph for this function:

◆ getOpenFromUSBMode()

bool mrpt::hwdrivers::CSwissRanger3DCamera::getOpenFromUSBMode ( ) const
inline

Definition at line 184 of file CSwissRanger3DCamera.h.

References m_open_from_usb.

◆ getOpenIPAddress()

std::string mrpt::hwdrivers::CSwissRanger3DCamera::getOpenIPAddress ( ) const
inline

Definition at line 186 of file CSwissRanger3DCamera.h.

References m_ip_address.

◆ getProcessRate()

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

Definition at line 94 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 95 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 93 of file CGenericSensor.h.

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

◆ initialize()

void CSwissRanger3DCamera::initialize ( )
overridevirtual

Initializes the 3D camera - should be invoked after calling loadConfig()

This method can or cannot be implemented in the derived class, depending on the need for it.

Exceptions
Thismethod must throw an exception with a descriptive message if some critical error is found.

Reimplemented from mrpt::hwdrivers::CGenericSensor.

Definition at line 119 of file CSwissRanger3DCamera.cpp.

References open(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_resendParamsToCamera()

void CSwissRanger3DCamera::internal_resendParamsToCamera ( ) const
protected

Definition at line 320 of file CSwissRanger3DCamera.cpp.

References isOpen(), m_cam, m_enable_conv_gray, m_enable_denoise_anf, m_enable_median_filter, m_enable_mediancross_filter, and m_save_confidence.

Referenced by enableConvGray(), enableDenoiseANF(), enableMedianCrossFilter(), enableMedianFilter(), and open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEnabledConvGray()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledConvGray ( ) const
inline

Definition at line 224 of file CSwissRanger3DCamera.h.

References m_enable_conv_gray.

◆ isEnabledDenoiseANF()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledDenoiseANF ( ) const
inline

Definition at line 230 of file CSwissRanger3DCamera.h.

References m_enable_denoise_anf.

◆ isEnabledImageHistEqualization()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledImageHistEqualization ( ) const
inline

Definition at line 198 of file CSwissRanger3DCamera.h.

References m_enable_img_hist_equal.

◆ isEnabledMedianCrossFilter()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledMedianCrossFilter ( ) const
inline

Definition at line 214 of file CSwissRanger3DCamera.h.

References m_enable_mediancross_filter.

◆ isEnabledMedianFilter()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledMedianFilter ( ) const
inline

Definition at line 208 of file CSwissRanger3DCamera.h.

References m_enable_median_filter.

◆ isEnabledPreviewWindow()

bool mrpt::hwdrivers::CSwissRanger3DCamera::isEnabledPreviewWindow ( ) const
inline

Definition at line 235 of file CSwissRanger3DCamera.h.

References m_preview_window.

◆ isOpen()

bool CSwissRanger3DCamera::isOpen ( ) const

whether the camera is open and comms work ok.

To be called after initialize()

Definition at line 233 of file CSwissRanger3DCamera.cpp.

References m_cam.

Referenced by internal_resendParamsToCamera(), and open().

Here is the caller graph for this function:

◆ isVerboseEnabled()

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

Definition at line 107 of file CGenericSensor.h.

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

◆ loadConfig()

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

Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific".

Exceptions
Thismethod throws an exception with a descriptive message if some critical parameter is missing or has an invalid value.

Definition at line 126 of file CGenericSensor.cpp.

References mrpt::hwdrivers::CGenericSensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGenericSensor::m_grab_decimation, mrpt::hwdrivers::CGenericSensor::m_grab_decimation_counter, mrpt::hwdrivers::CGenericSensor::m_max_queue_len, mrpt::hwdrivers::CGenericSensor::m_process_rate, mrpt::hwdrivers::CGenericSensor::m_sensorLabel, MRPT_END, MRPT_START, mrpt::config::CConfigFileBase::read_double(), mrpt::config::CConfigFileBase::read_int(), mrpt::config::CConfigFileBase::read_string(), and sect.

Here is the call graph for this function:

◆ loadConfig_sensorSpecific()

void CSwissRanger3DCamera::loadConfig_sensorSpecific ( const mrpt::config::CConfigFileBase configSource,
const std::string &  iniSection 
)
overrideprotectedvirtual

See the class documentation at the top for expected parameters.

Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see config::CConfigFileBase and derived classes)

Exceptions
Thismethod must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.

Implements mrpt::hwdrivers::CGenericSensor.

Definition at line 159 of file CSwissRanger3DCamera.cpp.

References mrpt::DEG2RAD(), mrpt::img::TCamera::loadFromConfigFile(), m_cameraParams, m_enable_conv_gray, m_enable_denoise_anf, m_enable_img_hist_equal, m_enable_median_filter, m_enable_mediancross_filter, mrpt::hwdrivers::CGenericSensor::m_external_images_format, mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality, m_ip_address, m_open_from_usb, m_preview_window, m_save_3d, m_save_confidence, m_save_intensity_img, m_save_range_img, m_sensorPoseOnRobot, m_usb_serial, mrpt::config::CConfigFileBase::read_bool(), mrpt::config::CConfigFileBase::read_float(), mrpt::config::CConfigFileBase::read_int(), mrpt::config::CConfigFileBase::read_string(), mrpt::config::CConfigFileBase::read_uint64_t(), mrpt::poses::CPose3D::setFromValues(), and mrpt::system::trim().

Here is the call graph for this function:

◆ open()

bool CSwissRanger3DCamera::open ( )

return false on error - Called automatically from initialize(), no need normally for the user to call this.

Definition at line 234 of file CSwissRanger3DCamera.cpp.

References close(), internal_resendParamsToCamera(), isOpen(), m_cam, m_cam_serial_num, m_cols, m_ip_address, m_maxRange, m_open_from_usb, m_rows, and m_usb_serial.

Referenced by initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 115 of file CGenericSensor.cpp.

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

Here is the call graph for this function:

◆ rows()

size_t mrpt::hwdrivers::CSwissRanger3DCamera::rows ( ) const
inline

Get the row count in the camera images, loaded automatically upon camera open().

Definition at line 160 of file CSwissRanger3DCamera.h.

References m_rows.

◆ 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 268 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 275 of file CGenericSensor.h.

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

◆ setOpenFromUSB()

void mrpt::hwdrivers::CSwissRanger3DCamera::setOpenFromUSB ( bool  USB)
inline

true: open from USB, false: open from ethernet.

Definition at line 183 of file CSwissRanger3DCamera.h.

References m_open_from_usb.

◆ setOpenIPAddress()

void mrpt::hwdrivers::CSwissRanger3DCamera::setOpenIPAddress ( const std::string &  IP)
inline

Definition at line 185 of file CSwissRanger3DCamera.h.

References m_ip_address.

◆ setPathForExternalImages() [1/2]

void CSwissRanger3DCamera::setPathForExternalImages ( const std::string &  directory)
override

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.

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

Definition at line 590 of file CSwissRanger3DCamera.cpp.

References mrpt::system::createDirectory(), mrpt::hwdrivers::CGenericSensor::m_path_for_external_images, and THROW_EXCEPTION_FMT.

Here is the call graph for this function:

◆ setPathForExternalImages() [2/2]

virtual void mrpt::hwdrivers::CGenericSensor::setPathForExternalImages ( [ [maybe_unused] ] 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.

Definition at line 257 of file CGenericSensor.h.

◆ setSave3D()

void mrpt::hwdrivers::CSwissRanger3DCamera::setSave3D ( bool  save)
inline

Definition at line 187 of file CSwissRanger3DCamera.h.

References m_save_3d.

◆ setSaveConfidenceImage()

void mrpt::hwdrivers::CSwissRanger3DCamera::setSaveConfidenceImage ( bool  save)
inline

Definition at line 193 of file CSwissRanger3DCamera.h.

References m_save_confidence.

◆ setSaveIntensityImage()

void mrpt::hwdrivers::CSwissRanger3DCamera::setSaveIntensityImage ( bool  save)
inline

Definition at line 189 of file CSwissRanger3DCamera.h.

References m_save_intensity_img.

◆ setSaveRangeImage()

void mrpt::hwdrivers::CSwissRanger3DCamera::setSaveRangeImage ( bool  save)
inline

Definition at line 188 of file CSwissRanger3DCamera.h.

References m_save_range_img.

◆ setSensorLabel()

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

Definition at line 96 of file CGenericSensor.h.

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

Member Data Documentation

◆ m_cam

void* mrpt::hwdrivers::CSwissRanger3DCamera::m_cam
protected

opaque handler to SRCAM.

nullptr means it's not open yet.

Definition at line 287 of file CSwissRanger3DCamera.h.

Referenced by close(), getNextObservation(), internal_resendParamsToCamera(), isOpen(), and open().

◆ m_cam_serial_num

unsigned int mrpt::hwdrivers::CSwissRanger3DCamera::m_cam_serial_num {0}
protected

Serial number of the camera, set on open()

Definition at line 278 of file CSwissRanger3DCamera.h.

Referenced by getCameraSerialNumber(), and open().

◆ m_cameraParams

mrpt::img::TCamera mrpt::hwdrivers::CSwissRanger3DCamera::m_cameraParams
protected

◆ m_cols

size_t mrpt::hwdrivers::CSwissRanger3DCamera::m_cols {0}
protected

Definition at line 276 of file CSwissRanger3DCamera.h.

Referenced by cols(), and open().

◆ m_enable_conv_gray

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_enable_conv_gray {false}
protected

◆ m_enable_denoise_anf

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_enable_denoise_anf {true}
protected

◆ m_enable_img_hist_equal

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_enable_img_hist_equal {false}
protected

◆ m_enable_median_filter

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_enable_median_filter {true}
protected

◆ m_enable_mediancross_filter

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_enable_mediancross_filter {false}
protected

◆ 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 158 of file CGenericSensor.h.

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

◆ m_external_images_jpeg_quality

unsigned int mrpt::hwdrivers::CGenericSensor::m_external_images_jpeg_quality {95}
protectedinherited

◆ m_grab_decimation

size_t mrpt::hwdrivers::CGenericSensor::m_grab_decimation {0}
protectedinherited

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

Definition at line 139 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 {0}
protectedinherited

Used when "m_grab_decimation" is enabled.

Definition at line 146 of file CGenericSensor.h.

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

◆ m_ip_address

std::string mrpt::hwdrivers::CSwissRanger3DCamera::m_ip_address
protected

◆ m_max_queue_len

size_t mrpt::hwdrivers::CGenericSensor::m_max_queue_len {200}
protectedinherited

See CGenericSensor.

Definition at line 136 of file CGenericSensor.h.

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

◆ m_maxRange

double mrpt::hwdrivers::CSwissRanger3DCamera::m_maxRange {5}
protected

Max range, as deducted from the camera frequency.

Definition at line 280 of file CSwissRanger3DCamera.h.

Referenced by getMaxRange(), getNextObservation(), and open().

◆ m_open_from_usb

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_open_from_usb {true}
protected

true: USB, false: ETH

Definition at line 271 of file CSwissRanger3DCamera.h.

Referenced by getOpenFromUSBMode(), loadConfig_sensorSpecific(), open(), and setOpenFromUSB().

◆ 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 155 of file CGenericSensor.h.

Referenced by getNextObservation(), and setPathForExternalImages().

◆ m_preview_window

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_preview_window {false}
protected

Show preview window while grabbing.

Definition at line 283 of file CSwissRanger3DCamera.h.

Referenced by enablePreviewWindow(), getNextObservation(), isEnabledPreviewWindow(), and loadConfig_sensorSpecific().

◆ m_process_rate

double mrpt::hwdrivers::CGenericSensor::m_process_rate {0}
protectedinherited

◆ m_rows

size_t mrpt::hwdrivers::CSwissRanger3DCamera::m_rows {0}
protected

Size of camera images, set on open()

Definition at line 276 of file CSwissRanger3DCamera.h.

Referenced by open(), and rows().

◆ m_save_3d

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_save_3d {true}
protected

Save the 3D point cloud (default: true)

Definition at line 256 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation(), loadConfig_sensorSpecific(), and setSave3D().

◆ m_save_confidence

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_save_confidence {false}
protected

Save the estimated confidence 2D image (default: false)

Definition at line 262 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation(), internal_resendParamsToCamera(), loadConfig_sensorSpecific(), and setSaveConfidenceImage().

◆ m_save_intensity_img

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_save_intensity_img {true}
protected

Save the 2D intensity image (default: true)

Definition at line 260 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation(), loadConfig_sensorSpecific(), and setSaveIntensityImage().

◆ m_save_range_img

bool mrpt::hwdrivers::CSwissRanger3DCamera::m_save_range_img {true}
protected

Save the 2D range image (default: true)

Definition at line 258 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation(), loadConfig_sensorSpecific(), and setSaveRangeImage().

◆ m_sensorLabel

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

See CGenericSensor.

Definition at line 141 of file CGenericSensor.h.

Referenced by mrpt::hwdrivers::CCANBusReader::CCANBusReader(), mrpt::hwdrivers::CGPSInterface::CGPSInterface(), mrpt::hwdrivers::CGyroKVHDSP3000::CGyroKVHDSP3000(), mrpt::hwdrivers::CHokuyoURG::CHokuyoURG(), 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(), mrpt::hwdrivers::CSickLaserUSB::CSickLaserUSB(), mrpt::hwdrivers::CSkeletonTracker::CSkeletonTracker(), CSwissRanger3DCamera(), mrpt::hwdrivers::CVelodyneScanner::CVelodyneScanner(), mrpt::hwdrivers::CIMUXSens_MT4::doProcess(), mrpt::hwdrivers::CIMUXSens::doProcess(), mrpt::hwdrivers::CGyroKVHDSP3000::doProcess(), mrpt::hwdrivers::CSkeletonTracker::doProcess(), mrpt::hwdrivers::CRoboPeakLidar::doProcessSimple(), mrpt::hwdrivers::CSickLaserUSB::doProcessSimple(), mrpt::hwdrivers::CCANBusReader::doProcessSimple(), mrpt::hwdrivers::CSickLaserSerial::doProcessSimple(), mrpt::hwdrivers::CHokuyoURG::doProcessSimple(), mrpt::hwdrivers::CGPSInterface::flushParsedMessagesNow(), 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_sensorPoseOnRobot

mrpt::poses::CPose3D mrpt::hwdrivers::CSwissRanger3DCamera::m_sensorPoseOnRobot
protected

Definition at line 253 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation(), and loadConfig_sensorSpecific().

◆ m_state

TSensorState mrpt::hwdrivers::CGenericSensor::m_state {ssInitializing}
protectedinherited

◆ m_usb_serial

size_t mrpt::hwdrivers::CSwissRanger3DCamera::m_usb_serial {0}
protected

Definition at line 272 of file CSwissRanger3DCamera.h.

Referenced by loadConfig_sensorSpecific(), and open().

◆ m_verbose

bool mrpt::hwdrivers::CGenericSensor::m_verbose {false}
protectedinherited

◆ m_win_int

mrpt::gui::CDisplayWindow::Ptr mrpt::hwdrivers::CSwissRanger3DCamera::m_win_int
protected

Definition at line 284 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation().

◆ m_win_range

mrpt::gui::CDisplayWindow::Ptr mrpt::hwdrivers::CSwissRanger3DCamera::m_win_range
protected

Definition at line 284 of file CSwissRanger3DCamera.h.

Referenced by getNextObservation().




Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020