start_screen_widget.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
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 Willow Garage 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 
37 #ifndef MOVEIT_MOVEIT_SETUP_ASSISTANT_WIDGETS_START_SCREEN_WIDGET_
38 #define MOVEIT_MOVEIT_SETUP_ASSISTANT_WIDGETS_START_SCREEN_WIDGET_
39 
40 #include <QWidget>
41 #include <QLineEdit>
42 #include <QPushButton>
43 #include <QLabel>
44 #include <QProgressBar>
45 #include <QTextEdit>
46 
47 #ifndef Q_MOC_RUN
48 #include <urdf/model.h> // for testing a valid urdf is loaded
49 #include <srdfdom/model.h> // for testing a valid srdf is loaded
50 #include <moveit/setup_assistant/tools/moveit_config_data.h> // common datastructure class
51 #endif
52 
53 #include "setup_screen_widget.h" // a base class for screens in the setup assistant
54 
55 namespace moveit_setup_assistant
56 {
57 // Class Prototypes
58 class SelectModeWidget;
59 class LoadPathArgsWidget;
60 
65 {
66  Q_OBJECT
67 
68 public:
69  // ******************************************************************************************
70  // Public Functions
71  // ******************************************************************************************
72 
76  StartScreenWidget(QWidget* parent, moveit_setup_assistant::MoveItConfigDataPtr config_data);
77 
79 
80  // ******************************************************************************************
81  // Qt Components
82  // ******************************************************************************************
86  QPushButton* btn_load_;
87  QLabel* next_label_;
88  QProgressBar* progress_bar_;
89  QImage* right_image_;
91 
93  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
94 
95 private Q_SLOTS:
96 
97  // ******************************************************************************************
98  // Slot Event Functions
99  // ******************************************************************************************
100 
102  void showNewOptions();
103 
105  void showExistingOptions();
106 
108  void loadFilesClick();
109 
111  void onPackagePathChanged(const QString& path);
112 
114  void onUrdfPathChanged(const QString& path);
115 
116 Q_SIGNALS:
117 
118  // ******************************************************************************************
119  // Emitted Signal Functions
120  // ******************************************************************************************
121 
123  void readyToProgress();
124 
126  void loadRviz();
127 
128 private:
129  // ******************************************************************************************
130  // Variables
131  // ******************************************************************************************
132 
135 
136  // ******************************************************************************************
137  // Private Functions
138  // ******************************************************************************************
139 
141  bool loadPackageSettings(bool show_warnings);
142 
144  bool loadNewFiles();
145 
147  bool loadExistingFiles();
148 
150  bool loadURDFFile(const std::string& urdf_file_path, const std::string& xacro_args);
151 
153  bool loadSRDFFile(const std::string& srdf_file_path);
154 
156  bool setSRDFFile(const std::string& srdf_string);
157 
160 
162  bool createFullURDFPath();
163 
165  bool createFullSRDFPath(const std::string& package_path);
166 
168  bool load3DSensorsFile();
169 };
170 
171 // ******************************************************************************************
172 // ******************************************************************************************
173 // Class for selecting which mode
174 // ******************************************************************************************
175 // ******************************************************************************************
176 
177 class SelectModeWidget : public QFrame
178 {
179  Q_OBJECT
180 
181 private:
182 private Q_SLOTS:
183 
184 public:
185  SelectModeWidget(QWidget* parent);
186 
187  // Load file button
188  QPushButton* btn_new_;
189  QPushButton* btn_exist_;
191 };
192 }
193 
194 #endif
void loadRviz()
Inform the parent widget to load rviz. This is done so that progress bar can be more accurate...
void onPackagePathChanged(const QString &path)
load package settings
bool loadExistingFiles()
Load exisiting package files.
void showNewOptions()
User has chosen to show new options.
bool loadSRDFFile(const std::string &srdf_file_path)
Load SRDF File.
StartScreenWidget(QWidget *parent, moveit_setup_assistant::MoveItConfigDataPtr config_data)
Start screen user interface for MoveIt! Configuration Assistant.
Start screen user interface for MoveIt! Configuration Assistant.
bool setSRDFFile(const std::string &srdf_string)
Put SRDF File on Parameter Server.
bool loadPackageSettings(bool show_warnings)
load package settings from .setup_assistant file
void loadFilesClick()
Button event for loading user chosen files.
Extend LoadPathWidget with additional line edit for arguments.
void showExistingOptions()
User has chosen to show edit options.
void onUrdfPathChanged(const QString &path)
enable xacro arguments
bool loadURDFFile(const std::string &urdf_file_path, const std::string &xacro_args)
Load URDF File to Parameter Server.
bool createFullURDFPath()
Make the full URDF path using the loaded .setup_assistant data.
bool create_new_package_
Create new config files, or load existing one?
void readyToProgress()
Event that is fired when the start screen has all its requirements completed and user can move on...
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
bool createFullSRDFPath(const std::string &package_path)
Make the full SRDF path using the loaded .setup_assistant data.
bool loadNewFiles()
Load chosen files for creating new package.
bool load3DSensorsFile()
Loads sensors_3d yaml file.


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sun Oct 18 2020 13:19:28