Skip to content
Snippets Groups Projects
Commit 3ce6b0dd authored by Tommy Persson's avatar Tommy Persson
Browse files

Adding kdbserver

parent 36e7065c
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import rospy
from util.kdbutil import *
def victim_callback(event):
print "VICTIM_CALLBACK"
bindings = {"%object_klass": "victim"}
ns = rospy.get_namespace ().rstrip("/")
resp = query_database(ns, json.dumps(bindings), query_get_salient_objects())
if resp.success:
ids, gps = get_gps_from_query_result (resp.result)
for i in range(len(ids)):
id = ids[i]
prefix = "http://www.ida.liu.se/divisions/aiics/"
if id.startswith(prefix):
id = id[len(prefix):]
id_gp = IdGeoPoint(id, gps[i])
id_geopoint_pub.publish(id_gp)
else:
print "FAILURE", resp
if __name__ == "__main__":
rospy.init_node ("kdbserverpy")
id_geopoint_pub = rospy.Publisher("/id_geopoint", IdGeoPoint, queue_size=10)
rospy.Timer(rospy.Duration(5), victim_callback)
print "Spinning kdbserverpy"
rospy.spin()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment