Skip to content

Commit

Permalink
Missing parameters from super
Browse files Browse the repository at this point in the history
  • Loading branch information
rlee3359 committed Apr 19, 2021
1 parent 76673e2 commit ecb19fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion grammar/lexicon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ $Revision: 1.6 $, $Date: 2010/09/13 04:45:19 $
<member stem="along" />
</family>

<family name="Prepositions" pos="Prep" indexRel="preposition">
<family name="Prepositions" pos="Prep" indexRel="preposition" closed="true">
<entry name="s\np/np">
<complexcat>
<atomcat type="np">
Expand Down
4 changes: 2 additions & 2 deletions lingua/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ def learn(leaf):

learnt=Method(
name=method.get_name(),
preconditions=root.get_preconditions(),
postconditions=root.get_postconditions(),
preconditions=[],
postconditions=[],
root=root.to_json(self.parent.arguments)
)

Expand Down
4 changes: 2 additions & 2 deletions lingua/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def to_btree(self):

def to_query(self):
if self.is_grounded():
return super().to_query()
return super(Object, self).to_query()

atoms = ['(class_label {} ?)'.format(self.name)]

Expand Down Expand Up @@ -750,7 +750,7 @@ def __init__(self, type_name='', name='', attributes=None, relation=None, limit=

def to_query(self):
if self.is_grounded():
return super().to_query()
return super(DummyObject, self).to_query()

atoms = []

Expand Down
13 changes: 9 additions & 4 deletions scripts/lingua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import rospy
import time
import os

from lingua.method import Method
from lingua.trees import Lingua, OneShotSelector
Expand Down Expand Up @@ -28,10 +29,14 @@ if __name__ == '__main__':
rospy.ServiceProxy('/kb/clear', Clear)('types')
rospy.ServiceProxy('/kb/load', Load)('types', rospy.get_param('~types_file'))

if rospy.has_param('~method_path'):
Method.set_path(rospy.get_param('~method_path'))
path = rospy.get_param('~method_path')

Method.set_path(os.path.join(path, 'primitives'))
Method.load()

Method.set_path(os.path.join(path, 'methods'))
Method.load()

#Watchdog(),
bt = BehaviourTree('Lingua', Selector(children=[Lingua()]))
bt.run(push_to_start=False, hz=1, setup_timeout=2)
bt = BehaviourTree('Lingua', Selector(children=[Watchdog(), Lingua()]))
bt.run(push_to_start=False, hz=1, setup_timeout=2)

0 comments on commit ecb19fe

Please sign in to comment.