opencog / unity3d-opencog-game

A Unity3D game world for OpenCog-controlled agents
http://wiki.opencog.org/w/Setting_up_the_Unity3D_world
GNU Affero General Public License v3.0
55 stars 40 forks source link

[Bug ] Hangs at 'Roll back' #68

Open Spydrouge opened 9 years ago

Spydrouge commented 9 years ago

I have seen this hang occur in two cases:

If the robot runs out of batteries, I have been able to get him to resume eating batteries again in the future. However, this is only some of the time. In other instances, embodiment seems to hang, and although the Unity game world keeps sending out messages, embodiment/opencog side nothing responds.

The last messages the opencog side printed out for one of these hangs (specifically one caused by the setup in #67 ) are...

Debug planning step 21: Selected rule :waldToPositionToGetClosedToItButNotStandOnIt
Debug: find ungrounded variable : $float_var0
Debug: find ungrounded variable : (999999,999999,999999)
Debug: find ungrounded variable : (999999,999999,999999)
Debug: find ungrounded variable : (999999,999999,999999)
Debug: groundARuleNodeBySelectingNonNumericValues() is finding candidate groups...
Debug: groundARuleNodeBySelectingNonNumericValues(): There is no non numeric variable in this rule. Doesn't need to be grounded!
Debug planning step 21: All Variable bindings for rule :waldToPositionToGetClosedToItButNotStandOnIt
($entity_var1,undefined)= (id_OAC_AGI_Robot,pet)
(999997,999999,999999)= (-128,-15,142)
(999999,999999,999999)= (-129,-15,143)
Debug planning step 21: All effects for rule :waldToPositionToGetClosedToItButNotStandOnIt
Effect  1: State: Distance ( (id_OAC_AGI_Robot,pet), (-128,-15,142) )
           [value changed]:  = 2.23607 -> < 1.5
Effect  2: State: AtLocation ( (id_OAC_AGI_Robot,pet) )
           [value changed]:  = (-130,-15,143) -> = (-129,-15,143)
Debug planning step 21: All preconditions for rule :waldToPositionToGetClosedToItButNotStandOnIt
Precondition  1: depth: 0210010200000102001020 State: existPath ( (id_OAC_AGI_Robot,pet), (-129,-15,143) ) = true is satisfied :)
Precondition  2: depth: 0210010200000102001021 State: is_adjacent ( (-128,-15,142), (-129,-15,143) ) = true is satisfied :)

Debug planning step 22: Selected subgoal :State: is_standable ( (-128,-15,143) ) = true

Debug planning step 22 : current subgoal has not any candidate rules left to try. Roll back! 

Debug planning step 22 : its forward RuleNode: adjacentPositionsExistingPath has tried all the candidate bindings. Roll back again! 

And then it hangs.

Nemquae commented 9 years ago

@Spydrouge @shujingke's planner will roll back to a previous planning step as it is evaluating rules when it has exhausted all options (my understanding is that it's at what is effectively a leaf node of a tree of rule evaluation), so this isn't altogether surprising by itself. It may be possible, though, that deleting the battery mid-plan causes issue with the rule evaluation/traversal, since she probably assumes that the world is static during initial planning (not necessarily execution). In this case, maybe it can evaluate the "walkToPositionToGetCloseToButNotStandingOnIt" rule (best guess) but not the "grab" or "eat" rules because the battery is deleted just before those rules are evaluated.

Spydrouge commented 9 years ago

@Nemquae This wasn't the specific case where I deleted the battery mid execution; though it is the specific case where the robot grabs the block and moves it. So perhaps the 'grab and move block,' being elderly and somewhat deprecated, is causing a discrepancy of sorts where the battery block and the battery object are... say... no longer in the same position? And therefore make the eat/grab impossible. And therefore result in an identical hang to if I delete the block midmotion.