当前位置: 首页>>代码示例>>C++>>正文


C++ Matrix3x3::isArray方法代码示例

本文整理汇总了C++中Matrix3x3::isArray方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3x3::isArray方法的具体用法?C++ Matrix3x3::isArray怎么用?C++ Matrix3x3::isArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Matrix3x3的用法示例。


在下文中一共展示了Matrix3x3::isArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: interpolate

void Packet::interpolate(const Packet& pa, const Packet& pb, const double f)
{
	pa.getDataSize();
	pb.getDataSize();

	*this = pb;

	if (m_itemCount != pa.m_itemCount)
		return;

	getDataSize();
	CmtShortVector va, vb, vc;
	CmtVector fa, fb, fc;
	CmtQuat qf;
	CmtEuler ea, eb, ec;
	CmtMatrix mf;

	Quaternion qa, qb, qc;
	Matrix3x3 m;

	double g = 1.0-f;
	double da, db, dc;
	uint16_t sa, sb, sc;

	// walk over all items and interpolate all data items
	for (uint16_t i = 0; i < m_itemCount; ++i)
	{
		//// raw data
		if (pa.m_infoList[i].m_rawAcc != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_rawAcc != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			va = pa.getRawAcc(i);		vb = pb.getRawAcc(i);
			vc.m_data[0] = (uint16_t) (g*(double)va.m_data[0] + f*(double)vb.m_data[0]);
			vc.m_data[1] = (uint16_t) (g*(double)va.m_data[1] + f*(double)vb.m_data[1]);
			vc.m_data[2] = (uint16_t) (g*(double)va.m_data[2] + f*(double)vb.m_data[2]);
			updateRawAcc(vc,i);
		}

		if (pa.m_infoList[i].m_rawGyr != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_rawGyr != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			va = pa.getRawGyr(i);		vb = pb.getRawGyr(i);
			vc.m_data[0] = (uint16_t) (g*(double)va.m_data[0] + f*(double)vb.m_data[0]);
			vc.m_data[1] = (uint16_t) (g*(double)va.m_data[1] + f*(double)vb.m_data[1]);
			vc.m_data[2] = (uint16_t) (g*(double)va.m_data[2] + f*(double)vb.m_data[2]);
			updateRawGyr(vc,i);
		}

		if (pa.m_infoList[i].m_rawMag != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_rawMag != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			va = pa.getRawMag(i);		vb = pb.getRawMag(i);
			vc.m_data[0] = (uint16_t) (g*(double)va.m_data[0] + f*(double)vb.m_data[0]);
			vc.m_data[1] = (uint16_t) (g*(double)va.m_data[1] + f*(double)vb.m_data[1]);
			vc.m_data[2] = (uint16_t) (g*(double)va.m_data[2] + f*(double)vb.m_data[2]);
			updateRawMag(vc,i);
		}

		if (pa.m_infoList[i].m_rawTemp != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_rawTemp != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			da = (double) pa.getRawTemp(i);		db = (double) pb.getRawTemp(i);
			dc = g*da + f*db;
			updateRawTemp((uint16_t) dc,i);
		}

		//// calibrated data
		if (pa.m_infoList[i].m_calAcc != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_calAcc != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			fa = pa.getCalAcc(i);		fb = pb.getCalAcc(i);
			fc.m_data[0] = (g*(double)fa.m_data[0] + f*(double)fb.m_data[0]);
			fc.m_data[1] = (g*(double)fa.m_data[1] + f*(double)fb.m_data[1]);
			fc.m_data[2] = (g*(double)fa.m_data[2] + f*(double)fb.m_data[2]);
			updateCalAcc(fc,i);
		}

		if (pa.m_infoList[i].m_calGyr != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_calGyr != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			fa = pa.getCalGyr(i);		fb = pb.getCalGyr(i);
			fc.m_data[0] = (g*(double)fa.m_data[0] + f*(double)fb.m_data[0]);
			fc.m_data[1] = (g*(double)fa.m_data[1] + f*(double)fb.m_data[1]);
			fc.m_data[2] = (g*(double)fa.m_data[2] + f*(double)fb.m_data[2]);
			updateCalGyr(fc,i);
		}

		if (pa.m_infoList[i].m_calMag != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_calMag != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			fa = pa.getCalMag(i);		fb = pb.getCalMag(i);
			fc.m_data[0] = (g*(double)fa.m_data[0] + f*(double)fb.m_data[0]);
			fc.m_data[1] = (g*(double)fa.m_data[1] + f*(double)fb.m_data[1]);
			fc.m_data[2] = (g*(double)fa.m_data[2] + f*(double)fb.m_data[2]);
			updateCalMag(fc,i);
		}

		//// orientations
		if (pa.m_infoList[i].m_oriQuat != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_oriQuat != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			qf = pa.getOriQuat(i);
			qa.isArray(qf.m_data);

			qf = pb.getOriQuat(i);
			qb.isArray(qf.m_data);

			qc.isSlerp(qa,qb,f);
//.........这里部分代码省略.........
开发者ID:chen0510566,项目名称:mrpt,代码行数:101,代码来源:cmtpacket.cpp


注:本文中的Matrix3x3::isArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。