karlkurzer / path_planner

Hybrid A* Path Planner for the KTH Research Concept Vehicle
http://karlkurzer.github.io/path_planner/
BSD 3-Clause "New" or "Revised" License
1.54k stars 536 forks source link

"tie occured, please check for error in script" #4

Closed PPokorski closed 5 years ago

PPokorski commented 6 years ago

Hi! First of all thanks your work. It seems to be working really nice, however adjusting parameters is a drawback here :) I tried to launch your node with following parameters: static const float r = 1.0; static const float cellSize = 0.05; in include/constants.h const float Node3D::dy[] = { 0, -0.00693155, 0.00693155}; const float Node3D::dx[] = { 0.1178097, 0.117537333, 0.117537333}; const float Node3D::dt[] = { 0, 0.1178097, -0.1178097}; in src/node3d.cpp

Also I resized map_demo.pmg 10x times and in file maps/map.yaml I set: resolution: 0.05 Then at program start the error in the title occurs. Could you help me with this issue?

karlkurzer commented 6 years ago

Hey,

Thanks; I know there are a lot of things that could be improved here, if you implement an improvement, I would be happy if you create a corresponding merge request.

Regarding your issue, I don't currently have the time to exactly tell you what the issue is, but I guess something is up during the ray tracing for the specific grid resolution. So the algorithm used, where the error occurs is described in "A Fast Voxel Traversal Algorithm for Ray Tracing", please have a look.

Anyway, usually I ran the algorithm with a cell size of 0.5m (for which I never encountered the error) so reducing it by factor ten is in general reasonable, however I would suggest shortening the available actions (dy[], dx[], dt[]) by a similar factor, as optimality will suffer greatly otherwise.

I hope that helped!

PPokorski commented 6 years ago

Thanks for your response, I'll look into the algorithm ;) But I have the question: You mention that dy, dx, dy were calculated for a cell size of 0.5m, whereas in your code the cell size of 1 m. So, how did you exactly calculated those three various (what time step / distance?) And how those values correspond to the minimum turning radius? And finally: would it be easy to adapt this algorithm to the differential drive model (e.g. enable turning in place)?

karlkurzer commented 6 years ago

@PPokorski for holonomic vehicles without a minimum turning radius this algorithm does not really make any sense, you can just use a standard A. The two steered actions correspond to the path the vehicle travels with its maximum steering angle left and right, the length is chosen more or less arbitrarily, but you empirically I found a good length is `$$\sqrt{2cellSize^2}/2$$`, the length for all three motions is the same.

gongyue666 commented 6 years ago

I get the same error ,how to slove it?

karlkurzer commented 6 years ago

@gongyue666 as I am not actively developing this project anymore I can only give you the same answer as before. I guess something is up during the ray tracing for the specific grid resolution. So the algorithm used, where the error occurs is described in "A Fast Voxel Traversal Algorithm for Ray Tracing", please have a look.

gongyue666 commented 6 years ago

Ok , thanks for your reply.Another question : I don't understand some param actually means ,can you give me more papers, eg. the dubins.cpp part ??I am newer~~~

karlkurzer commented 6 years ago

@gongyue666 take a look at Dubins Path and the code by Andrew Walker

gongyue666 commented 6 years ago

thank you very mush!

gongyue666 commented 6 years ago

Hi,I think the error above lead by the param positionResolution =1 and cellSize = 0.05 (when I set the two params like this ,the error do not happen again, but I do not know why, for I can't understand the function inline void collisionLookup(Constants::config* lookup); Now, though the program work but it do not play well in a small ratio map with params width = 0,35 length = 0.45 ,positionResolution =1 and cellSize = 0.05. The path has too many curves when there is no obstacle ,I think it should be a stratight line . Can you give me some advice?

gongyue666 commented 6 years ago

I find out there may be a bug in : struct config { /// the number of cells occupied by this configuration of the vehicle int length; /*! \var relPos pos[64] \brief The maximum number of occupied cells \todo needs to be dynamic */ relPos pos[100]; }; the array container 64 is not enough for my robot's situation,but it still have some curves how to mofity it ?