本文整理汇总了C++中mrpt::utils::CConfigFileBase::read_int方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfigFileBase::read_int方法的具体用法?C++ CConfigFileBase::read_int怎么用?C++ CConfigFileBase::read_int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrpt::utils::CConfigFileBase
的用法示例。
在下文中一共展示了CConfigFileBase::read_int方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadConfig_sensorSpecific
/*-------------------------------------------------------------
loadConfig_sensorSpecific
-------------------------------------------------------------*/
void CHokuyoURG::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
m_reduced_fov = DEG2RAD( configSource.read_float(iniSection,"reduced_fov",0) ),
m_motorSpeed_rpm = configSource.read_int(iniSection,"HOKUYO_motorSpeed_rpm",0);
m_sensorPose.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_highSensMode = configSource.read_bool(iniSection,"HOKUYO_HS_mode",m_highSensMode);
#ifdef MRPT_OS_WINDOWS
m_com_port = configSource.read_string(iniSection, "COM_port_WIN", m_com_port, true );
#else
m_com_port = configSource.read_string(iniSection, "COM_port_LIN", m_com_port, true );
#endif
m_ip_dir = configSource.read_string(iniSection, "IP_DIR", m_ip_dir );
m_port_dir = configSource.read_int(iniSection, "PORT_DIR", m_port_dir );
m_disable_firmware_timestamp = configSource.read_bool(iniSection, "disable_firmware_timestamp", m_disable_firmware_timestamp);
// Parent options:
C2DRangeFinderAbstract::loadCommonParams(configSource, iniSection);
}
示例2:
/** Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes)
* \exception This method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.
*/
void COpenNI2_RGBD360::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
cout << "COpenNI2_RGBD360::loadConfig_sensorSpecific...\n";
m_sensorPoseOnRobot.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_preview_window = configSource.read_bool(iniSection,"preview_window",m_preview_window);
m_width = configSource.read_int(iniSection,"width",0);
m_height = configSource.read_int(iniSection,"height",0);
m_fps = configSource.read_float(iniSection,"fps",0);
std::cout << "width " << m_width << " height " << m_height << " fps " << m_fps << endl;
m_grab_rgb = configSource.read_bool(iniSection,"grab_image",m_grab_rgb);
m_grab_depth = configSource.read_bool(iniSection,"grab_depth",m_grab_depth);
m_grab_3D_points = configSource.read_bool(iniSection,"grab_3D_points",m_grab_3D_points);
// m_num_sensors = configSource.read_int(iniSection,"m_num_sensors",0);
}
示例3:
/*---------------------------------------------------------------
loadFromConfigFile
---------------------------------------------------------------*/
void COccupancyGridMap2D::TLikelihoodOptions::loadFromConfigFile(
const mrpt::utils::CConfigFileBase &iniFile,
const std::string §ion)
{
MRPT_LOAD_CONFIG_VAR_CAST(likelihoodMethod, int, TLikelihoodMethod, iniFile, section);
enableLikelihoodCache = iniFile.read_bool(section,"enableLikelihoodCache",enableLikelihoodCache);
LF_stdHit = iniFile.read_float(section,"LF_stdHit",LF_stdHit);
LF_zHit = iniFile.read_float(section,"LF_zHit",LF_zHit);
LF_zRandom = iniFile.read_float(section,"LF_zRandom",LF_zRandom);
LF_maxRange = iniFile.read_float(section,"LF_maxRange",LF_maxRange);
LF_decimation = iniFile.read_int(section,"LF_decimation",LF_decimation);
LF_maxCorrsDistance = iniFile.read_float(section,"LF_maxCorrsDistance",LF_maxCorrsDistance);
LF_useSquareDist = iniFile.read_bool(section,"LF_useSquareDist",LF_useSquareDist);
LF_alternateAverageMethod = iniFile.read_bool(section,"LF_alternateAverageMethod",LF_alternateAverageMethod);
MI_exponent = iniFile.read_float(section,"MI_exponent",MI_exponent);
MI_skip_rays = iniFile.read_int(section,"MI_skip_rays",MI_skip_rays);
MI_ratio_max_distance = iniFile.read_float(section,"MI_ratio_max_distance",MI_ratio_max_distance);
rayTracing_useDistanceFilter = iniFile.read_bool(section,"rayTracing_useDistanceFilter",rayTracing_useDistanceFilter);
rayTracing_stdHit = iniFile.read_float(section,"rayTracing_stdHit",rayTracing_stdHit);
consensus_takeEachRange = iniFile.read_int(section,"consensus_takeEachRange",consensus_takeEachRange);
consensus_pow = iniFile.read_float(section,"consensus_pow",consensus_pow);
iniFile.read_vector(section,"OWA_weights",OWA_weights,OWA_weights);
}
示例4: loadConfig_sensorSpecific
/* -----------------------------------------------------
loadConfig_sensorSpecific
----------------------------------------------------- */
void CGPSInterface::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
#ifdef MRPT_OS_WINDOWS
m_COMname = configSource.read_string(iniSection, "COM_port_WIN", m_COMname, true );
#else
m_COMname = configSource.read_string(iniSection, "COM_port_LIN", m_COMname, true );
#endif
m_COMbauds = configSource.read_int( iniSection, "baudRate",m_COMbauds, true );
m_customInit = configSource.read_string( iniSection, "customInit", m_customInit, false );
m_sensorPose.x( configSource.read_float( iniSection, "pose_x",0, false ) );
m_sensorPose.y( configSource.read_float( iniSection, "pose_y",0, false ) );
m_sensorPose.z( configSource.read_float( iniSection, "pose_z",0, false ) );
m_JAVAD_rtk_src_port = configSource.read_string(iniSection, "JAVAD_rtk_src_port",m_JAVAD_rtk_src_port );
m_JAVAD_rtk_src_baud = configSource.read_int(iniSection, "JAVAD_rtk_src_baud",m_JAVAD_rtk_src_baud );
m_JAVAD_rtk_format = configSource.read_string(iniSection,"JAVAD_rtk_format", m_JAVAD_rtk_format );
m_useAIMMode = configSource.read_bool( iniSection,"JAVAD_useAIMMode", m_useAIMMode );
m_data_period = 1.0/configSource.read_double( iniSection,"outputRate", m_data_period );
}
示例5: loadConfig_sensorSpecific
/*-------------------------------------------------------------
loadConfig_sensorSpecific
-------------------------------------------------------------*/
void CHokuyoURG::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
m_reduced_fov = DEG2RAD( configSource.read_float(iniSection,"reduced_fov",0) ),
m_motorSpeed_rpm = configSource.read_int(iniSection,"HOKUYO_motorSpeed_rpm",0);
m_sensorPose.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_highSensMode = configSource.read_bool(iniSection,"HOKUYO_HS_mode",m_highSensMode);
#ifdef MRPT_OS_WINDOWS
m_com_port = configSource.read_string(iniSection, "COM_port_WIN", m_com_port, true );
#else
m_com_port = configSource.read_string(iniSection, "COM_port_LIN", m_com_port, true );
#endif
m_ip_dir = configSource.read_string(iniSection, "IP_DIR", m_ip_dir );
m_port_dir = configSource.read_int(iniSection, "PORT_DIR", m_port_dir );
// FAMD
m_showPreview = configSource.read_bool(iniSection, "preview", false );
// Parent options:
this->loadExclusionAreas(configSource,iniSection);
}
示例6: loadConfig_sensorSpecific
/* -----------------------------------------------------
loadConfig_sensorSpecific
----------------------------------------------------- */
void CGPSInterface::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
m_parser = configSource.read_enum<CGPSInterface::PARSERS>(iniSection,"parser",m_parser,false /*Allow default values*/);
m_raw_dump_file_prefix = configSource.read_string(iniSection,"raw_dump_file_prefix",m_raw_dump_file_prefix,false /*Allow default values*/);
#ifdef MRPT_OS_WINDOWS
m_COMname = configSource.read_string(iniSection, "COM_port_WIN", m_COMname, true );
#else
m_COMname = configSource.read_string(iniSection, "COM_port_LIN", m_COMname, true );
#endif
m_COMbauds = configSource.read_int( iniSection, "baudRate",m_COMbauds, true );
// legacy custom cmds:
m_customInit = configSource.read_string( iniSection, "customInit", m_customInit, false );
// new custom cmds:
m_custom_cmds_delay = configSource.read_float( iniSection, "custom_cmds_delay",m_custom_cmds_delay );
m_custom_cmds_append_CRLF = configSource.read_bool( iniSection, "custom_cmds_append_CRLF",m_custom_cmds_append_CRLF);
// Load as many strings as found on the way:
m_setup_cmds.clear();
for (int i=1; true; i++)
{
std::string sLine = configSource.read_string(iniSection, mrpt::format("setup_cmd%i",i),std::string() );
sLine = mrpt::system::trim( sLine );
if (sLine.empty())
break;
m_setup_cmds.push_back(sLine);
}
m_shutdown_cmds.clear();
for (int i=1; true; i++)
{
std::string sLine = configSource.read_string(iniSection, mrpt::format("shutdown_cmd%i",i),std::string() );
sLine = mrpt::system::trim( sLine );
if (sLine.empty())
break;
m_shutdown_cmds.push_back(sLine);
}
m_sensorPose.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_JAVAD_rtk_src_port = configSource.read_string(iniSection, "JAVAD_rtk_src_port",m_JAVAD_rtk_src_port );
m_JAVAD_rtk_src_baud = configSource.read_int(iniSection, "JAVAD_rtk_src_baud",m_JAVAD_rtk_src_baud );
m_JAVAD_rtk_format = configSource.read_string(iniSection,"JAVAD_rtk_format", m_JAVAD_rtk_format );
m_topcon_useAIMMode = configSource.read_bool( iniSection,"JAVAD_useAIMMode", m_topcon_useAIMMode );
m_topcon_data_period = 1.0/configSource.read_double( iniSection,"outputRate", m_topcon_data_period );
}
示例7: loadConfig_sensorSpecific
/** Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes)
* \exception This method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.
*/
void CKinect::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
m_sensorPoseOnRobot.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_preview_window = configSource.read_bool(iniSection,"preview_window",m_preview_window);
// "Stereo" calibration data:
// [<SECTION>_LEFT] // Depth
// ...
// [<SECTION>_RIGHT] // RGB
// ...
// [<SECTION>_LEFT2RIGHT_POSE]
// pose_quaternion = [x y z qr qx qy qz]
const mrpt::poses::CPose3D twist(0,0,0,DEG2RAD(-90),DEG2RAD(0),DEG2RAD(-90));
mrpt::utils::TStereoCamera sc;
sc.leftCamera = m_cameraParamsDepth; // Load default values so that if we fail to load from cfg at least we have some reasonable numbers.
sc.rightCamera = m_cameraParamsRGB;
sc.rightCameraPose = mrpt::poses::CPose3DQuat(m_relativePoseIntensityWRTDepth - twist);
try {
sc.loadFromConfigFile(iniSection,configSource);
} catch (std::exception &e) {
std::cout << "[CKinect::loadConfig_sensorSpecific] Warning: Ignoring error loading calibration parameters:\n" << e.what();
}
m_cameraParamsDepth = sc.leftCamera;
m_cameraParamsRGB = sc.rightCamera;
m_relativePoseIntensityWRTDepth = twist + mrpt::poses::CPose3D(sc.rightCameraPose);
// Id:
m_user_device_number = configSource.read_int(iniSection,"device_number",m_user_device_number );
m_grab_image = configSource.read_bool(iniSection,"grab_image",m_grab_image);
m_grab_depth = configSource.read_bool(iniSection,"grab_depth",m_grab_depth);
m_grab_3D_points = configSource.read_bool(iniSection,"grab_3D_points",m_grab_3D_points);
m_grab_IMU = configSource.read_bool(iniSection,"grab_IMU",m_grab_IMU );
m_video_channel = configSource.read_enum<TVideoChannel>(iniSection,"video_channel",m_video_channel);
{
std::string s = configSource.read_string(iniSection,"relativePoseIntensityWRTDepth","");
if (!s.empty())
m_relativePoseIntensityWRTDepth.fromString(s);
}
m_initial_tilt_angle = configSource.read_int(iniSection,"initial_tilt_angle",m_initial_tilt_angle);
}
示例8: twist
/** Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes)
* \exception This method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.
*/
void COpenNI2Sensor::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
cout << "COpenNI2Sensor::loadConfig_sensorSpecific...\n";
m_sensorPoseOnRobot.setFromValues(
configSource.read_float(iniSection,"pose_x",0),
configSource.read_float(iniSection,"pose_y",0),
configSource.read_float(iniSection,"pose_z",0),
DEG2RAD( configSource.read_float(iniSection,"pose_yaw",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_pitch",0) ),
DEG2RAD( configSource.read_float(iniSection,"pose_roll",0) )
);
m_preview_window = configSource.read_bool(iniSection,"preview_window",m_preview_window);
width = configSource.read_int(iniSection,"width",0);
height = configSource.read_int(iniSection,"height",0);
fps = configSource.read_float(iniSection,"fps",0);
std::cout << "width " << width << " height " << height << " fps " << fps << endl;
const mrpt::poses::CPose3D twist(0,0,0,DEG2RAD(-90),DEG2RAD(0),DEG2RAD(-90));
mrpt::utils::TStereoCamera sc;
sc.leftCamera = m_cameraParamsDepth; // Load default values so that if we fail to load from cfg at least we have some reasonable numbers.
sc.rightCamera = m_cameraParamsRGB;
sc.rightCameraPose = mrpt::poses::CPose3DQuat(m_relativePoseIntensityWRTDepth - twist);
try {
sc.loadFromConfigFile(iniSection,configSource);
} catch (std::exception &e) {
std::cout << "[COpenNI2Sensor::loadConfig_sensorSpecific] Warning: Ignoring error loading calibration parameters:\n" << e.what();
}
m_cameraParamsDepth = sc.leftCamera;
m_cameraParamsRGB = sc.rightCamera;
m_relativePoseIntensityWRTDepth = twist + mrpt::poses::CPose3D(sc.rightCameraPose);
// Id:
m_user_device_number = configSource.read_int(iniSection,"device_number",m_user_device_number );
cout << "LOAD m_user_device_number " << m_user_device_number << endl;
m_grab_image = configSource.read_bool(iniSection,"grab_image",m_grab_image);
m_grab_depth = configSource.read_bool(iniSection,"grab_depth",m_grab_depth);
m_grab_3D_points = configSource.read_bool(iniSection,"grab_3D_points",m_grab_3D_points);
{
std::string s = configSource.read_string(iniSection,"relativePoseIntensityWRTDepth","");
if (!s.empty())
m_relativePoseIntensityWRTDepth.fromString(s);
}
}
示例9: loadConfig_sensorSpecific
void CImpinjRFID::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
MRPT_START
// TEMPORARILY DISABLED
/* pose_x_1 = configSource.read_float(iniSection,"pose_x_1",0,true);
pose_y_1 = configSource.read_float(iniSection,"pose_y_1",0,true);
pose_z_1 = configSource.read_float(iniSection,"pose_z_1",0,true);
pose_roll_1 = configSource.read_float(iniSection,"pose_roll_1",0,true);
pose_pitch_1 = configSource.read_float(iniSection,"pose_pitch_1",0,true);
pose_yaw_1 = configSource.read_float(iniSection,"pose_yaw_1",0,true);
pose_x_2 = configSource.read_float(iniSection,"pose_x_2",0,true);
pose_y_2 = configSource.read_float(iniSection,"pose_y_2",0,true);
pose_z_2 = configSource.read_float(iniSection,"pose_z_2",0,true);
pose_roll_2 = configSource.read_float(iniSection,"pose_roll_2",0,true);
pose_pitch_2 = configSource.read_float(iniSection,"pose_pitch_2",0,true);
pose_yaw_2 = configSource.read_float(iniSection,"pose_yaw_2",0,true);
*/
IPm = configSource.read_string(iniSection,"local_IP","127.0.0.1",false);
reader_name = configSource.read_string(iniSection,"reader_name","", true);
port = configSource.read_int(iniSection,"listen_port",0,true);
driver_path = configSource.read_string(iniSection,"driver_path","",true);
MRPT_END
}
示例10: loadFromConfigFile
/** Load all the params from a config source, in the format described in saveToConfigFile()
*/
void TMultiResDescOptions::loadFromConfigFile( const mrpt::utils::CConfigFileBase &cfg, const std::string §ion )
{
basePSize = cfg.read_double(section,"basePSize", 23, false );
comLScl = cfg.read_int(section,"comLScl", 0, false );
comHScl = cfg.read_int(section,"comHScl", 6, false );
sg1 = cfg.read_double(section,"sg1", 0.5, false );
sg2 = cfg.read_double(section,"sg2", 7.5, false );
sg3 = cfg.read_double(section,"sg3", 8.0, false );
computeDepth = cfg.read_bool(section,"computeDepth", true, false );
blurImage = cfg.read_bool(section,"blurImage", true, false );
fx = cfg.read_double(section,"fx",0.0, false);
cx = cfg.read_double(section,"cx",0.0, false);
cy = cfg.read_double(section,"cy",0.0, false);
baseline = cfg.read_double(section,"baseline",0.0, false);
computeHashCoeffs = cfg.read_bool(section,"computeHashCoeffs", false, false );
cfg.read_vector(section,"scales",vector<double>(),scales,false);
if(scales.size() < 1)
{
scales.resize(7);
scales[0] = 0.5;
scales[1] = 0.8;
scales[2] = 1.0;
scales[3] = 1.2;
scales[4] = 1.5;
scales[5] = 1.8;
scales[6] = 2.0;
} // end-if
}
示例11: loadConfig
/** Loads the generic settings common to any sensor (See CGenericSensor), then call to "loadConfig_sensorSpecific"
* \exception This method throws an exception with a descriptive message if some critical parameter is missing or has an invalid value.
*/
void CGenericSensor::loadConfig(
const mrpt::utils::CConfigFileBase &cfg,
const std::string § )
{
MRPT_START
m_process_rate = cfg.read_double(sect,"process_rate",0 ); // Leave it to 0 so rawlog-grabber can detect if it's not set by the user.
m_max_queue_len = static_cast<size_t>(cfg.read_int(sect,"max_queue_len",int(m_max_queue_len)));
m_grab_decimation = static_cast<size_t>(cfg.read_int(sect,"grab_decimation",int(m_grab_decimation)));
m_sensorLabel = cfg.read_string( sect, "sensorLabel", m_sensorLabel );
m_grab_decimation_counter = 0;
loadConfig_sensorSpecific(cfg,sect);
MRPT_END
}
示例12: loadConfig_sensorSpecific
/* -----------------------------------------------------
loadConfig_sensorSpecific
----------------------------------------------------- */
void CNTRIPEmitter::loadConfig_sensorSpecific(
const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
#ifdef MRPT_OS_WINDOWS
m_com_port = configSource.read_string(iniSection, "COM_port_WIN", m_com_port, true );
#else
m_com_port = configSource.read_string(iniSection, "COM_port_LIN", m_com_port, true );
#endif
m_com_bauds = configSource.read_int( iniSection, "baudRate",m_com_bauds, true );
m_ntrip_args.mountpoint = mrpt::system::trim( configSource.read_string(iniSection, "mountpoint","",true) );
m_ntrip_args.server = mrpt::system::trim( configSource.read_string(iniSection, "server","",true) );
m_ntrip_args.port = configSource.read_int(iniSection, "port",2101,true);
m_ntrip_args.user = mrpt::system::trim( configSource.read_string(iniSection, "user","") );
m_ntrip_args.password = mrpt::system::trim( configSource.read_string(iniSection, "password","") );
}
示例13: loadConfiguration
void Lidar::loadConfiguration( const mrpt::utils::CConfigFileBase & config, const std::string & sectionName) {
string portName = config.read_string(sectionName, "COM_port_LIN", "/dev/ttyUSB2" );
LOG_LIDAR(DEBUG3) << sectionName << " port name: " << portName << endl;
this->setSerialPort( portName );
int baudRate = config.read_int( sectionName, "COM_baudRate", 38400 );
LOG_LIDAR(DEBUG3) << sectionName << " baudRate: " << baudRate << endl;
this->setBaudRate( baudRate );
int fov = config.read_int( sectionName, "FOV", 180 );
LOG_LIDAR(DEBUG3) << sectionName << " fov: " << fov << endl;
this->setScanFOV( fov );
int res = config.read_int( sectionName, "resolution", 50 );
LOG_LIDAR(DEBUG3) << sectionName << "resolution: " << res / 100. << endl;
this->setScanResolution( config.read_int( sectionName, "resolution", 50 ) ); // 25=0.25deg, 50=0.5deg, 100=1deg
}
示例14: init
void CCascadeClassifierDetection::init(const mrpt::utils::CConfigFileBase &config)
{
#if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM>=0x200
// load configuration values
m_options.cascadeFileName = config.read_string("CascadeClassifier","cascadeFilename","");
m_options.scaleFactor = config.read_double("DetectionOptions","scaleFactor",1.1);
m_options.minNeighbors = config.read_int("DetectionOptions","minNeighbors",3);
m_options.flags = config.read_int("DetectionOptions","flags",0);
m_options.minSize = config.read_int("DetectionOptions","minSize",30);
m_cascade = new CascadeClassifier();
// Load cascade classifier from file
CASCADE->load( m_options.cascadeFileName );
// Check if cascade is empty
if ( CASCADE->empty() )
throw std::runtime_error("Incorrect cascade file.");
#endif
}
示例15: string
void CLMS100Eth::loadConfig_sensorSpecific( const mrpt::utils::CConfigFileBase &configSource,
const std::string &iniSection )
{
C2DRangeFinderAbstract::loadCommonParams(configSource, iniSection);
float pose_x, pose_y, pose_z, pose_yaw, pose_pitch, pose_roll;
pose_x = configSource.read_float(iniSection,"pose_x",0,false);
pose_y = configSource.read_float(iniSection,"pose_y",0,false);
pose_z = configSource.read_float(iniSection,"pose_z",0,false);
pose_yaw = configSource.read_float(iniSection,"pose_yaw",0,false);
pose_pitch = configSource.read_float(iniSection,"pose_pitch",0,false);
pose_roll = configSource.read_float(iniSection,"pose_roll",0,false);
m_ip = configSource.read_string(iniSection, "ip_address", "192.168.0.1", false);
m_port = configSource.read_int(iniSection, "TCP_port", 2111, false);
m_process_rate = configSource.read_int(iniSection, string("process_rate"), 10, false);
m_sensorLabel = configSource.read_string(iniSection, "sensorLabel", "SICK", false);
m_sensorPose = CPose3D( pose_x, pose_y, pose_z,
DEG2RAD( pose_yaw ),DEG2RAD( pose_pitch ), DEG2RAD( pose_roll ));
}