RoboJackets / rrt

C++ RRT (Rapidly-exploring Random Tree) Implementation
Other
253 stars 84 forks source link

RRT Optimization -- Straight Path Planning #66

Closed kevinatorchen closed 7 years ago

kevinatorchen commented 7 years ago

Because there tends to be very few obstacles during a match, we could benefit by implementing an algorithm that is not necessarily robust with dealing with obstacles but rather very efficient when it can find a solution. One of these algorithms is Straight Path Planning. It begins by drawing a straight line between the robot and the goal. While there are obstacles within that path, it will tweak the path a bit until it can avoid all obstacles. If Straight Path Planning is not able to find a solution, we will fall back to RRT.

jgkamat commented 7 years ago

I'm not sure if this is a good idea to include in the base RRT. I definetly can see this being a good idea overall (for soccer), but there might be rrt applications that would not want this behavior (perhaps they want a random-ish path every time?) At the very least I think there should be a way to turn this off if needed, if this is done in the RRT.

justbuchanan commented 7 years ago

Relevant paper:

Fast Path Planning Algorithm for the RoboCup Small Size League (2014)

kevinatorchen commented 7 years ago

We tried looking in EscapeObstaclesPathPlanner.cpp if the code for this algorithm already exists. However, the code in this class calls functions from RRT, which is not what this algorithm wants. (Recall, this algorithm only uses RRT as a backup if this entire process does not work.) Thus, I will be creating a new class called StraightLinePathPlanner.

kevinatorchen commented 7 years ago

All right, so I'm trying to first call RRTPlanner with a goal bias of 1, which will create a straight line to the goal. If this fails, then we default back to the RRT Path Planning.

This is how I'm trying to do it:

  1. The current runRRT method has been renamed to runRRTHelper. This helper takes in a boolean value to see if you are trying to do a straight line planning.
  2. A new runRRT method has been created. This calls the runRRT method twice: once with the extra boolean value set to true, once with the boolean set to false.

Please let me know if this idea is okay. If it is, please tell me how to check if the straight path planning was successful (pseudocode is in comments):

vector straight = runRRTHelper(start, goal, motionConstraints, obstacles, state, shellID, true); //If straight is a legit path { return straight } return runRRTHelper(start, goal, motionConstraints, obstacles, state, shellID, false);

Please let me know how to do the above pseudocode.

ashaw596 commented 7 years ago

It would be best to implement this in RRTPathPlanner class. It'll be something like. generateRRTPath with points(start, end). Check if it hits anything. If not, return path, else run the rest of the RRTPathPlanner.

On Sun, Feb 26, 2017 at 4:42 PM, Kevin Chen notifications@github.com wrote:

All right, so I'm trying to first call RRTPlanner with a goal bias of 1, which will create a straight line to the goal. If this fails, then we default back to the RRT Path Planning.

This is how I'm trying to do it:

  1. The current runRRT method has been renamed to runRRTHelper. This helper takes in a boolean value to see if you are trying to do a straight line planning.
  2. A new runRRT method has been created. This calls the runRRT method twice: once with the extra boolean value set to true, once with the boolean set to false.

Please let me know if this idea is okay. If it is, please tell me how to check if the straight path planning was successful (pseudocode is in comments):

vector straight = runRRTHelper(start, goal, motionConstraints, obstacles, state, shellID, true); //If straight is a legit path { return straight } return runRRTHelper(start, goal, motionConstraints, obstacles, state, shellID, false);

Please let me know how to do the above pseudocode.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RoboJackets/rrt/issues/66#issuecomment-282590123, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8XBonuVb6pwk0ItACnp-4ii0UHhT6Hks5rgfG0gaJpZM4L6QwF .

jgkamat commented 7 years ago

This issue is a little overloaded now, this is taking place in the rrt planner class in robocup-software.

You can check to see if the straight rrt path planner was successfull by using the success variable for example here. If the helper is unsuccessful, it returns an empty vector, so you can just check to see if the vector is empty before moving on.

The pseudocode looks good to me, and the method you have setup looks good too. If this didn't make enough sense let me know and I'll clarify anything for you.