I am working on a project with a robot that needs to find its way to the object and avoid some obstacles when moving to the object that it should pick up.
The problem is that the robot and the object to be assembled by the robot have a width of one pixel in the pointer. In fact, they are much larger. Often A * pathfinder chooses a route along the edges of obstacles, sometimes it encounters them, which we do not want to do.
I tried to add some more intransitive fields to the obstacles, but this does not always work well. He still encounters obstacles, also adding too many points where he is not allowed to walk, leading to the fact that there is no way.
Do you have any suggestions on what to do with this problem?
Edit:
So, I did as Justin L suggested, adding a lot of cost to the hurdles that lead to the following: Grid without path http://sogaard.us/uploades/1_grid_no_path.png
Here you can see the value around the obstacles, initially the middle two obstacles should look the same as those in the corners, but after starting our pathfinder it seems that the costs are redefined:
Grid with outline http://sogaard.us/uploades/1_map_grid.png
Image showing everything in the picture http://sogaard.us/uploades/2_complete_map.png
The figure above shows what things are in the picture.
Found path http://sogaard.us/uploades/3_path.png
This is a path that, like our problem before, embraces an obstacle.
Default mesh with track http://sogaard.us/uploades/4_mg_path.png
And another image with a cost map with a track.
So I find it strange why A * pathfinder redefines these field costs, which are very high.
Will it be when he evaluates the nodes inside the open list with the current field to see if the current path by fields is shorter than the one inside the open list?
And here is the code I use for pathfinder:
Pathfinder.cs: http://pastebin.org/343774
Field.cs and Grid.cs: http://pastebin.org/343775