diff --git a/safety_user_plugin/launch/user_plugin.launch b/safety_user_plugin/launch/user_plugin.launch new file mode 100644 index 0000000..1f4e185 --- /dev/null +++ b/safety_user_plugin/launch/user_plugin.launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/safety_user_plugin/scripts/qt_wrapper.py b/safety_user_plugin/scripts/qt_wrapper.py new file mode 100644 index 0000000..d7e27d6 --- /dev/null +++ b/safety_user_plugin/scripts/qt_wrapper.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +import os +import rospy +import rospkg + +# from python_qt_binding.QtWidgets import QWidget, QDialog + +class QtWrapper: + + def __init__(self,widget): + + self.widget = widget + + self.widget.textBrowser.setText('Sukces') + + diff --git a/safety_user_plugin/scripts/ros_wrapper.py b/safety_user_plugin/scripts/ros_wrapper.py new file mode 100644 index 0000000..8d98723 --- /dev/null +++ b/safety_user_plugin/scripts/ros_wrapper.py @@ -0,0 +1,6 @@ + + +class ROSWrapper: + + def __init__(self): + pass \ No newline at end of file diff --git a/safety_user_plugin/scripts/user_plugin.py b/safety_user_plugin/scripts/user_plugin.py index bcac32e..62aa6f6 100755 --- a/safety_user_plugin/scripts/user_plugin.py +++ b/safety_user_plugin/scripts/user_plugin.py @@ -1,4 +1,21 @@ -class UserPlugin: +#!/usr/bin/env python - def __init__(self): - pass \ No newline at end of file +import os +import rospy +import rospkg + +from qt_gui.plugin import Plugin + +from qt_wrapper import QtWrapper +from ros_wrapper import ROSWrapper +from user_widget import UserWidget + +class UserPlugin(Plugin): + + def __init__(self,context): + super(UserPlugin, self).__init__(context) + self.setObjectName('User Plugin - L1.5 safety system') + + self.widget = UserWidget(context) + self.qt_wrapper = QtWrapper(self.widget) + self.ros_wrapper = ROSWrapper() \ No newline at end of file diff --git a/safety_user_plugin/scripts/user_widget.py b/safety_user_plugin/scripts/user_widget.py new file mode 100644 index 0000000..915a2eb --- /dev/null +++ b/safety_user_plugin/scripts/user_widget.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +import os +import rospkg + +from python_qt_binding.QtWidgets import QWidget +from python_qt_binding import loadUi + +class UserWidget(QWidget): + + def __init__(self,context): + super(UserWidget, self).__init__() + ui_file = os.path.join(rospkg.RosPack().get_path('safety_user_plugin'), 'ui', 'user_view.ui') + loadUi(ui_file, self) + self.setObjectName('User Plugin - L1.5 safety system') + + if context.serial_number() > 1: + self.setWindowTitle(self.windowTitle() + (' (%d)' % context.serial_number())) + context.add_widget(self) \ No newline at end of file diff --git a/safety_user_plugin/ui/user_view.ui b/safety_user_plugin/ui/user_view.ui new file mode 100644 index 0000000..2fc1dd8 --- /dev/null +++ b/safety_user_plugin/ui/user_view.ui @@ -0,0 +1,39 @@ + + + Form + + + + 0 + 0 + 950 + 798 + + + + Form + + + + + 90 + 50 + 161 + 31 + + + + + + + 50 + 150 + 256 + 192 + + + + + + +