forked from KRSSG/robocup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbs.py
More file actions
27 lines (23 loc) · 608 Bytes
/
bs.py
File metadata and controls
27 lines (23 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import rospy
from krssg_ssl_msgs.msg import BeliefState
import memcache
from utils.config import BS_ADDRESS
from krssg_ssl_msgs.srv import *
#shared = memcache.Client(BS_ADDRESS,debug=False)
State = None
def BS_callback(state):
global State
State = state
print state
def bs(req):
global State
print State
req.stateA = State
return bsServerResponse(req.stateA)
def bsserver():
rospy.init_node('BSnode',anonymous=False)
rospy.Subscriber('/belief_state', BeliefState, BS_callback, queue_size=1000)
s = rospy.Service('bsServer',bsServer,bs)
rospy.spin()
if __name__ == "__main__":
bsserver()