本文整理汇总了C++中Cat::getCriticalIntensity方法的典型用法代码示例。如果您正苦于以下问题:C++ Cat::getCriticalIntensity方法的具体用法?C++ Cat::getCriticalIntensity怎么用?C++ Cat::getCriticalIntensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cat
的用法示例。
在下文中一共展示了Cat::getCriticalIntensity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callBackLaserScan
/**
* Call back method for laser work out the avoidance logic for Cat
*/
void callBackLaserScan(const sensor_msgs::LaserScan msg) {
cat.stageLaser_callback(msg);//call supercalss laser call back for detection case work out
if (cat.getAvoidanceCase()!=Entity::NONE&&!cat.isRotating()) {//check if there is need to avoid obstacle
if(cat.getCriticalIntensity()!=2&&cat.getAvoidanceQueueSize()==0&&cat.getObstacleStatus().compare("Obstacle nearby")!=0){
cat.setObstacleStatus("Obstacle nearby");
cat.avoidObstacle(2.5,0.5);//call avoid obstacle method in entity to avoid obstacle
}else if (cat.getMinDistance()<0.7&&cat.getCriticalIntensity()>=1&&cat.getAvoidanceQueueSize()>0){
cat.addMovementFront("forward_x",0,0,1);//halt movement if already have obstacle
}
cat.move();
}else{
cat.setObstacleStatus("No obstacles");
}
}