class mrpt::hwdrivers::CDUO3DCamera
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
#include <mrpt/hwdrivers/CDUO3DCamera.h> class CDUO3DCamera { public: // construction CDUO3DCamera(); CDUO3DCamera(const TCaptureOptions_DUO3D& options); CDUO3DCamera(const CDUO3DCamera&); // methods CDUO3DCamera& operator = (const CDUO3DCamera&); const TCaptureOptions_DUO3D& getCameraOptions() const; void open(const TCaptureOptions_DUO3D& options, const bool startCapture = true); void startCapture(); void stopCapture(); void close(); void getObservations( mrpt::obs::CObservationStereoImages& outObservation_img, mrpt::obs::CObservationIMU& outObservation_imu, bool& there_is_img, bool& there_is_imu ); bool captureIMUIsSet(); void* getEvent(); void setDataFrame(void* frame); };
Construction
CDUO3DCamera()
Default Constructor (does not open the camera)
Default constructor.
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.
See also:
Methods
const TCaptureOptions_DUO3D& getCameraOptions() const
Returns the current settings of the camera.
void 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. Raises an exception on error.
Parameters:
startCapture |
If set to false, the camera is only opened and configured, but a posterior call to startCapture() is required to start grabbing data. |
See also:
void startCapture()
Start the actual data capture of the camera.
Must be called after open(), only when “startCapture” was set to false.
void stopCapture()
Stop capture.
void close()
Stop capture and closes the opened camera, if any.
Closes DUO camera.
Called automatically on object destruction.
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.
This method will be typically called in a different thread than other methods, and will be called in a timely fashion.
bool captureIMUIsSet()
Indicates if the camera is grabbing IMU data.
void* getEvent()
Returned pointer to be reinterpreted as DUO3D’s “HANDLE”.
void setDataFrame(void* frame)
frame is a reinterpreted PDUOFrame