GT RoboCup SSL
Soccer software, robot firmware
Planning::RRTPlanner Class Reference

Given a start point and an end point and some conditions, plans a path for a robot to get there. More...

Public Member Functions

 RRTPlanner (int minIterations, int maxIterations)
 Constructor taking in the max iterations the RRT planner should run.
 
int maxIterations () const
 gets the maximum number of iterations for the RRT algorithm
 
void maxIterations (int value)
 sets the maximum number of iterations for th RRT algorithm
 
int minIterations () const
 
void minIterations (int value)
 
MotionCommand::CommandType commandType () const override
 The MotionCommand type that this planner handles.
 
virtual std::unique_ptr< Pathrun (PlanRequest &planRequest) override
 Returns an obstacle-free Path subject to the specified MotionContraints.
 
- Public Member Functions inherited from Planning::SingleRobotPathPlanner
virtual bool canHandleDynamic ()
 

Static Public Member Functions

static std::unique_ptr< Planning::InterpolatedPathgeneratePath (const std::vector< Geometry2d::Point > &points, const Geometry2d::ShapeSet &obstacles, const MotionConstraints &motionConstraints, Geometry2d::Point vi, Geometry2d::Point vf)
 Takes in a waypoints and returns a full InterpolatedPath with a generated Velocity Profile.
 
static void createConfiguration (Configuration *cfg)
 
static RJ::Seconds getPartialReplanLeadTime ()
 
- Static Public Member Functions inherited from Planning::SingleRobotPathPlanner
static double goalPosChangeThreshold ()
 
static double goalVelChangeThreshold ()
 
static double replanTimeout ()
 
static void createConfiguration (Configuration *cfg)
 
static void allDynamicToStatic (Geometry2d::ShapeSet &obstacles, const std::vector< DynamicObstacle > &dynamicObstacles)
 
static void splitDynamic (Geometry2d::ShapeSet &obstacles, std::vector< DynamicObstacle > &dynamicOut, const std::vector< DynamicObstacle > &dynamicObstacles)
 
static bool shouldReplan (const PlanRequest &planRequest)
 Checks if the previous path is no longer valid and needs to be re-planned. More...
 

Protected Member Functions

bool shouldReplan (const PlanRequest &planRequest, const std::vector< DynamicObstacle > dynamicObs, std::string *debugOut=nullptr) const
 Check to see if the previous path (if any) should be discarded and replaced with a newly-planned one.
 
std::vector< Geometry2d::PointrunRRT (MotionInstant start, MotionInstant goal, const MotionConstraints &motionConstraints, const Geometry2d::ShapeSet &obstacles, Context *context, unsigned shellID, const std::optional< std::vector< Geometry2d::Point >> &biasWaypoints=std::nullopt)
 Runs a bi-directional RRT to attempt to join the start and end states.
 
std::unique_ptr< InterpolatedPathgenerateRRTPath (const MotionInstant &start, const MotionInstant &goal, const MotionConstraints &motionConstraints, Geometry2d::ShapeSet &origional, const std::vector< DynamicObstacle > dyObs, Context *context, unsigned shellID, const std::optional< std::vector< Geometry2d::Point >> &biasWayPoints=std::nullopt)
 
std::vector< Geometry2d::PointrunRRTHelper (MotionInstant start, MotionInstant goal, const MotionConstraints &motionConstraints, const Geometry2d::ShapeSet &obstacles, Context *context, unsigned shellID, const std::optional< std::vector< Geometry2d::Point >> &biasWaypoints, bool straightLine)
 Helper method for runRRT(), which creates a vector of points representing the RRT path.
 
- Protected Member Functions inherited from Planning::SingleRobotPathPlanner
 SingleRobotPathPlanner (bool handlesDynamic)
 

Static Protected Member Functions

static std::unique_ptr< Planning::InterpolatedPathgenerateCubicBezier (const std::vector< Geometry2d::Point > &points, const Geometry2d::ShapeSet &obstacles, const MotionConstraints &motionConstraints, Geometry2d::Point vi, Geometry2d::Point vf)
 Takes in waypoints and returns a InterpolatedPath with a generated Velocity Profile. More...
 
static void optimize (std::vector< Geometry2d::Point > &path, const Geometry2d::ShapeSet &obstacles, Geometry2d::Point vi, Geometry2d::Point vf)
 Removes unnecesary waypoints in the path.
 
static std::vector< CubicBezierControlPointsgenerateCubicBezierPath (const std::vector< Geometry2d::Point > &points, const MotionConstraints &motionConstraints, Geometry2d::Point vi, Geometry2d::Point vf, const std::optional< std::vector< double >> &times=std::nullopt)
 Generates a Cubic Bezier Path based on Albert's Bezier Velocity Path Algorithm using waypoints. More...
 
static std::vector< InterpolatedPath::EntrygenerateVelocityPath (const std::vector< CubicBezierControlPoints > &controlPoints, const MotionConstraints &motionConstraints, Geometry2d::Point vi, Geometry2d::Point vf, int interpolations=40)
 Generates a velocity profile from a Cubic Bezier Path under the given motion constratins. More...
 
static std::vector< CubicBezierControlPointsgenerateNormalCubicBezierPath (const std::vector< Geometry2d::Point > &points, const MotionConstraints &motionConstraints, Geometry2d::Point vi, Geometry2d::Point vf)
 Generates a Cubic Bezier Path based on some attempted heuristical Control Point Placement.
 
static Eigen::VectorXd cubicBezierCalc (double vi, double vf, std::vector< double > &points, std::vector< double > &ks, std::vector< double > &ks2)
 Helper function for cubicBezier() which uses Eigen matrices to solve for the cubic bezier equations.
 

Protected Attributes

int _minIterations
 minimum and maximum number of rrt iterations to run this does not include connect attempts
 
int _maxIterations
 

Static Protected Attributes

static ConfigDouble_partialReplanLeadTime
 

Detailed Description

Given a start point and an end point and some conditions, plans a path for a robot to get there.

There are many ways to plan paths. This planner uses bidirectional RRTs. You can check out our interactive RRT applet on GitHub here: https://github.com/RoboJackets/rrt.

+ Inheritance diagram for Planning::RRTPlanner:
+ Collaboration diagram for Planning::RRTPlanner:

Member Function Documentation

◆ generateCubicBezier()

std::unique_ptr< Planning::InterpolatedPath > Planning::RRTPlanner::generateCubicBezier ( const std::vector< Geometry2d::Point > &  points,
const Geometry2d::ShapeSet obstacles,
const MotionConstraints motionConstraints,
Geometry2d::Point  vi,
Geometry2d::Point  vf 
)
staticprotected

Takes in waypoints and returns a InterpolatedPath with a generated Velocity Profile.

  1. It generates a bezier path from the waypoints given
  2. It generates a velocity profile to fit the constraints given
  3. It returns a interpolated path combining the bezier path and the velocity profile

◆ generateCubicBezierPath()

vector< CubicBezierControlPoints > Planning::RRTPlanner::generateCubicBezierPath ( const std::vector< Geometry2d::Point > &  points,
const MotionConstraints motionConstraints,
Geometry2d::Point  vi,
Geometry2d::Point  vf,
const std::optional< std::vector< double >> &  times = std::nullopt 
)
staticprotected

Generates a Cubic Bezier Path based on Albert's Bezier Velocity Path Algorithm using waypoints.

It creates a path with continuous velocity and acceleration that estimates speed using the trapezoidal motion heuristic

◆ generateVelocityPath()

std::vector< InterpolatedPath::Entry > Planning::RRTPlanner::generateVelocityPath ( const std::vector< CubicBezierControlPoints > &  controlPoints,
const MotionConstraints motionConstraints,
Geometry2d::Point  vi,
Geometry2d::Point  vf,
int  interpolations = 40 
)
staticprotected

Generates a velocity profile from a Cubic Bezier Path under the given motion constratins.

Generates a Cubic Bezier Path based on Albert's random Bezier Velocity Path Algorithm.


The documentation for this class was generated from the following files: