本文整理汇总了C++中DistanceStat::IsDefined方法的典型用法代码示例。如果您正苦于以下问题:C++ DistanceStat::IsDefined方法的具体用法?C++ DistanceStat::IsDefined怎么用?C++ DistanceStat::IsDefined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistanceStat
的用法示例。
在下文中一共展示了DistanceStat::IsDefined方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
CalculatePirker(DistanceStat &pirker, const DistanceStat &planned,
const DistanceStat &remaining_effective)
{
if (planned.IsDefined() && remaining_effective.IsDefined())
pirker.set_distance(planned.get_distance() -
remaining_effective.get_distance());
else
pirker.Reset();
}
示例2:
void
DistanceStatComputer::ResetIncrementalSpeed(DistanceStat &data)
{
fixed distance = data.IsDefined() ? data.GetDistance() : fixed_zero;
fixed speed = data.IsDefined() ? data.GetSpeed() : fixed_zero;
df.Reset(distance, (is_positive ? -1 : 1) * speed);
v_lpf.Reset((is_positive ? -1 : 1) * speed);
data.speed_incremental = fixed_zero; // data.speed;
av_dist.Reset();
}
示例3: fixed
void
IncrementalSpeedComputer::Reset(DistanceStat &data)
{
fixed distance = data.IsDefined() ? data.GetDistance() : fixed(0);
fixed speed = data.IsDefined() ? data.GetSpeed() : fixed(0);
df.Reset(distance, (is_positive ? -1 : 1) * speed);
v_lpf.Reset((is_positive ? -1 : 1) * speed);
data.speed_incremental = fixed(0); // data.speed;
av_dist.Reset();
last_time = fixed(-1);
}
示例4: if
void
DistanceStatComputer::CalcIncrementalSpeed(DistanceStat &data, const fixed dt)
{
if ((dt + fixed_half >= fixed_one) && data.IsDefined()) {
if (av_dist.Update(data.distance)) {
const fixed d_av = av_dist.Average() / N_AV;
av_dist.Reset();
fixed v_f = fixed_zero;
for (unsigned i = 0; i < (unsigned)(dt + fixed_half); ++i) {
const fixed v = df.Update(d_av);
v_f = v_lpf.Update(v);
}
data.speed_incremental = (is_positive ? -v_f : v_f);
}
} else if (!positive(dt) || !data.IsDefined()) {
ResetIncrementalSpeed(data);
}
}