Main MRPT website > C++ reference for MRPT 1.5.3
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
mrpt::hwdrivers::CDUO3DCamera Class Reference

Detailed Description

This "software driver" implements the communication protocol for interfacing a DUO3D Stereo Camera.

See also the example configuration file for rawlog-grabber in "share/mrpt/config_files/rawlog-grabber".

PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
image_width = 640 // [int] x Resolution
image_height = 480 // [int] y Resolution
fps = 30 // [int] Frames per second (<= 30)
exposure = 50 // [int] Exposure value (1..100)
led = 0 // [int] Led intensity (only for some device models) (1..100).
gain = 50 // [int] Camera gain (1..100)
capture_rectified = false // [bool] Rectify captured images
capture_imu = true // [bool] Capture IMU data from DUO3D device (if available)
calibration_from_file = true // [bool] Use YML calibration files provided by calibration application supplied with DUO3D device
intrinsic_filename = "" // [string] Intrinsic parameters file. This filename should contain a substring _RWWWxHHH_ with WWW being the image width and HHH the image height, as provided by the calibration application.
extrinsic_filename = "" // [string] Extrinsic parameters file. This filename should contain a substring _RWWWxHHH_ with WWW being the image width and HHH the image height, as provided by the calibration application.
rectify_map_filename = "" // [string] Rectification map file. This filename should contain a substring _RWWWxHHH_ with WWW being the image width and HHH the image height, as provided by the calibration application.
pose_x=0.21 // camera 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

Definition at line 125 of file CDUO3DCamera.h.

#include <mrpt/hwdrivers/CDUO3DCamera.h>

Inheritance diagram for mrpt::hwdrivers::CDUO3DCamera:
Inheritance graph

Public Member Functions

 CDUO3DCamera ()
 Default Constructor (does not open the camera) More...
 
 CDUO3DCamera (const TCaptureOptions_DUO3D &options)
 Constructor: tries to open the camera with the given options. More...
 
virtual ~CDUO3DCamera ()
 Destructor. More...
 
const TCaptureOptions_DUO3DgetCameraOptions () const
 Returns the current settings of the camera. More...
 
void open (const TCaptureOptions_DUO3D &options, const bool startCapture=true)
 Tries to open the camera with the given options, and starts capturing. More...
 
void startCapture ()
 Start the actual data capture of the camera. More...
 
void stopCapture ()
 Stop capture. More...
 
void close ()
 Stop capture and closes the opened camera, if any. More...
 
void getObservations (mrpt::obs::CObservationStereoImages &outObservation_img, mrpt::obs::CObservationIMU &outObservation_imu, bool &there_is_img, bool &there_is_imu)
 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 captureIMUIsSet ()
 Indicates if the camera is grabbing IMU data. More...
 
void * getEvent ()
 Returned pointer to be reinterpreted as DUO3D's "HANDLE". More...
 
void setDataFrame (void *frame)
 frame is a reinterpreted PDUOFrame More...
 

Protected Member Functions

bool queryVersion (std::string version, bool printOutVersion=false)
 Queries the DUO3D Camera firmware version. More...
 
void * m_get_duo_frame ()
 Gets a stereo frame from the DUO3D Camera (void* to be reinterpreted as PDUOFrame) More...
 
bool m_open_duo_camera (int width, int height, float fps)
 Opens DUO3D camera. More...
 
void m_close_duo_camera ()
 Closes DUO3D camera. More...
 
void m_set_exposure (float value)
 Sets DUO3D camera Exposure setting. More...
 
void m_set_gain (float value)
 Sets DUO3D camera Gain setting. More...
 
void m_set_led (float value)
 Sets DUO3D camera LED setting. More...
 

Protected Attributes

TCaptureOptions_DUO3D m_options
 
mrpt::vision::CStereoRectifyMap m_rectify_map
 
void * m_duo
 Opaque pointer to DUO's DUOInstance. More...
 
void * m_pframe_data
 Pointer, to be reinterpreted as "PDUOFrame". More...
 
void * m_evFrame
 DUO's HANDLE. More...
 

Constructor & Destructor Documentation

◆ CDUO3DCamera() [1/2]

mrpt::hwdrivers::CDUO3DCamera::CDUO3DCamera ( )

Default Constructor (does not open the camera)

◆ CDUO3DCamera() [2/2]

mrpt::hwdrivers::CDUO3DCamera::CDUO3DCamera ( const TCaptureOptions_DUO3D options)

Constructor: tries to open the camera with the given options.

Raises an exception on error.

See also
open()

◆ ~CDUO3DCamera()

virtual mrpt::hwdrivers::CDUO3DCamera::~CDUO3DCamera ( )
virtual

Destructor.

Member Function Documentation

◆ captureIMUIsSet()

bool mrpt::hwdrivers::CDUO3DCamera::captureIMUIsSet ( )
inline

Indicates if the camera is grabbing IMU data.

Definition at line 179 of file CDUO3DCamera.h.

References mrpt::hwdrivers::TCaptureOptions_DUO3D::m_capture_imu.

◆ close()

void mrpt::hwdrivers::CDUO3DCamera::close ( )

Stop capture and closes the opened camera, if any.

Called automatically on object destruction.

◆ getCameraOptions()

const TCaptureOptions_DUO3D& mrpt::hwdrivers::CDUO3DCamera::getCameraOptions ( ) const
inline

Returns the current settings of the camera.

Definition at line 151 of file CDUO3DCamera.h.

◆ getEvent()

void* mrpt::hwdrivers::CDUO3DCamera::getEvent ( )
inline

Returned pointer to be reinterpreted as DUO3D's "HANDLE".

Definition at line 182 of file CDUO3DCamera.h.

◆ getObservations()

void mrpt::hwdrivers::CDUO3DCamera::getObservations ( mrpt::obs::CObservationStereoImages outObservation_img,
mrpt::obs::CObservationIMU outObservation_imu,
bool &  there_is_img,
bool &  there_is_imu 
)

Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it.

This method will be typically called in a different thread than other methods, and will be called in a timely fashion.

◆ m_close_duo_camera()

void mrpt::hwdrivers::CDUO3DCamera::m_close_duo_camera ( )
protected

Closes DUO3D camera.

◆ m_get_duo_frame()

void* mrpt::hwdrivers::CDUO3DCamera::m_get_duo_frame ( )
protected

Gets a stereo frame from the DUO3D Camera (void* to be reinterpreted as PDUOFrame)

◆ m_open_duo_camera()

bool mrpt::hwdrivers::CDUO3DCamera::m_open_duo_camera ( int  width,
int  height,
float  fps 
)
protected

Opens DUO3D camera.

◆ m_set_exposure()

void mrpt::hwdrivers::CDUO3DCamera::m_set_exposure ( float  value)
protected

Sets DUO3D camera Exposure setting.

◆ m_set_gain()

void mrpt::hwdrivers::CDUO3DCamera::m_set_gain ( float  value)
protected

Sets DUO3D camera Gain setting.

◆ m_set_led()

void mrpt::hwdrivers::CDUO3DCamera::m_set_led ( float  value)
protected

Sets DUO3D camera LED setting.

◆ open()

void mrpt::hwdrivers::CDUO3DCamera::open ( const TCaptureOptions_DUO3D options,
const bool  startCapture = true 
)

Tries to open the camera with the given options, and starts capturing.

Raises an exception on error.

Parameters
[in]startCaptureIf set to false, the camera is only opened and configured, but a posterior call to startCapture() is required to start grabbing data.
See also
close(), startCapture()

◆ queryVersion()

bool mrpt::hwdrivers::CDUO3DCamera::queryVersion ( std::string  version,
bool  printOutVersion = false 
)
protected

Queries the DUO3D Camera firmware version.

◆ setDataFrame()

void mrpt::hwdrivers::CDUO3DCamera::setDataFrame ( void *  frame)
inline

frame is a reinterpreted PDUOFrame

Definition at line 185 of file CDUO3DCamera.h.

References MRPT_MAKE_ALIGNED_OPERATOR_NEW, exprtk::details::value(), and exprtk::information::version.

◆ startCapture()

void mrpt::hwdrivers::CDUO3DCamera::startCapture ( )

Start the actual data capture of the camera.

Must be called after open(), only when "startCapture" was set to false.

◆ stopCapture()

void mrpt::hwdrivers::CDUO3DCamera::stopCapture ( )

Stop capture.

Member Data Documentation

◆ m_duo

void* mrpt::hwdrivers::CDUO3DCamera::m_duo
protected

Opaque pointer to DUO's DUOInstance.

Definition at line 136 of file CDUO3DCamera.h.

◆ m_evFrame

void* mrpt::hwdrivers::CDUO3DCamera::m_evFrame
protected

DUO's HANDLE.

Definition at line 138 of file CDUO3DCamera.h.

◆ m_options

TCaptureOptions_DUO3D mrpt::hwdrivers::CDUO3DCamera::m_options
protected

Definition at line 131 of file CDUO3DCamera.h.

◆ m_pframe_data

void* mrpt::hwdrivers::CDUO3DCamera::m_pframe_data
protected

Pointer, to be reinterpreted as "PDUOFrame".

Definition at line 137 of file CDUO3DCamera.h.

◆ m_rectify_map

mrpt::vision::CStereoRectifyMap mrpt::hwdrivers::CDUO3DCamera::m_rectify_map
protected

Definition at line 134 of file CDUO3DCamera.h.




Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Sun Nov 26 00:44:48 UTC 2017