// ------------------------------------------------------------
//  Config file for the "RawLogGrabber" application
// 
//               ~ The MRPT Library ~
//           Jose Luis Blanco Claraco (C) 2005-2008
// ------------------------------------------------------------

//  Each section [XXXXX] (but [global]) setups a thread in the RawLogGrabber 
//   standalone application. Each thread collects data from some
//   sensor or device, then the main thread groups and orders them before
//   streaming everything to a rawlog file.
//
//  The name of the sections can be arbitrary and independent of the sensor label. 
//   The driver for each sensor is actually determined by the field "driver", which must
//   match the name of some class in mrpt::hwdrivers implementing CGenericSensor.

// =======================================================
//  Section: Global settings to the application
//   
// =======================================================
[global]
// The prefix can contain a relative or absolute path.
// The final name will be <PREFIX>_date_time.rawlog
rawlog_prefix		= duo3d_dataset

// Milliseconds between thread launches
time_between_launches	= 800

use_sensoryframes	= 0

GRABBER_PERIOD_MS	= 1000

// =======================================================
//  SENSOR: DUO3DCamera  
// =======================================================
[DUO3DCamera]
driver				= CCameraSensor
process_rate		= 80		// Hz

sensorLabel			= DUO3DCamera

grabber_type	    = duo3d
preview_decimation  = 5

pose_x				= 0.5// position on the robot (meters)
pose_y				= 0
pose_z				= 0
pose_yaw			= 0	// Angles in degrees
pose_pitch			= 0
pose_roll			= 0

// For externaly stored images, the format of image files (default=jpg)
external_images_format = jpg

// For externaly stored images: whether to spawn an independent process to save the image files.
external_images_own_thread  = 1

// If external_images_own_thread=1, this changes the number of threads to launch
//  to save image files. The default is determined from mrpt::system::getNumberOfProcessors()
//  and should be OK unless you want to save processor time for other things.
//external_images_own_thread_count = 2    // >=1

// (Only when external_images_format=jpg): Optional parameter to set the JPEG compression quality:
//external_images_jpeg_quality = 95    // [1-100]. Default: 95

[DUO3DOptions]
rawlog-grabber-ignore = true // Instructs rawlog-grabber to ignore this section (it is not a separate device!)

image_width   			= 640
image_height  			= 480
capture_rectified 		= true
capture_imu 			= true
calibration_from_file	= false

exposure 				= 50
gain					= 50
led						= 0

intrinsic_filename		= ./duo_calibration/intrinsics_R640x480_B1x1.yml
extrinsic_filename		= ./duo_calibration/stereo_R640x480_B1x1.yml
rectify_map_filename	= ./duo_calibration/rectifyMap_R640x480_B1x1.yml

[DUO3D_LEFT]
rawlog-grabber-ignore = true // Instructs rawlog-grabber to ignore this section (it is not a separate device!)
resolution=[640 480]
cx=290.08707
cy=272.52321
fx=378.84599
fy=378.75536
dist=[-1.246667e-001 -5.436665e-001 -2.376481e-003 -5.422322e-003 -2.217852e+000]

[DUO3D_RIGHT]
rawlog-grabber-ignore = true // Instructs rawlog-grabber to ignore this section (it is not a separate device!)
resolution=[640 480]
cx=294.13485
cy=275.04717
fx=378.84599
fy=378.75536
dist=[3.245474e+000 -2.404337e+000 -3.230123e-004 1.050248e-003 -3.428238e+000]

[DUO3D_LEFT2RIGHT_POSE]
rawlog-grabber-ignore = true // Instructs rawlog-grabber to ignore this section (it is not a separate device!)
pose_quaternion=[0.028050 0.000514 -0.000711 0.999965 -0.005614 0.005452 -0.002796]
