Initial setup for user GUI ready
This commit is contained in:
parent
e11f18c279
commit
a49b3bac15
35
safety_user_plugin/launch/user_plugin.launch
Normal file
35
safety_user_plugin/launch/user_plugin.launch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<launch>
|
||||||
|
<arg name="port" />
|
||||||
|
<arg name="vis" default="true"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<group if="$(arg vis)">
|
||||||
|
<!--<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find tracz_ground_station)/urdf/tracz.xacro'" />-->
|
||||||
|
|
||||||
|
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
|
||||||
|
<param name="publish_frequency" type="double" value="50.0" />
|
||||||
|
</node>
|
||||||
|
|
||||||
|
|
||||||
|
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
|
||||||
|
<param name="use_gui" value="FALSE"/>
|
||||||
|
</node>
|
||||||
|
|
||||||
|
<node pkg="rqt_gui"
|
||||||
|
type="rqt_gui"
|
||||||
|
name="rqt_gui"
|
||||||
|
/>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<node pkg="tracz_ground_station"
|
||||||
|
type="tracz_core.py"
|
||||||
|
name="tracz_core"
|
||||||
|
output="screen"
|
||||||
|
required="true"
|
||||||
|
>
|
||||||
|
<param name="port" type="string" value="$(arg port)" />
|
||||||
|
</node>
|
||||||
|
|
||||||
|
|
||||||
|
</launch>
|
16
safety_user_plugin/scripts/qt_wrapper.py
Normal file
16
safety_user_plugin/scripts/qt_wrapper.py
Normal file
@ -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')
|
||||||
|
|
||||||
|
|
6
safety_user_plugin/scripts/ros_wrapper.py
Normal file
6
safety_user_plugin/scripts/ros_wrapper.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
class ROSWrapper:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
@ -1,4 +1,21 @@
|
|||||||
class UserPlugin:
|
#!/usr/bin/env python
|
||||||
|
|
||||||
def __init__(self):
|
import os
|
||||||
pass
|
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()
|
18
safety_user_plugin/scripts/user_widget.py
Normal file
18
safety_user_plugin/scripts/user_widget.py
Normal file
@ -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)
|
39
safety_user_plugin/ui/user_view.ui
Normal file
39
safety_user_plugin/ui/user_view.ui
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Form</class>
|
||||||
|
<widget class="QWidget" name="Form">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>950</width>
|
||||||
|
<height>798</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QComboBox" name="comboBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>90</x>
|
||||||
|
<y>50</y>
|
||||||
|
<width>161</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTextBrowser" name="textBrowser">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>150</y>
|
||||||
|
<width>256</width>
|
||||||
|
<height>192</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue
Block a user