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


C++ Kiss类代码示例

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


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

示例1: CHECK_F

bool _Automaton::init(void* pKiss)
{
	CHECK_F(!this->_ThreadBase::init(pKiss));
	Kiss* pK = (Kiss*)pKiss;
	pK->m_pInst = this;

	//create state instances
	Kiss** pItr = pK->getChildItr();

	int i = 0;
	while (pItr[i])
	{
		Kiss* pState = pItr[i++];

		CHECK_F(m_nState >= N_STATE);
		F_ERROR_F(pState->v("state", &m_pStateName[m_nState]));
		m_nState++;
	}

	string startState = "";
	F_ERROR_F(pK->v("startState", &startState));
	m_iState = getStateIdx(&startState);
	CHECK_F(m_iState<0);

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:26,代码来源:_Automaton.cpp

示例2: update

// Runs update logic
void KissFileSampleApp::update() 
{

	// Check if track is playing and has a PCM buffer available
	if (mTrack->isPlaying() && mTrack->isPcmBuffering())
	{

		// Get buffer
		mBuffer = mTrack->getPcmBuffer();
		if (mBuffer && mBuffer->getInterleavedData())
		{

			// Get sample count
			uint32_t mSampleCount = mBuffer->getInterleavedData()->mSampleCount;
			if (mSampleCount > 0)
			{

				// Initialize analyzer, if needed
				if (!mFftInit)
				{
					mFftInit = true;
					mFft.setDataSize(mSampleCount);
				}

				// Analyze data
				if (mBuffer->getInterleavedData()->mData != 0) 
					mFft.setData(mBuffer->getInterleavedData()->mData);

			}

		}

	}

}
开发者ID:afrancois,项目名称:BanTheRewind,代码行数:36,代码来源:KissFileSampleApp.cpp

示例3: CHECK_F

bool APMrover_base::link(void)
{
	CHECK_F(!this->ActionBase::link());
	Kiss* pK = (Kiss*)m_pKiss;

	string iName = "";

	F_INFO(pK->v("_Mavlink", &iName));
	m_pMavlink = (_Mavlink*) (pK->root()->getChildInstByName(&iName));

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:12,代码来源:APMrover_base.cpp

示例4: CHECK_F

bool _Bullseye::link(void)
{
	CHECK_F(!this->_ThreadBase::link());
	Kiss* pK = (Kiss*)m_pKiss;

	//link instance
	string iName = "";
	F_ERROR_F(pK->v("_Stream",&iName));
	m_pStream = (_StreamBase*)(pK->root()->getChildInstByName(&iName));

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:12,代码来源:_Bullseye.cpp

示例5: CHECK_F

bool _Universe::init(void* pKiss)
{
	CHECK_F(this->_ThreadBase::init(pKiss) == false);
	Kiss* pK = (Kiss*)pKiss;
	pK->m_pInst = this;

	F_ERROR_F(pK->v("frameLifetime", &m_frameLifeTime));
	F_ERROR_F(pK->v("probMin", &m_objProbMin));
	F_ERROR_F(pK->v("posDisparity", &m_disparity));

	return true;
}
开发者ID:rmackay9,项目名称:OpenKAI,代码行数:12,代码来源:_Universe.cpp

示例6: CHECK_F

bool HM_follow::link(void)
{
	CHECK_F(this->ActionBase::link()==false);
	Kiss* pK = (Kiss*)m_pKiss;
	string iName = "";

	F_INFO(pK->v("HM_base", &iName));
	m_pHM = (HM_base*) (pK->parent()->getChildInstByName(&iName));

	F_INFO(pK->v("_Universe", &iName));
	m_pUniv = (_Universe*) (pK->root()->getChildInstByName(&iName));

	return true;
}
开发者ID:rmackay9,项目名称:OpenKAI,代码行数:14,代码来源:HM_follow.cpp

示例7: NULL_F

bool _ROITracker::link(void)
{
	NULL_F(m_pKiss);
	Kiss* pK = (Kiss*)m_pKiss;

	//link instance
	string iName = "";
	F_ERROR_F(pK->v("_Stream",&iName));
	m_pStream = (_StreamBase*)(pK->root()->getChildInstByName(&iName));

	//TODO: link variables to Automaton

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:14,代码来源:_ROITracker.cpp

示例8: CHECK_F

bool _SSD::init(void* pKiss)
{
    CHECK_F(!this->_ThreadBase::init(pKiss));
    Kiss* pK = (Kiss*)pKiss;
    pK->m_pInst = this;

    //Setup Caffe Classifier
    string caffeDir = "";
    string modelFile;
    string trainedFile;
    string meanFile;
    string labelFile;
    string presetDir = "";

    F_INFO(pK->root()->o("APP")->v("presetDir", &presetDir));

    F_INFO(pK->v("dir", &caffeDir));
    F_FATAL_F(pK->v("modelFile", &modelFile));
    F_FATAL_F(pK->v("trainedFile", &trainedFile));
    F_FATAL_F(pK->v("meanFile", &meanFile));
    F_FATAL_F(pK->v("labelFile", &labelFile));
    F_INFO(pK->v("minConfidence", &m_confidence_threshold));

    setup(caffeDir + modelFile, caffeDir + trainedFile, caffeDir + meanFile, presetDir + labelFile);
    LOG_I("Initialized");

    m_pFrame = new Frame();

    return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:30,代码来源:_SSD.cpp

示例9: CHECK_F

bool ActionBase::link(void)
{
	CHECK_F(!this->BASE::link());
	Kiss* pK = (Kiss*)m_pKiss;

	string iName="";
	F_INFO(pK->v("_Automaton", &iName));
	m_pAM = (_Automaton*) (pK->root()->getChildInstByName(&iName));

	CHECK_T(m_pAM==NULL);
	iName="";
	CHECK_T(pK->v("activeState", &iName)==false);
	m_iActiveState = m_pAM->getStateIdx(&iName);

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:16,代码来源:ActionBase.cpp

示例10: CHECK_F

bool _Flow::init(void* pKiss)
{
	CHECK_F(!this->_ThreadBase::init(pKiss));
	Kiss* pK = (Kiss*)pKiss;
	pK->m_pInst = this;

	string presetDir = "";
	string labelFile;

	F_INFO(pK->root()->o("APP")->v("presetDir", &presetDir));
	F_INFO(pK->v("bDepth", &m_bDepth));
	F_INFO(pK->v("width", &m_width));
	F_INFO(pK->v("height", &m_height));
	F_INFO(pK->v("flowMax", &m_flowMax));
	F_INFO(pK->v("colorFile", &labelFile));

	m_pDepth = new Frame();
	m_pFarn = cuda::FarnebackOpticalFlow::create();

	m_pGrayFrames = new FrameGroup();
	m_pGrayFrames->init(2);

	m_GDMat = GpuMat(m_height, m_width, CV_32FC1, Scalar(0));

	return true;

	//	m_labelColor = imread(presetDir+labelFile, 1);
	//	m_pGpuLUT = cuda::createLookUpTable(m_labelColor);
	//	m_pSeg = new CamFrame();
	//	m_flowMat = GpuMat(SMALL_WIDTH, SMALL_HEIGHT, CV_32FC2);
}
开发者ID:rmackay9,项目名称:OpenKAI,代码行数:31,代码来源:_Flow.cpp

示例11: draw

// Draw
void KissFileSampleApp::draw()
{

	// Clear screen
	gl::clear(Color(0.0f, 0.0f, 0.0f));

	// Check init flag
	if (mFftInit)
	{

		// Get data
		float * mFreqData = mFft.getAmplitude();
		float * mTimeData = mFft.getData();
		int32_t mDataSize = mFft.getBinSize();

		// Get dimensions
		float mScale = ((float)getWindowWidth() - 20.0f) / (float)mDataSize;
		float mWindowHeight = (float)getWindowHeight();

		// Use polylines to depict time and frequency domains
		PolyLine<Vec2f> mFreqLine;
		PolyLine<Vec2f> mTimeLine;

		// Iterate through data
		for (int32_t i = 0; i < mDataSize; i++) 
		{

			// Do logarithmic plotting for frequency domain
			double mLogSize = log((double)mDataSize);
			float x = (float)(log((double)i) / mLogSize) * (double)mDataSize;
			float y = math<float>::clamp(mFreqData[i] * (x / mDataSize) * log((double)(mDataSize - i)), 0.0f, 2.0f);

			// Plot points on lines
			mFreqLine.push_back(Vec2f(x * mScale + 10.0f,           -y * (mWindowHeight - 20.0f) * 1.25f + (mWindowHeight - 10.0f)));
			mTimeLine.push_back(Vec2f(i * mScale + 10.0f, mTimeData[i] * (mWindowHeight - 20.0f) * 0.3f  + (mWindowHeight * 0.15f + 10.0f)));

		}

		// Draw signals
		gl::draw(mFreqLine);
		gl::draw(mTimeLine);

	}

}
开发者ID:afrancois,项目名称:BanTheRewind,代码行数:46,代码来源:KissFileSampleApp.cpp

示例12: CHECK_F

bool _AutoPilot::link(void)
{
    CHECK_F(!this->BASE::link());
    Kiss* pK = (Kiss*)m_pKiss;

    int i;
    for(i=0; i<m_nAction; i++)
    {
        ActionBase* pA = m_pAction[i];
        F_ERROR_F(pA->link());
    }

    string iName="";
    F_INFO(pK->v("_Automaton", &iName));
    m_pAM = (_Automaton*) (pK->root()->getChildInstByName(&iName));

    return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:18,代码来源:_AutoPilot.cpp

示例13: CHECK_F

bool _Mavlink::init(void* pKiss)
{
	CHECK_F(!this->_ThreadBase::init(pKiss));
	Kiss* pK = (Kiss*) pKiss;
	pK->m_pInst = this;

	Kiss* pCC = pK->o("input");
	CHECK_F(pCC->empty());
	m_pSerialPort = new SerialPort();
	CHECK_F(!m_pSerialPort->init(pCC));

	//init param
	m_systemID = 1;
	m_componentID = MAV_COMP_ID_PATHPLANNER;
	m_type = MAV_TYPE_ONBOARD_CONTROLLER;
	m_targetComponentID = 0;
	m_msg.sysid = 0;
	m_msg.compid = 0;
	m_status.packet_rx_drop_count = 0;

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:22,代码来源:_Mavlink.cpp

示例14: CHECK_F

bool RC_visualFollow::link(void)
{
	CHECK_F(!this->ActionBase::link());
	Kiss* pK = (Kiss*)m_pKiss;

	string iName = "";

	F_INFO(pK->v("_RC", &iName));
	m_pRC = (_RC*) (pK->root()->getChildInstByName(&iName));

	F_INFO(pK->v("RC_base", &iName));
	m_pRCconfig = (RC_base*) (pK->root()->getChildInstByName(&iName));

	F_ERROR_F(pK->v("ROItracker", &iName));
	m_pROITracker = (_ROITracker*) (pK->root()->getChildInstByName(&iName));

	return true;
}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:18,代码来源:RC_visualFollow.cpp

示例15: CHECK_F

bool RC_base::init(void* pKiss)
{
	CHECK_F(this->ActionBase::init(pKiss)==false);
	Kiss* pK = (Kiss*)pKiss;
	pK->m_pInst = this;

	RC_PID cPID;
	RC_CHANNEL RC;
	Kiss* pCC;

	pCC = pK->o("roll");
	CHECK_F(pCC->empty());

	F_ERROR_F(pCC->v("P", &cPID.m_P));
	F_ERROR_F(pCC->v("I", &cPID.m_I));
	F_ERROR_F(pCC->v("Imax", &cPID.m_Imax));
	F_ERROR_F(pCC->v("D", &cPID.m_D));
	F_ERROR_F(pCC->v("dT", &cPID.m_dT));
	m_pidRoll = cPID;

	F_ERROR_F(pCC->v("pwmL", &RC.m_pwmL));
	F_ERROR_F(pCC->v("pwmH", &RC.m_pwmH));
	F_ERROR_F(pCC->v("pwmN", &RC.m_pwmN));
	F_ERROR_F(pCC->v("pwmCh", &RC.m_iCh));
	m_rcRoll = RC;

	pCC = pK->o("pitch");
	CHECK_F(pCC->empty());

	F_ERROR_F(pCC->v("P", &cPID.m_P));
	F_ERROR_F(pCC->v("I", &cPID.m_I));
	F_ERROR_F(pCC->v("Imax", &cPID.m_Imax));
	F_ERROR_F(pCC->v("D", &cPID.m_D));
	F_ERROR_F(pCC->v("dT", &cPID.m_dT));
	m_pidPitch = cPID;

	F_ERROR_F(pCC->v("pwmL", &RC.m_pwmL));
	F_ERROR_F(pCC->v("pwmH", &RC.m_pwmH));
	F_ERROR_F(pCC->v("pwmN", &RC.m_pwmN));
	F_ERROR_F(pCC->v("pwmCh", &RC.m_iCh));
	m_rcPitch = RC;

	pCC = pK->o("alt");
	CHECK_F(pCC->empty());

	F_ERROR_F(pCC->v("P", &cPID.m_P));
	F_ERROR_F(pCC->v("I", &cPID.m_I));
	F_ERROR_F(pCC->v("Imax", &cPID.m_Imax));
	F_ERROR_F(pCC->v("D", &cPID.m_D));
	F_ERROR_F(pCC->v("dT", &cPID.m_dT));
	m_pidAlt = cPID;

	F_ERROR_F(pCC->v("pwmL", &RC.m_pwmL));
	F_ERROR_F(pCC->v("pwmH", &RC.m_pwmH));
	F_ERROR_F(pCC->v("pwmN", &RC.m_pwmN));
	F_ERROR_F(pCC->v("pwmCh", &RC.m_iCh));
	m_rcAlt = RC;

	pCC = pK->o("yaw");
	CHECK_F(pCC->empty());

	F_ERROR_F(pCC->v("P", &cPID.m_P));
	F_ERROR_F(pCC->v("I", &cPID.m_I));
	F_ERROR_F(pCC->v("Imax", &cPID.m_Imax));
	F_ERROR_F(pCC->v("D", &cPID.m_D));
	F_ERROR_F(pCC->v("dT", &cPID.m_dT));
	m_pidYaw = cPID;

	F_ERROR_F(pCC->v("pwmL", &RC.m_pwmL));
	F_ERROR_F(pCC->v("pwmH", &RC.m_pwmH));
	F_ERROR_F(pCC->v("pwmN", &RC.m_pwmN));
	F_ERROR_F(pCC->v("pwmCh", &RC.m_iCh));
	m_rcYaw = RC;

	return true;
}
开发者ID:rmackay9,项目名称:OpenKAI,代码行数:76,代码来源:RC_base.cpp


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