[WORK AROUND]Pandai avoidance assertion error !is_empty()

Hi, I am trying to make an agent avoid obstacles in a small world.
I added the collision nodepaths to the AiWorld object with the addObstacle method.
When I try running the script, I get the following error message:

Assertion failed: !is_empty() at line 1253 of panda/src/pgraph/nodePath.cxx

Traceback (most recent call last):
  File "test.py", line 189, in AIUpdate
    self.AIworld.update()
AssertionError: !is_empty() at line 1253 of panda/src/pgraph/nodePath.cxx
:task(error): Exception occurred in PythonTask AIUpdate
Traceback (most recent call last):
  File "test.py", line 876, in <module>
    run()
  File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
    self.step()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
    self.mgr.poll()
  File "test.py", line 189, in AIUpdate
    self.AIworld.update()
AssertionError: !is_empty() at line 1253 of panda/src/pgraph/nodePath.cxx

I saw in the manual examples that the NodePaths added to the AIWorld were the ones returned by loadModel method.
Do collision nodes work as well?

Perhaps one of the NodePaths you passed was an empty NodePath, such as when a model failed to load?

Nope.
I called the isEmpty method in the loop that add the
colliders, here is what I got:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Here is the code I am using, all the collision node paths I want the panda to avoid I added in a list, when I add a AIWorldObject, it will add every collider to this object as an obstacle.

	def addAiWorldObject(self, aiWorldObj):
		self.aiWorldObjetcsList.append(aiWorldObj)
		for collider in self.colliderList:
			print collider.isEmpty()
			aiWorldObj.addObstacle(collider)

I found a work around.
I have absolutely no Ideas why this works, all i did was to put the update method of the aiWorld object inside a try-except block (exption being “pass”).
It simply enter the exception block the first time then start working normally.

Again, I have absolutely no ideas why this worked.

I get a similar assertion problem if I try to enable obs_avoidance. I get the problem if i add obstacles to AIworld or not. I checked and the obstacles I added are not empty as well. Strangely, the example script works fine. Only difference I can tell is that the example does everything parented to render and I’m down the tree a little ways.

AssertionError: !is_empty() at line 59 of built/include/boundingSphere.I

I’m having the same problem as supus71. The main problem is that i haven’t knowledge about obstacles avoidance, so altough i manage to determine that the assertion that fails is
asking for the precondition of get_radious, that means nothing to me :confused: .
After making some blind research i could observe that the assertion doesn’t fail when i add few obstacles (like 2 or 3) to the aiWorld object, but as i increment the amount of
obstacles added, the assertion fails again. The initial distance between the objects doesn’t count.

PandaAI seems like it’s hard to use…