4343#include " ompl/util/Console.h"
4444
4545// The supported optimal planners, in alphabetical order
46+ #include < ompl/geometric/planners/lazyinformedtrees/BLITstar.h>
4647#include < ompl/geometric/planners/informedtrees/AITstar.h>
4748#include < ompl/geometric/planners/informedtrees/BITstar.h>
4849#include < ompl/geometric/planners/informedtrees/EITstar.h>
@@ -74,6 +75,7 @@ enum optimalPlanner
7475 PLANNER_AITSTAR,
7576 PLANNER_BFMTSTAR,
7677 PLANNER_BITSTAR,
78+ PLANNER_BLITSTAR,
7779 PLANNER_CFOREST,
7880 PLANNER_EITSTAR,
7981 PLANNER_EIRMSTAR,
@@ -129,6 +131,7 @@ class ValidityChecker : public ob::StateValidityChecker
129131
130132 // Distance formula between two points, offset by the circle's
131133 // radius
134+ return ((x >= 1.4 && x <= 1.5 && y >= 0.6 && y <=1.4 ) || ( y >= 1.3 && y <= 1.4 && x>= 0.6 && x<= 1.4 )) ? 0.0 : 0.1 ;
132135 return sqrt ((x - 0.5 ) * (x - 0.5 ) + (y - 0.5 ) * (y - 0.5 )) - 0.25 ;
133136 }
134137};
@@ -164,6 +167,11 @@ ob::PlannerPtr allocatePlanner(ob::SpaceInformationPtr si, optimalPlanner planne
164167 return std::make_shared<og::BITstar>(si);
165168 break ;
166169 }
170+ case PLANNER_BLITSTAR:
171+ {
172+ return std::make_shared<og::BLITstar>(si);
173+ break ;
174+ }
167175 case PLANNER_CFOREST:
168176 {
169177 return std::make_shared<og::CForest>(si);
@@ -243,11 +251,16 @@ void plan(double runTime, optimalPlanner plannerType, planningObjective objectiv
243251 auto space (std::make_shared<ob::RealVectorStateSpace>(2 ));
244252
245253 // Set the bounds of space to be in [0,1].
246- space->setBounds (0.0 , 1.0 );
254+ // space->setBounds(0.0, 1.0);
247255
256+ ob::RealVectorBounds bounds (2 );
257+ bounds.setLow (0 , 0 ); // Lower bound for x-dimension
258+ bounds.setHigh (0 , 2 ); // Upper bound for x-dimension
259+ bounds.setLow (1 , 0 ); // Lower bound for y-dimension
260+ bounds.setHigh (1 , 2 ); // Upper bound for y-dimension
248261 // Construct a space information instance for this state space
262+ space->setBounds (bounds);
249263 auto si (std::make_shared<ob::SpaceInformation>(space));
250-
251264 // Set the object used to check which states in the space are valid
252265 si->setStateValidityChecker (std::make_shared<ValidityChecker>(si));
253266
@@ -262,8 +275,8 @@ void plan(double runTime, optimalPlanner plannerType, planningObjective objectiv
262275 // Set our robot's goal state to be the top-right corner of the
263276 // environment, or (1,1).
264277 ob::ScopedState<> goal (space);
265- goal->as <ob::RealVectorStateSpace::StateType>()->values [0 ] = 1.0 ;
266- goal->as <ob::RealVectorStateSpace::StateType>()->values [1 ] = 1.0 ;
278+ goal->as <ob::RealVectorStateSpace::StateType>()->values [0 ] = 1.8 ;
279+ goal->as <ob::RealVectorStateSpace::StateType>()->values [1 ] = 1.8 ;
267280
268281 // Create a problem instance
269282 auto pdef (std::make_shared<ob::ProblemDefinition>(si));
@@ -438,10 +451,10 @@ bool argParse(int argc, char **argv, double *runTimePtr, optimalPlanner *planner
438451 desc.add_options ()(" help,h" , " produce help message" )(
439452 " runtime,t" , bpo::value<double >()->default_value (1.0 ),
440453 " (Optional) Specify the runtime in seconds. Defaults to 1 and "
441- " must be greater than 0." )(" planner,p" , bpo::value<std::string>()->default_value (" RRTstar " ),
454+ " must be greater than 0." )(" planner,p" , bpo::value<std::string>()->default_value (" BLITstar " ),
442455 " (Optional) Specify the optimal planner to use, defaults to RRTstar if not given. "
443456 " Valid options are AITstar, "
444- " BFMTstar, BITstar, CForest, EITstar, EIRMstar, FMTstar, InformedRRTstar, PRMstar, RRTstar, "
457+ " BFMTstar, BITstar, BLITstar, CForest, EITstar, EIRMstar, FMTstar, InformedRRTstar, PRMstar, RRTstar, "
445458 " and SORRTstar." ) // Alphabetical order
446459 (" objective,o" , bpo::value<std::string>()->default_value (" PathLength" ),
447460 " (Optional) Specify the optimization objective, defaults to PathLength if not given. Valid options are "
@@ -509,6 +522,10 @@ bool argParse(int argc, char **argv, double *runTimePtr, optimalPlanner *planner
509522 {
510523 *plannerPtr = PLANNER_BITSTAR;
511524 }
525+ else if (boost::iequals (" BLITstar" , plannerStr))
526+ {
527+ *plannerPtr = PLANNER_BLITSTAR;
528+ }
512529 else if (boost::iequals (" CForest" , plannerStr))
513530 {
514531 *plannerPtr = PLANNER_CFOREST;
0 commit comments