KavrakiLab / vamp

SIMD-Accelerated Sampling-based Motion Planning
Other
108 stars 10 forks source link

Segfault in result.path #9

Closed a-nooj closed 2 weeks ago

a-nooj commented 1 month ago

Calling the numpy method for result.path gives a segfault.

(Pdb) result
<vamp._core._core_ext.panda.PlanningResult object at 0x7f34f4683450>
(Pdb) result.path
<vamp._core._core_ext.panda.Path object at 0x7f34f47405b0>
(Pdb) len(result.path)
9
(Pdb) dir(result.path)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'cost', 'insert', 'interpolate', 'numpy', 'subdivide']
(Pdb) result.path.numpy()
Segmentation fault (core dumped)
wbthomason commented 1 month ago

Thanks for reporting the issue! Could you please provide a minimal reproducing example? A simple test (calling numpy() on each result path produced in scripts/evaluate_mbm.py and printing the resulting array) on my machine is unable to recreate the segfault.

mohitydv09 commented 3 weeks ago

I also faced this, minimal code to reproduce is:

import vamp

robot_urdf_path = 'resources/ur5/ur5.urdf'
robot_module, planner_module, plan_settings, simp_settings = vamp.configure_robot_and_planner_with_kwargs('ur5', 'rrtc')

start = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
goal = [0.0, 0.5, 1.0, 0.0, 1.0, 0.0]
env = vamp.Environment()
planner = planner_module(start, goal, env, plan_settings)
simplyfy = robot_module.simplify(planner.path, env, simp_settings)

path = simplyfy.path
path.interpolate(robot_module.resolution())

print("Type of Path : ", type(path))
numpy_path = path.numpy()
print("Path as NP array  : ", numpy_path)

The Output from this is :

Type of Path :  <class 'vamp._core._core_ext.ur5.Path'>
Segmentation fault (core dumped)
wbthomason commented 3 weeks ago

Thanks, I appreciate the example! Could you please share information about the environment in which you're running this (Python version, OS, etc.)? Copy-pasting your script into a virtualenv on my machine, I'm still unable to reproduce the segfault.

wbthomason commented 3 weeks ago

Small update: I have now been able to reproduce the segfault; investigating.

wbthomason commented 3 weeks ago

@a-nooj, @mohitydv09, thanks for your help finding and reproducing this bug. Could you please confirm that #14 fixes this issue for you?