16 from os.path
import abspath, dirname, join
18 ompl_app_root = dirname(dirname(dirname(abspath(__file__))))
21 from ompl
import base
as ob
22 from ompl
import control
as oc
23 from ompl
import app
as oa
25 sys.path.insert(0, join(ompl_app_root,
"ompl/py-bindings"))
26 from ompl
import base
as ob
27 from ompl
import control
as oc
28 from ompl
import app
as oa
31 def kinematicCarDemo():
32 setup = oa.KinematicCarPlanning()
34 setup.setRobotMesh(
"2D/car2_planar_robot.dae")
35 setup.setEnvironmentMesh(
"2D/Maze_planar_env.dae")
36 SE2 = setup.getStateSpace()
56 setup.setStartAndGoalStates(start, goal, 1.0)
59 planner =
oc.RRT(setup.getSpaceInformation())
60 setup.setPlanner(planner)
63 print(
"\n\n***** Planning for a %s *****\n" % setup.getName())
68 path = setup.getSolutionPath()
71 print(path.printAsMatrix())
72 if not setup.haveExactSolutionPath():
74 "Solution is approximate. Distance to actual goal is %g"
75 % setup.getProblemDefinition().getSolutionDifference()
79 if __name__ ==
"__main__":