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
|
from tf.transformations import quaternion_from_euler
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
|
import object_tf_service as ots
|
||||||
import time
|
import time
|
||||||
|
|
||||||
table = {
|
table = {
|
||||||
@ -346,7 +346,6 @@ class PickAndPlace(object):
|
|||||||
|
|
||||||
|
|
||||||
def _tf_service_initializer():
|
def _tf_service_initializer():
|
||||||
import object_tf_service as ots
|
|
||||||
tf_service = ots.init()
|
tf_service = ots.init()
|
||||||
|
|
||||||
|
|
||||||
@ -359,7 +358,7 @@ def tf_service(init=True):
|
|||||||
tf_service_thread.start()
|
tf_service_thread.start()
|
||||||
else:
|
else:
|
||||||
print('Killing tf service thread')
|
print('Killing tf service thread')
|
||||||
tf_service_thread.terminate()
|
ots.SIGKILL = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,9 @@ import rospy
|
|||||||
import tf
|
import tf
|
||||||
from gazebo_msgs.msg import LinkStates
|
from gazebo_msgs.msg import LinkStates
|
||||||
|
|
||||||
|
global SIGKILL # Horrible hack
|
||||||
|
SIGKILL = False
|
||||||
|
|
||||||
class tf_service():
|
class tf_service():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._nodes = ['baxter::base',
|
self._nodes = ['baxter::base',
|
||||||
@ -21,6 +24,7 @@ class tf_service():
|
|||||||
# Get index
|
# Get index
|
||||||
for object_name in self._nodes:
|
for object_name in self._nodes:
|
||||||
'''HORRIBLE HACK BEGIN'''
|
'''HORRIBLE HACK BEGIN'''
|
||||||
|
if SIGKILL: exit(0)
|
||||||
if object_name == 'baxter::base':
|
if object_name == 'baxter::base':
|
||||||
spawn_name = 'base'
|
spawn_name = 'base'
|
||||||
else:
|
else:
|
||||||
@ -46,4 +50,8 @@ class tf_service():
|
|||||||
|
|
||||||
def init():
|
def init():
|
||||||
x = tf_service()
|
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