本文整理汇总了C++中ArActionDesired::getVel方法的典型用法代码示例。如果您正苦于以下问题:C++ ArActionDesired::getVel方法的具体用法?C++ ArActionDesired::getVel怎么用?C++ ArActionDesired::getVel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArActionDesired
的用法示例。
在下文中一共展示了ArActionDesired::getVel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calcvclose
inline ArActionDesired *ArActionFollowTarget::fire(ArActionDesired currentDesired)
{
double tempvel;
//double temprotvel;
// reset the actionDesired (must be done), to clear
// its previous values.
//myDesired.reset();
if(m_rel_distance > dnear)
{
//target is safe
if(m_rel_distance < dclose)
{
//target is close
tempvel = calcvclose();
}
else
{
//target is far
tempvel = calcvfar();
}
}
else
{
//brake
tempvel = 0;
}
tempvel = (tempvel > m_speed_limit)? (m_speed_limit) : (tempvel) ;
double absoffset = ::fabs(m_rel_offset);
if ( absoffset > th_near)
{
if(absoffset < th_close )
{
//myDesired.setRotVel();
double numer = (m_rel_offset - th_near)*(m_rel_offset - th_near);
double denom = (th_close - th_near)* (th_close - th_near);
myDesired.setDeltaHeading (my_sign(m_rel_offset)*deltah_close * (numer/denom) );
}
else
{
tempvel *= speed_dump;
myDesired.setDeltaHeading( my_sign(m_rel_offset)*deltah_max);
}
}
else
{
myDesired.setDeltaHeading(0);
}
myDesired.setVel(tempvel);
printf("Desired: VEL: %f dHeading: %f \n", myDesired.getVel()
,myDesired.getDeltaHeading());
return &myDesired;
}