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".
Definition at line 125 of file CDUO3DCamera.h.
#include <mrpt/hwdrivers/CDUO3DCamera.h>
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_DUO3D & | getCameraOptions () 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... | |
CDUO3DCamera::CDUO3DCamera | ( | ) |
Default Constructor (does not open the camera)
Default constructor.
Definition at line 272 of file CDUO3DCamera.cpp.
References FALSE, m_duo, M_DUO_VALUE, m_evFrame, m_pframe_data, and THROW_EXCEPTION.
CDUO3DCamera::CDUO3DCamera | ( | const TCaptureOptions_DUO3D & | options | ) |
Constructor: tries to open the camera with the given options.
Custom initialization and start grabbing constructor.
Raises an exception on error.
Definition at line 288 of file CDUO3DCamera.cpp.
References FALSE, m_duo, M_DUO_VALUE, m_evFrame, m_pframe_data, open(), and THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 304 of file CDUO3DCamera.cpp.
|
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.
void CDUO3DCamera::close | ( | ) |
Stop capture and closes the opened camera, if any.
Closes DUO camera.
Called automatically on object destruction.
Definition at line 490 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
Referenced by open(), and ~CDUO3DCamera().
|
inline |
Returns the current settings of the camera.
Definition at line 151 of file CDUO3DCamera.h.
|
inline |
Returned pointer to be reinterpreted as DUO3D's "HANDLE".
Definition at line 182 of file CDUO3DCamera.h.
void 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.
Definition at line 425 of file CDUO3DCamera.cpp.
References mrpt::obs::CObservationIMU::dataIsPresent, mrpt::obs::CObservationStereoImages::imageLeft, mrpt::obs::CObservationStereoImages::imageRight, mrpt::utils::CImage::loadFromMemoryBuffer(), mrpt::hwdrivers::TCaptureOptions_DUO3D::m_capture_imu, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_capture_rectified, m_get_duo_frame(), mrpt::hwdrivers::TCaptureOptions_DUO3D::m_img_height, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_img_width, m_options, m_pframe_data, m_rectify_map, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_stereo_camera, mrpt::system::now(), mrpt::obs::CObservationIMU::rawMeasurements, mrpt::vision::CStereoRectifyMap::rectify(), mrpt::obs::CObservationStereoImages::setStereoCameraParams(), and mrpt::obs::CObservation::timestamp.
|
protected |
Closes DUO3D camera.
|
protected |
Gets a stereo frame from the DUO3D Camera (void* to be reinterpreted as PDUOFrame)
Definition at line 501 of file CDUO3DCamera.cpp.
References M_DUO_VALUE, m_evFrame, and m_pframe_data.
Referenced by getObservations().
|
protected |
Opens DUO3D camera.
|
protected |
Sets DUO3D camera Exposure setting.
Definition at line 512 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
|
protected |
Sets DUO3D camera Gain setting.
Definition at line 520 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
|
protected |
Sets DUO3D camera LED setting.
Definition at line 528 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
void CDUO3DCamera::open | ( | const TCaptureOptions_DUO3D & | options, |
const bool | startCapture = true |
||
) |
Tries to open the camera with the given options, and starts capturing.
Tries to open the camera with the given options.
Raises an exception on error.
[in] | startCapture | If set to false, the camera is only opened and configured, but a posterior call to startCapture() is required to start grabbing data. |
Raises an exception on error.
Definition at line 313 of file CDUO3DCamera.cpp.
References close(), duo_params, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_calibration_from_file, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_camera_ext_params_from_yml(), mrpt::hwdrivers::TCaptureOptions_DUO3D::m_camera_int_params_from_yml(), mrpt::hwdrivers::TCaptureOptions_DUO3D::m_capture_rectified, M_DUO_VALUE, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_exposure, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_gain, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_img_height, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_img_width, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_led, m_options, m_rectify_map, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_rectify_map_filename, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_rectify_map_from_yml(), TDUOParams::m_rectify_map_left_x, TDUOParams::m_rectify_map_left_y, TDUOParams::m_rectify_map_right_x, TDUOParams::m_rectify_map_right_y, mrpt::hwdrivers::TCaptureOptions_DUO3D::m_stereo_camera, mrpt::vision::CStereoRectifyMap::setFromCamParams(), startCapture(), THROW_EXCEPTION, version, mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_EMPTY, mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_NAME_NON_CONSISTENT, and mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_OK.
Referenced by CDUO3DCamera().
|
protected |
Queries the DUO3D Camera firmware version.
Definition at line 537 of file CDUO3DCamera.cpp.
References version.
frame is a reinterpreted PDUOFrame
Definition at line 185 of file CDUO3DCamera.h.
void mrpt::hwdrivers::CDUO3DCamera::startCapture | ( | ) |
void mrpt::hwdrivers::CDUO3DCamera::stopCapture | ( | ) |
Stop capture.
|
protected |
Opaque pointer to DUO's DUOInstance.
Definition at line 136 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), and ~CDUO3DCamera().
|
protected |
DUO's HANDLE.
Definition at line 138 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), and m_get_duo_frame().
|
protected |
Definition at line 131 of file CDUO3DCamera.h.
Referenced by getObservations(), and open().
|
protected |
Pointer, to be reinterpreted as "PDUOFrame".
Definition at line 137 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), getObservations(), and m_get_duo_frame().
|
protected |
Definition at line 134 of file CDUO3DCamera.h.
Referenced by getObservations(), and open().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |