コード例 #1
0
ファイル: CBoardENoses.cpp プロジェクト: bergercookie/mrpt
/*-------------------------------------------------------------
					loadConfig_sensorSpecific
-------------------------------------------------------------*/
void CBoardENoses::loadConfig_sensorSpecific(
	const mrpt::config::CConfigFileBase& configSource,
	const std::string& iniSection)
{
	MRPT_START

	m_usbSerialNumber =
		configSource.read_string(iniSection, "USB_serialname", "", false);

#ifdef _WIN32
	m_COM_port =
		configSource.read_string(iniSection, "COM_port_WIN", m_COM_port);
#else
	m_COM_port =
		configSource.read_string(iniSection, "COM_port_LIN", m_COM_port);
#endif
	m_COM_baud =
		configSource.read_uint64_t(iniSection, "COM_baudRate", m_COM_baud);

	configSource.read_vector(
		iniSection, "enose_poses_x", vector<float>(0), enose_poses_x, true);
	configSource.read_vector(
		iniSection, "enose_poses_y", vector<float>(0), enose_poses_y, true);
	configSource.read_vector(
		iniSection, "enose_poses_z", vector<float>(0), enose_poses_z, true);

	configSource.read_vector(
		iniSection, "enose_poses_yaw", vector<float>(0), enose_poses_yaw, true);
	configSource.read_vector(
		iniSection, "enose_poses_pitch", vector<float>(0), enose_poses_pitch,
		true);
	configSource.read_vector(
		iniSection, "enose_poses_roll", vector<float>(0), enose_poses_roll,
		true);

	ASSERT_(enose_poses_x.size() == enose_poses_y.size());
	ASSERT_(enose_poses_x.size() == enose_poses_z.size());
	ASSERT_(enose_poses_x.size() == enose_poses_yaw.size());
	ASSERT_(enose_poses_x.size() == enose_poses_pitch.size());
	ASSERT_(enose_poses_x.size() == enose_poses_roll.size());

	// Pass angles to radians:
	enose_poses_yaw *= M_PIf / 180.0f;
	enose_poses_pitch *= M_PIf / 180.0f;
	enose_poses_roll *= M_PIf / 180.0f;

	MRPT_END
}
コード例 #2
0
ファイル: CEnoseModular.cpp プロジェクト: jiapei100/mrpt
/*-------------------------------------------------------------
					loadConfig_sensorSpecific
-------------------------------------------------------------*/
void CEnoseModular::loadConfig_sensorSpecific(
	const mrpt::config::CConfigFileBase& configSource,
	const std::string& iniSection)
{
	MRPT_START

	m_usbSerialNumber =
		configSource.read_string(iniSection, "USB_serialname", "", false);

#ifdef _WIN32
	m_COM_port = configSource.read_string(iniSection, "COM_port_WIN", "COM1");
#else
	m_COM_port =
		configSource.read_string(iniSection, "COM_port_LIN", m_COM_port);
#endif
	m_COM_baud =
		configSource.read_uint64_t(iniSection, "COM_baudRate", m_COM_baud);

	MRPT_END
}