@@ -64,11 +64,22 @@ def handle_resolve_start(self, msg):
6464 # Translate triples to knowrob triples
6565 builder = TripleQueryBuilder ()
6666 for s , p , o in triples :
67+ # Remove leading < or trailing > if present
68+ s = s [1 :] if s .startswith ("<" ) else s
69+ s = s [:- 1 ] if s .endswith (">" ) else s
70+
71+ p = p [1 :] if p .startswith ("<" ) else p
72+ p = p [:- 1 ] if p .endswith (">" ) else p
73+
74+ o = o [1 :] if o .startswith ("<" ) else o
75+ o = o [:- 1 ] if o .endswith (">" ) else o
76+
77+ # Add the triple to the builder
6778 builder .add (s , p , o )
6879 # Set the modal frame
6980 modal_frame = get_default_modalframe ()
70- modal_frame .minPastTimestamp = msg .stamp .to_sec ()
71- modal_frame .confidence = 1.0
81+ # modal_frame.minPastTimestamp = msg.stamp.to_sec()
82+ # modal_frame.confidence = 1.0
7283 # Add the designator to knowrob
7384 self .knowrob .tell (builder .get_triples (), modal_frame )
7485 rospy .loginfo (f"Sent { len (triples )} unresolved Action designator triples for { designator_id } " )
@@ -102,9 +113,10 @@ def handle_resolve_finished(self, msg):
102113 builder .add (s , p , o )
103114 # Set the modal frame
104115 modal_frame = get_default_modalframe ()
105- modal_frame .minPastTimestamp = msg .stamp .to_sec ()
106- modal_frame .confidence = 1.0
116+ # modal_frame.minPastTimestamp = msg.stamp.to_sec()
117+ # modal_frame.confidence = 1.0
107118 # Add the designator to knowrob
119+ self .knowrob .tell (builder .get_triples (), modal_frame )
108120 rospy .loginfo (f"Sent { len (triples )} resolving triples for Action task { resolving_uri } " )
109121 if print_triples :
110122 to_print = ""
@@ -130,8 +142,8 @@ def handle_exec_start(self, msg):
130142 builder .add (s , p , o )
131143 # Set the modal frame
132144 modal_frame = get_default_modalframe ()
133- modal_frame .minPastTimestamp = msg .stamp .to_sec ()
134- modal_frame .confidence = 1.0
145+ # modal_frame.minPastTimestamp = msg.stamp.to_sec()
146+ # modal_frame.confidence = 1.0
135147 # Add the designator to knowrob
136148 self .knowrob .tell (builder .get_triples (), modal_frame )
137149 rospy .loginfo (f"Sent { len (triples )} execution start triples for { msg .designator_id } " )
0 commit comments