优化界面

pull/30/head
大耳刮子 3 years ago
parent 45153ce6a6
commit 062a36cccb

@ -87,7 +87,7 @@ void QNode::AutoMove(float speed_linear, float speed_turn,
//How fast will we update the robot's movement? //How fast will we update the robot's movement?
double rate = 50; double rate = 1;
//Set the equivalent ROS rate variable //Set the equivalent ROS rate variable
ros::Rate loopRate(rate); ros::Rate loopRate(rate);
@ -138,7 +138,7 @@ void QNode::AutoMove(float speed_linear, float speed_turn,
twist.angular.y = 0; twist.angular.y = 0;
twist.angular.z = speed_turn * th; twist.angular.z = speed_turn * th;
ticks = int(total_times * rate); ticks = int(total_times);
for(int i = 0; i < ticks; i++) for(int i = 0; i < ticks; i++)
{ {

@ -7,9 +7,21 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1440</width> <width>1440</width>
<height>810</height> <height>860</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>1440</width>
<height>860</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1440</width>
<height>860</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
@ -17,8 +29,178 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_menu">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="btn_main">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_uav">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_ugv">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="://images/toolbar_dash.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="btn_map">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:hover{
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="://images/toolbar_map.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_other">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:hover{
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="://images/toolbar_other.png">
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QStackedWidget" name="stackedWidget_main"> <widget class="QStackedWidget" name="stackedWidget_main">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>2</number>
@ -54,20 +236,302 @@
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="UGVWidget"> <widget class="QWidget" name="UGVWidget">
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1000</x> <x>700</x>
<y>30</y> <y>0</y>
<width>407</width> <width>735</width>
<height>680</height> <height>750</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_time">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="text">
<string>00:00:00</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/robot2.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>系统状态:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_status">
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/power.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar#progressBar
{
border:none; /*无边框*/
background:rgb(211, 215, 207);
border-radius:5px;
text-align:center; /*文本的位置*/
color: rgb(229, 229, 229); /*文本颜色*/
}
QProgressBar::chunk
{
background-color:rgb(115, 210, 22);
border-radius:4px;
}
</string>
</property>
<property name="value">
<number>70</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/power-v.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_power">
<property name="minimumSize">
<size>
<width>50</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>00.00V</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>270</width>
<height>200</height>
</size>
</property>
<property name="text">
<string>map</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="minimumSize">
<size>
<width>270</width>
<height>200</height>
</size>
</property>
<property name="text">
<string>target</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="minimumSize">
<size>
<width>270</width>
<height>200</height>
</size>
</property>
<property name="text">
<string>shortcut</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QStackedWidget" name="stackedWidget_ros_control"> <widget class="QStackedWidget" name="stackedWidget_ros_control">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="keyboard_control"> <widget class="QWidget" name="keyboard_control">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
@ -666,54 +1130,23 @@ background-color: rgb(255,255,255);
</layout> </layout>
</item> </item>
</layout> </layout>
</item>
</layout>
</item>
</layout>
</widget> </widget>
<widget class="QWidget" name="widget_speed_x" native="true"> <widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>100</x>
<y>400</y>
<width>302</width>
<height>300</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
<widget class="QWidget" name="widget_speed_th" native="true">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>490</x> <x>21</x>
<y>400</y> <y>1</y>
<width>302</width> <width>660</width>
<height>300</height> <height>756</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <layout class="QVBoxLayout" name="verticalLayout_7">
<size> <item>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_12"> <widget class="QGroupBox" name="groupBox_12">
<property name="geometry">
<rect>
<x>50</x>
<y>10</y>
<width>541</width>
<height>368</height>
</rect>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -723,195 +1156,196 @@ background-color: rgb(255,255,255);
<property name="title"> <property name="title">
<string>Logging</string> <string>Logging</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="1" column="0"> <item>
<widget class="QLabel" name="label_camera">
<property name="minimumSize">
<size>
<width>600</width>
<height>270</height>
</size>
</property>
<property name="text">
<string>CameraLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="view_logging_2"> <widget class="QListView" name="view_logging_2">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> <property name="minimumSize">
</item> <size>
<item row="0" column="0"> <width>600</width>
<widget class="QLabel" name="label_camera"> <height>81</height>
<property name="text"> </size>
<string>CameraLabel</string> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>81</height>
</size>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
</widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_menu"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<item> <item>
<widget class="QPushButton" name="btn_main"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QWidget" name="widget_speed_x" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>300</width>
<height>60</height> <height>300</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btn_uav"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>160</width>
<height>60</height> <height>30</height>
</size> </size>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text"> <property name="text">
<string/> <string>x 轴线速度</string>
</property> </property>
<property name="iconSize"> </widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size> <size>
<width>32</width> <width>40</width>
<height>32</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btn_ugv"> <widget class="QLabel" name="label_5">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>60</width>
<height>60</height> <height>35</height>
</size> </size>
</property> </property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text"> <property name="text">
<string/> <string>正向</string>
</property> </property>
<property name="icon"> </widget>
<iconset theme="://images/toolbar_dash.png"> </item>
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset> </layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="iconSize"> <property name="sizeHint" stdset="0">
<size> <size>
<width>32</width> <width>40</width>
<height>32</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btn_map"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QWidget" name="widget_speed_th" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>300</width>
<height>60</height> <height>300</height>
</size> </size>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton:hover{ <string notr="true"/>
background-color:rgb(186, 189, 182); </property>
border-bottom:2px solid rgb(67, 154, 246); </widget>
} </item>
QPushButton:checked{ <item>
background-color:cyan; <layout class="QHBoxLayout" name="horizontalLayout_5">
border-bottom:2px solid white <item>
} <widget class="QLabel" name="label_6">
QPushButton:pressed{ <property name="minimumSize">
background-color:rgb(67, 154, 246) <size>
} <width>160</width>
QPushButton{ <height>30</height>
background-color:rgb(238, 238, 236); </size>
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>x 轴线速度</string>
</property> </property>
<property name="icon"> </widget>
<iconset theme="://images/toolbar_map.png"> </item>
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset> <item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="iconSize"> <property name="sizeHint" stdset="0">
<size> <size>
<width>32</width> <width>40</width>
<height>32</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btn_other"> <widget class="QLabel" name="label_7">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>60</width>
<height>60</height> <height>35</height>
</size> </size>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:hover{
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property>
<property name="text"> <property name="text">
<string/> <string>正向</string>
</property> </property>
<property name="icon"> </widget>
<iconset theme="://images/toolbar_other.png"> </item>
<normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</normaloff>../../../../../catkin_ws/src/Ros_Qt5_Gui_App/ui</iconset> </layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="iconSize"> <property name="sizeHint" stdset="0">
<size> <size>
<width>32</width> <width>40</width>
<height>32</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </spacer>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget>
</widget>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save