-(CGRect)eyesightBoundingBox {
// Eyesight is 3 robot widths in the direction the robot is facing.
CGRect robotSightBoundingBox;
CGRect robotBoundingBox = [self adjustedBoundingBox];
if ([self flipX]) {
robotSightBoundingBox = CGRectMake(robotBoundingBox.origin.x,
robotBoundingBox.origin.y,
robotBoundingBox.size.width*3.0f,
robotBoundingBox.size.height);
} else {
robotSightBoundingBox = CGRectMake(robotBoundingBox.origin.x - (robotBoundingBox.size.width*2.0f),
robotBoundingBox.origin.y,
robotBoundingBox.size.width*3.0f,
robotBoundingBox.size.height);
}
return robotSightBoundingBox;
}
本文探讨了如何根据机器人所在位置和方向计算其视野范围,包括如何调整视野大小以适应不同场景需求,以及如何利用这一功能进行路径规划。
567

被折叠的 条评论
为什么被折叠?



