ompl / ompl

The Open Motion Planning Library (OMPL)
https://ompl.kavrakilab.org
Other
1.41k stars 582 forks source link

Dubins Path #240

Closed mamoll closed 9 years ago

mamoll commented 9 years ago

Original report by dhiraj gandhi (Bitbucket: g.prakashchand@gmail.com, ).


Hello all,

I tried to use the function dubins() , defined in DubinsStateSpace() in class in python.

But it is giving error that the 'DubinsStateSpace' object has no attribute 'dubins'.

So is this function only available in C++ or I'm doing some mistake in implementation please let me know.

following is the code

space = ob.DubinsStateSpace(0.2)
bounds = ob.RealVectorBounds(2)
bounds.setLow(-2)
bounds.setHigh(2)

space.setBounds(bounds)

start = ob.State(space)
start().setX(-0.5)
start().setY(-0.5)
start().setYaw(0)

goal = ob.State(space)
goal().setX(0.5)
goal().setY(0.5)
goal().setYaw(0)

path = space.dubins(start(),goal())
mamoll commented 9 years ago

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


The dubbing function is not exposed in python. You can do the following to get states along a Dubins curve connecting two states:

s = ob.State(space)
for i in range(10):
    space.interpolate(start(), goal(), i/10., s())
    print(s)
mamoll commented 9 years ago

Original comment by dhiraj gandhi (Bitbucket: g.prakashchand@gmail.com, ).


Thank you very much for your reply.

Exactly the same point came to my mind, I tried it, it worked.

Thanks a lot for suggestion.