quote: Original post by liquidAir
I think there''s a problem with the field of view. The bot doesn''t tend to see objects which are directly in front of it, but the objects need to be detected from either of the edges of the FOV before it sees it, and if another object is detected at the FOV-edge, it stops seeing the former object. Well, my bot''s obstacle avoidance is just horrible due to this, and ends up getting stuck in a corner or a cluster of objects most of the time. Anyone else having this problem?
[edited by - liquidAir on August 10, 2003 3:39:19 PM]
Here''s the reason it was implemented the way it is (with perpendiculars) - GetObjectsInSight() returns the direction and distance to an object. Well, a wall is a long object with no center. Distance can be any value of distance from your left FOV to your right FOV. Direction can be any angle in that range as well. So what do you pick? You can''t do center of your FOV, because then you are stuck in an even worse situation than you currently have as you can''t see a wall unless it''s forwardly visible.
The only other option I came up with, while also sticking to the same object data retrieval method (GetObjectsInSight) for consistency, was to reference a vector from the bot that intersects the wall perpendicularly. While not fool-proof, it is fair and does provide a reasonable way for you to detect a wall.
The other option, and one that the interface will probably evolve into, is to create another function that is strictly for wall detection. This is more reasonable, IMO, because walls have different attributes and properties than your run-of-the-mill object.