This commit is contained in:
Max Hunt 2020-02-10 17:52:32 +00:00
parent 5c2dd43b66
commit d0d12a6ecc
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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