Update
This commit is contained in:
parent
5c2dd43b66
commit
d0d12a6ecc
5
main.py
5
main.py
@ -19,7 +19,7 @@ import baxter_interface
|
||||
from tf.transformations import quaternion_from_euler
|
||||
|
||||
import threading
|
||||
|
||||
import object_tf_service as ots
|
||||
import time
|
||||
|
||||
table = {
|
||||
@ -346,7 +346,6 @@ class PickAndPlace(object):
|
||||
|
||||
|
||||
def _tf_service_initializer():
|
||||
import object_tf_service as ots
|
||||
tf_service = ots.init()
|
||||
|
||||
|
||||
@ -359,7 +358,7 @@ def tf_service(init=True):
|
||||
tf_service_thread.start()
|
||||
else:
|
||||
print('Killing tf service thread')
|
||||
tf_service_thread.terminate()
|
||||
ots.SIGKILL = True
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3,6 +3,9 @@ import rospy
|
||||
import tf
|
||||
from gazebo_msgs.msg import LinkStates
|
||||
|
||||
global SIGKILL # Horrible hack
|
||||
SIGKILL = False
|
||||
|
||||
class tf_service():
|
||||
def __init__(self):
|
||||
self._nodes = ['baxter::base',
|
||||
@ -21,6 +24,7 @@ class tf_service():
|
||||
# Get index
|
||||
for object_name in self._nodes:
|
||||
'''HORRIBLE HACK BEGIN'''
|
||||
if SIGKILL: exit(0)
|
||||
if object_name == 'baxter::base':
|
||||
spawn_name = 'base'
|
||||
else:
|
||||
@ -46,4 +50,8 @@ class tf_service():
|
||||
|
||||
def init():
|
||||
x = tf_service()
|
||||
x.gazebo_link_subscriber()
|
||||
x.gazebo_link_subscriber()
|
||||
|
||||
def deinit():
|
||||
global SIGKILL
|
||||
SIGKILL = True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user