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


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

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


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

示例1: interpolate


//.........这里部分代码省略.........

		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);
			qc.setArray(qf.m_data);

			updateOriQuat(qf,i);
		}

		if (pa.m_infoList[i].m_oriEul != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_oriEul != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			ea = pa.getOriEuler(i);		eb = pb.getOriEuler(i);
			ec.m_roll  = (g*(double)ea.m_roll  + f*(double)eb.m_roll);
			ec.m_pitch = (g*(double)ea.m_pitch + f*(double)eb.m_pitch);
			ec.m_yaw   = (g*(double)ea.m_yaw   + f*(double)eb.m_yaw);
			updateOriEuler(ec,i);
		}

		if (pa.m_infoList[i].m_oriMat != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_oriMat != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			mf = pa.getOriMatrix(i);
			m.isArray(&mf.m_data[0][0]);
			qa.isRmat(m);

			mf = pb.getOriMatrix(i);
			m.isArray(&mf.m_data[0][0]);
			qb.isRmat(m);

			qc.isSlerp(qa,qb,f);
			m.isQuat(qc);

			m.setArray(&mf.m_data[0][0]);
			updateOriMatrix(mf,i);
		}

		//// other
		if (pa.m_infoList[i].m_sc != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_sc != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			sa = pa.getSampleCounter(i);	sb = pb.getSampleCounter(i);
			sc = sb - sa;
			dc = f*(double) sc;
			sc = sa + (uint16_t) doubleToLong(dc);
			updateSampleCounter(sc,i);
		}

		if (pa.m_infoList[i].m_acc_g != CMT_DATA_ITEM_NOT_AVAILABLE && pb.m_infoList[i].m_acc_g != CMT_DATA_ITEM_NOT_AVAILABLE)
		{
			fa = pa.getAccG(i);		fb = pb.getAccG(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]);
			updateAccG(fc,i);
		}
	}
	// some remaining stuff
	// TOA remains equal to pb TOA
	m_rtc = (TimeStamp) (g*(double) pa.m_rtc + f*(double) pb.m_rtc);
}
开发者ID:chen0510566,项目名称:mrpt,代码行数:101,代码来源:cmtpacket.cpp


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