rviz_visual_tools_gui.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017, PickNik Consulting
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of PickNik Consulting nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Dave Coleman
36  Desc: Rviz display panel for controlling and debugging ROS applications
37 */
38 
39 #include <cstdio>
40 
41 #include <QGroupBox>
42 #include <QHBoxLayout>
43 #include <QLabel>
44 #include <QLineEdit>
45 #include <QPainter>
46 #include <QSpinBox>
47 #include <QTimer>
48 #include <QVBoxLayout>
49 
50 #include "rviz_visual_tools_gui.h"
51 
52 namespace rviz_visual_tools
53 {
54 RvizVisualToolsGui::RvizVisualToolsGui(QWidget* parent) : rviz::Panel(parent)
55 {
56  // Create a push button
57  btn_next_ = new QPushButton(this);
58  btn_next_->setText("Next");
59  connect(btn_next_, SIGNAL(clicked()), this, SLOT(moveNext()));
60 
61  // Create a push button
62  btn_auto_ = new QPushButton(this);
63  btn_auto_->setText("Continue");
64  connect(btn_auto_, SIGNAL(clicked()), this, SLOT(moveAuto()));
65 
66  // Create a push button
67  btn_full_auto_ = new QPushButton(this);
68  btn_full_auto_->setText("Break");
69  connect(btn_full_auto_, SIGNAL(clicked()), this, SLOT(moveFullAuto()));
70 
71  // Create a push button
72  btn_stop_ = new QPushButton(this);
73  btn_stop_->setText("Stop");
74  connect(btn_stop_, SIGNAL(clicked()), this, SLOT(moveStop()));
75 
76  // Horizontal Layout
77  auto* hlayout1 = new QHBoxLayout;
78  hlayout1->addWidget(btn_next_);
79  hlayout1->addWidget(btn_auto_);
80  hlayout1->addWidget(btn_full_auto_);
81  hlayout1->addWidget(btn_stop_);
82 
83  // Verticle layout
84  auto* layout = new QVBoxLayout;
85  layout->addLayout(hlayout1);
86  setLayout(layout);
87 
88  btn_next_->setEnabled(true);
89  btn_auto_->setEnabled(true);
90  btn_full_auto_->setEnabled(true);
91 }
92 
94 {
96 }
97 
99 {
101 }
102 
104 {
106 }
107 
109 {
111 }
112 
114 {
115  rviz::Panel::save(config);
116 }
117 
119 {
120  rviz::Panel::load(config);
121 }
122 } // end namespace rviz_visual_tools
123 
virtual void save(rviz::Config config) const
virtual void load(const rviz::Config &config)
virtual void save(Config config) const
virtual void load(const Config &config)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)


rviz_visual_tools
Author(s): Dave Coleman
autogenerated on Mon Jun 10 2019 15:05:18