39from ompl
import base
as ob
40from ompl
import geometric
as og
43def isStateValid(state):
47 return state.getX() < 0.6
50def planWithSimpleSetup():
58 space.setBounds(bounds)
62 ss.setStateValidityChecker(isStateValid)
64 sampler = ss.getStateSpace().allocDefaultStateSampler()
65 start = ss.getStateSpace().allocState()
67 sampler.sampleUniform(start)
71 goal = ss.getStateSpace().allocState()
73 sampler.sampleUniform(goal)
77 ss.setStartAndGoalStates(start, goal)
81 solved = ss.solve(1.0)
87 print(ss.getSolutionPath())
97 space.setBounds(bounds)
101 si.setStateValidityChecker(isStateValid)
103 sampler = si.getStateSpace().allocDefaultStateSampler()
105 start = si.getStateSpace().allocState()
106 sampler.sampleUniform(start)
108 goal = si.getStateSpace().allocState()
109 sampler.sampleUniform(goal)
113 pdef.setStartAndGoalStates(start, goal)
117 planner.setProblemDefinition(pdef)
125 solved = planner.solve(1.0)
130 path = pdef.getSolutionPath()
131 print(
"Found solution:\n%s" % path)
133 print(
"No solution found")
136if __name__ ==
"__main__":
137 planWithSimpleSetup()
Definition of a problem to be solved. This includes the start state(s) for the system and a goal spec...
The lower and upper bounds for an Rn space.
A state space representing SE(2).
RRT-Connect (RRTConnect).
Create the set of classes typically needed to solve a geometric problem.