From a6ac4c8dfd25464e7d373b03dbbc871a37c7b86b Mon Sep 17 00:00:00 2001 From: Olek Bojda Date: Mon, 1 Oct 2018 14:04:38 +0200 Subject: [PATCH] Absolute image paths changed to relative --- safety_master_plugin/scripts/qt_master_wrapper.py | 8 +++++--- safety_user_plugin/scripts/qt_wrapper.py | 13 ++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/safety_master_plugin/scripts/qt_master_wrapper.py b/safety_master_plugin/scripts/qt_master_wrapper.py index c029d43..c69bf07 100644 --- a/safety_master_plugin/scripts/qt_master_wrapper.py +++ b/safety_master_plugin/scripts/qt_master_wrapper.py @@ -33,9 +33,11 @@ class QtWrapper: # self.disable_sliders_tracking() - self.distance_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Distance.png') - self.angular_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Angular.png') - self.linear_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Linear.png') + ui_directory_path = '{0}/ui'.format(rospkg.RosPack().get_path('safety_master_plugin')) + + self.distance_pixmap = QPixmap('{0}/Distance.png'.format(ui_directory_path)) + self.angular_pixmap = QPixmap('{0}/Angular.png'.format(ui_directory_path)) + self.linear_pixmap = QPixmap('{0}/Linear.png'.format(ui_directory_path)) self.widget.distanceImage.setPixmap(self.distance_pixmap) self.widget.angularImage.setPixmap(self.angular_pixmap) self.widget.linearImage.setPixmap(self.linear_pixmap) diff --git a/safety_user_plugin/scripts/qt_wrapper.py b/safety_user_plugin/scripts/qt_wrapper.py index a83cee2..d69ddf6 100644 --- a/safety_user_plugin/scripts/qt_wrapper.py +++ b/safety_user_plugin/scripts/qt_wrapper.py @@ -22,15 +22,18 @@ class QtWrapper: self.clear_robot_info() - self.distance_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Distance.png') - self.angular_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Angular.png') - self.linear_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Linear.png') + ui_directory_path = '{0}/ui'.format(rospkg.RosPack().get_path('safety_user_plugin')) + + self.distance_pixmap = QPixmap('{0}/Distance.png'.format(ui_directory_path)) + self.angular_pixmap = QPixmap('{0}/Angular.png'.format(ui_directory_path)) + self.linear_pixmap = QPixmap('{0}/Linear.png'.format(ui_directory_path)) + self.widget.distanceImage.setPixmap(self.distance_pixmap.scaled(66,46)) self.widget.angularImage.setPixmap(self.angular_pixmap) self.widget.linearImage.setPixmap(self.linear_pixmap.scaled(20,48)) - self.ok_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Ok.jpg') - self.cancel_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Cancel.jpg') + self.ok_pixmap = QPixmap('{0}/Ok.jpg'.format(ui_directory_path)) + self.cancel_pixmap = QPixmap('{0}/Cancel.jpg'.format(ui_directory_path)) def disconnect_signals(self): self.widget.clutchButton.clicked.disconnect()