本文整理汇总了C++中Observations::front方法的典型用法代码示例。如果您正苦于以下问题:C++ Observations::front方法的具体用法?C++ Observations::front怎么用?C++ Observations::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Observations
的用法示例。
在下文中一共展示了Observations::front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processObservations
///
/// \brief LogicInitiator::processObservations main function which processes new observations
/// to initiation candidates. And compares already existing candidates and observation with use of
/// cascaded logic.
/// \param observations new observations
/// \return new tracks to be initated to tracker
///
InitiatorCandidates LogicInitiator::processObservations(const Observations observations)
{
// declare structure for new tracks which should be initiated by tracker
InitiatorCandidates newTracks;
if(observations.empty()) return newTracks;
// declare structure for accepted candidates
InitiatorCandidates acceptedCandidates;
// Get delta time
double timeDiff = observations.front()->createdAt - m_lastObservationTime;
m_lastObservationTime = observations.front()->createdAt;
// Get observations which could not be matched by the tracker
Observations newObs;
foreach(Observation::Ptr ob, observations)
{
if(!ob->matched)
{
newObs.push_back(ob);
}
}
// Associate new observations with existing candidates for initiation
foreach(InitiatorCandidate::Ptr candidate, m_candidates)
{
// initialize flag if pairing could be found for candidate
bool pairingFound(false);
// If selected number of scans will be reached tracks are created
if(candidate->observations.size() == m_numberScans-1)
{
predictKalman(candidate->state, timeDiff);
candidate->extrapolation = linearExtrapolation(*(candidate->observations.rbegin()+1),
candidate->observations.back(),timeDiff);
foreach(Observation::Ptr observation,newObs)
{
if(compareWithExtrapolation(candidate,observation))
{
if(compareWithCandidate(candidate, observation))
{
if(updateKalman(candidate->state,observation))
{
pairingFound = true;
candidate->missedObs = 0;
observation->matched = true;
candidate->observations.push_back(observation);
newTracks.push_back(candidate);
}
}
}
}
}