MRPT
1.9.9
|
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 153 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... | |
CDUO3DCamera (const CDUO3DCamera &)=delete | |
CDUO3DCamera & | operator= (const CDUO3DCamera &)=delete |
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 {nullptr} |
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 294 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 310 of file CDUO3DCamera.cpp.
References FALSE, m_duo, M_DUO_VALUE, m_evFrame, m_pframe_data, open(), and THROW_EXCEPTION.
|
delete |
|
virtual |
Destructor.
Definition at line 328 of file CDUO3DCamera.cpp.
References close(), m_duo, and M_DUO_PTR.
|
inline |
Indicates if the camera is grabbing IMU data.
Definition at line 219 of file CDUO3DCamera.h.
References mrpt::hwdrivers::TCaptureOptions_DUO3D::m_capture_imu, and m_options.
void CDUO3DCamera::close | ( | ) |
Stop capture and closes the opened camera, if any.
Closes DUO camera.
Called automatically on object destruction.
Definition at line 549 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
Referenced by open(), and ~CDUO3DCamera().
|
inline |
Returns the current settings of the camera.
Definition at line 185 of file CDUO3DCamera.h.
References m_options.
|
inline |
Returned pointer to be reinterpreted as DUO3D's "HANDLE".
Definition at line 221 of file CDUO3DCamera.h.
References m_evFrame.
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 485 of file CDUO3DCamera.cpp.
References mrpt::obs::CObservationIMU::dataIsPresent, mrpt::obs::CObservationStereoImages::imageLeft, mrpt::obs::CObservationStereoImages::imageRight, mrpt::img::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 560 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 573 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
|
protected |
Sets DUO3D camera Gain setting.
Definition at line 581 of file CDUO3DCamera.cpp.
References M_DUO_VALUE.
|
protected |
Sets DUO3D camera LED setting.
Definition at line 589 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 342 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, mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_EMPTY, mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_NAME_NON_CONSISTENT, and mrpt::hwdrivers::TCaptureOptions_DUO3D::yrr_OK.
Referenced by CDUO3DCamera().
|
delete |
|
protected |
Queries the DUO3D Camera firmware version.
Definition at line 598 of file CDUO3DCamera.cpp.
frame is a reinterpreted PDUOFrame
Definition at line 223 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 164 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), and ~CDUO3DCamera().
|
protected |
DUO's HANDLE.
Definition at line 168 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), getEvent(), and m_get_duo_frame().
|
protected |
Definition at line 158 of file CDUO3DCamera.h.
Referenced by captureIMUIsSet(), getCameraOptions(), getObservations(), and open().
|
protected |
Pointer, to be reinterpreted as "PDUOFrame".
Definition at line 166 of file CDUO3DCamera.h.
Referenced by CDUO3DCamera(), getObservations(), and m_get_duo_frame().
|
protected |
Definition at line 161 of file CDUO3DCamera.h.
Referenced by getObservations(), and open().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019 |