From: Mark M. <mm...@ri...> - 2011-08-06 20:04:25
|
ScopedState objects can be created like so: space = ob.RealVectorStateSpace(3) ... ss = simpleSetup(space) ... if ss.solve(10): # PathGeometric object path = ss.getSolutionPath() # python list of lists of doubles n = len(path.states) path = [[ob.State(space, path.states[i])[j] for j in range(3)] for i in range(n)] print path The "ob.State(space, path.states[i])” part creates the ScopedState object. You can look at the ompl_app.py code to see how you’d convert SE(2) and SE(3) states to transformation matrices. On Aug 6, 2011, at 4:35 AM, Gustavo Goretkin wrote: > I'd like to access a PathGeometric object as a Numpy array. I can loop through PathGeometric.states, which is a collection of RealVectorStateInternal (or the appropriate state depending on the manifold) but as [1] suggests, this is not the best way. How can I get the ScopedState objects? > > Thanks, > Gustavo > > [1] http://ompl-beta.kavrakilab.org/core/python.html#cpp_py_diffs -- Mark Moll |