moveit2
The MoveIt Motion Planning Framework for ROS 2.
start_screen_widget.hpp
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 #pragma once
38 
41 #include <rclcpp/node.hpp>
42 #include <QWidget>
43 #include <QFrame>
44 class QLabel;
45 class QProgressBar;
46 class QPushButton;
47 
48 #ifndef Q_MOC_RUN
50 #endif
51 
52 namespace moveit_setup
53 {
54 namespace core
55 {
56 // Class Prototypes
57 class SelectModeWidget;
58 
63 {
64  Q_OBJECT
65 
66 public:
67  // ******************************************************************************************
68  // Public Functions
69  // ******************************************************************************************
70 
71  void onInit() override;
72 
73  ~StartScreenWidget() override;
74 
75  void focusGiven() override;
76 
77  // ******************************************************************************************
78  // Qt Components
79  // ******************************************************************************************
83  QPushButton* btn_load_;
84  QLabel* next_label_;
85  QProgressBar* progress_bar_; // TODO: Note that since the refactoring, the progress bar is less useful than before
86  QImage* right_image_;
88 
89  SetupStep& getSetupStep() override
90  {
91  return setup_step_;
92  }
93 
94 private Q_SLOTS:
95 
96  // ******************************************************************************************
97  // Slot Event Functions
98  // ******************************************************************************************
99 
101  void showNewOptions();
102 
104  void showExistingOptions();
105 
107  void loadFilesClick();
108 
110  void onPackagePathChanged(const QString& path);
111 
113  void onUrdfPathChanged(const QString& path);
114 
115 private:
116  // ******************************************************************************************
117  // Variables
118  // ******************************************************************************************
119  rclcpp::Node::SharedPtr node_;
120  StartScreen setup_step_;
121 
123  bool create_new_package_;
124 
125  // ******************************************************************************************
126  // Private Functions
127  // ******************************************************************************************
128 
130  bool loadPackageSettings(bool show_warnings);
131 
133  bool loadNewFiles();
134 
136  bool loadExistingFiles();
137 };
138 
139 // ******************************************************************************************
140 // ******************************************************************************************
141 // Class for selecting which mode
142 // ******************************************************************************************
143 // ******************************************************************************************
144 
145 class SelectModeWidget : public QFrame
146 {
147  Q_OBJECT
148 
149 private:
150 private Q_SLOTS:
151 
152 public:
153  SelectModeWidget(QWidget* parent);
154 
155  // Load file button
156  QPushButton* btn_new_;
157  QPushButton* btn_exist_;
159 };
160 } // namespace core
161 } // namespace moveit_setup
Extend LoadPathWidget with additional line edit for arguments.
The GUI code for one SetupStep.
Contains all of the non-GUI code necessary for doing one "screen" worth of setup.
Definition: setup_step.hpp:47
Start screen user interface for MoveIt Configuration Assistant.
void focusGiven() override
function called when widget is activated, allows to update/initialize GUI
SetupStep & getSetupStep() override
Return a reference to the SetupStep object.