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 #pragma once
38 
39 class QLabel;
40 class QProgressBar;
41 class QPushButton;
42 
43 #ifndef Q_MOC_RUN
44 #include <urdf/model.h> // for testing a valid urdf is loaded
45 #include <srdfdom/model.h> // for testing a valid srdf is loaded
46 #include <moveit/setup_assistant/tools/moveit_config_data.h> // common datastructure class
47 #endif
48 
49 #include "setup_screen_widget.h" // a base class for screens in the setup assistant
50 
51 namespace moveit_setup_assistant
52 {
53 // Class Prototypes
54 class SelectModeWidget;
55 class LoadPathArgsWidget;
56 
61 {
62  Q_OBJECT
63 
64 public:
65  // ******************************************************************************************
66  // Public Functions
67  // ******************************************************************************************
68 
72  StartScreenWidget(QWidget* parent, const MoveItConfigDataPtr& config_data);
73 
74  ~StartScreenWidget() override;
75 
76  // ******************************************************************************************
77  // Qt Components
78  // ******************************************************************************************
82  QPushButton* btn_load_;
83  QLabel* next_label_;
84  QProgressBar* progress_bar_;
85  QImage* right_image_;
87 
89  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
90 
91 private Q_SLOTS:
92 
93  // ******************************************************************************************
94  // Slot Event Functions
95  // ******************************************************************************************
96 
98  void showNewOptions();
99 
101  void showExistingOptions();
102 
104  void loadFilesClick();
105 
107  void onPackagePathChanged(const QString& path);
108 
110  void onUrdfPathChanged(const QString& path);
111 
112 Q_SIGNALS:
113 
114  // ******************************************************************************************
115  // Emitted Signal Functions
116  // ******************************************************************************************
117 
119  void readyToProgress();
120 
122  void loadRviz();
123 
124 private:
125  // ******************************************************************************************
126  // Variables
127  // ******************************************************************************************
128 
131 
132  // ******************************************************************************************
133  // Private Functions
134  // ******************************************************************************************
135 
137  bool loadPackageSettings(bool show_warnings);
138 
140  bool loadNewFiles();
141 
143  bool loadExistingFiles();
144 
146  bool loadURDFFile(const std::string& urdf_file_path, const std::string& xacro_args);
147 
149  bool loadSRDFFile(const std::string& srdf_file_path, const std::string& xacro_args);
150 
152  bool setSRDFFile(const std::string& srdf_string);
153 
156 
158  bool createFullURDFPath();
159 
161  bool createFullSRDFPath(const std::string& package_path);
162 
164  bool load3DSensorsFile();
165 };
166 
167 // ******************************************************************************************
168 // ******************************************************************************************
169 // Class for selecting which mode
170 // ******************************************************************************************
171 // ******************************************************************************************
172 
173 class SelectModeWidget : public QFrame
174 {
175  Q_OBJECT
176 
177 private:
178 private Q_SLOTS:
179 
180 public:
181  SelectModeWidget(QWidget* parent);
182 
183  // Load file button
184  QPushButton* btn_new_;
185  QPushButton* btn_exist_;
187 };
188 } // namespace moveit_setup_assistant
moveit_setup_assistant::StartScreenWidget::showNewOptions
void showNewOptions()
User has chosen to show new options.
Definition: start_screen_widget.cpp:259
moveit_setup_assistant::StartScreenWidget
Start screen user interface for MoveIt Configuration Assistant.
Definition: start_screen_widget.h:60
moveit_setup_assistant::StartScreenWidget::~StartScreenWidget
~StartScreenWidget() override
Definition: start_screen_widget.cpp:251
moveit_setup_assistant::StartScreenWidget::next_label_
QLabel * next_label_
Definition: start_screen_widget.h:83
moveit_setup_assistant::StartScreenWidget::setSRDFFile
bool setSRDFFile(const std::string &srdf_string)
Put SRDF File on Parameter Server.
Definition: start_screen_widget.cpp:641
moveit_setup_assistant::StartScreenWidget::readyToProgress
void readyToProgress()
Event that is fired when the start screen has all its requirements completed and user can move on.
moveit_setup_assistant::SelectModeWidget::btn_exist_
QPushButton * btn_exist_
Definition: start_screen_widget.h:185
moveit_setup_assistant::StartScreenWidget::onUrdfPathChanged
void onUrdfPathChanged(const QString &path)
enable xacro arguments
Definition: start_screen_widget.cpp:343
moveit_setup_assistant::SelectModeWidget
Definition: start_screen_widget.h:173
moveit_setup_assistant::StartScreenWidget::loadURDFFile
bool loadURDFFile(const std::string &urdf_file_path, const std::string &xacro_args)
Load URDF File to Parameter Server.
Definition: start_screen_widget.cpp:579
moveit_setup_assistant::StartScreenWidget::loadRviz
void loadRviz()
Inform the parent widget to load rviz. This is done so that progress bar can be more accurate.
moveit_setup_assistant::StartScreenWidget::stack_path_
LoadPathArgsWidget * stack_path_
Definition: start_screen_widget.h:80
moveit_config_data.h
moveit_setup_assistant::StartScreenWidget::btn_load_
QPushButton * btn_load_
Definition: start_screen_widget.h:82
moveit_setup_assistant::StartScreenWidget::onPackagePathChanged
void onPackagePathChanged(const QString &path)
load package settings
Definition: start_screen_widget.cpp:335
moveit_setup_assistant::SelectModeWidget::widget_instructions_
QLabel * widget_instructions_
Definition: start_screen_widget.h:186
model.h
moveit_setup_assistant::StartScreenWidget::StartScreenWidget
StartScreenWidget(QWidget *parent, const MoveItConfigDataPtr &config_data)
Start screen user interface for MoveIt Configuration Assistant.
Definition: start_screen_widget.cpp:113
SetupScreenWidget
Definition: setup_screen_widget.h:44
moveit_setup_assistant::LoadPathArgsWidget
Extend LoadPathWidget with additional line edit for arguments.
Definition: header_widget.h:104
moveit_setup_assistant::SelectModeWidget::SelectModeWidget
SelectModeWidget(QWidget *parent)
Definition: start_screen_widget.cpp:783
moveit_setup_assistant::StartScreenWidget::create_new_package_
bool create_new_package_
Create new config files, or load existing one?
Definition: start_screen_widget.h:130
moveit_setup_assistant::StartScreenWidget::loadExistingFiles
bool loadExistingFiles()
Load exisiting package files.
Definition: start_screen_widget.cpp:397
moveit_setup_assistant::StartScreenWidget::showExistingOptions
void showExistingOptions()
User has chosen to show edit options.
Definition: start_screen_widget.cpp:276
moveit_setup_assistant::StartScreenWidget::progress_bar_
QProgressBar * progress_bar_
Definition: start_screen_widget.h:84
moveit_setup_assistant
Definition: compute_default_collisions.h:46
moveit_setup_assistant::StartScreenWidget::loadSRDFFile
bool loadSRDFFile(const std::string &srdf_file_path, const std::string &xacro_args)
Load SRDF File.
Definition: start_screen_widget.cpp:625
moveit_setup_assistant::StartScreenWidget::right_image_label_
QLabel * right_image_label_
Definition: start_screen_widget.h:86
moveit_setup_assistant::StartScreenWidget::extractPackageNameFromPath
bool extractPackageNameFromPath()
Definition: start_screen_widget.cpp:674
moveit_setup_assistant::StartScreenWidget::select_mode_
SelectModeWidget * select_mode_
Definition: start_screen_widget.h:79
moveit_setup_assistant::StartScreenWidget::config_data_
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
Definition: start_screen_widget.h:89
setup_screen_widget.h
moveit_setup_assistant::StartScreenWidget::loadNewFiles
bool loadNewFiles()
Load chosen files for creating new package.
Definition: start_screen_widget.cpp:497
moveit_setup_assistant::StartScreenWidget::loadPackageSettings
bool loadPackageSettings(bool show_warnings)
load package settings from .setup_assistant file
Definition: start_screen_widget.cpp:348
moveit_setup_assistant::StartScreenWidget::urdf_file_
LoadPathArgsWidget * urdf_file_
Definition: start_screen_widget.h:81
moveit_setup_assistant::StartScreenWidget::load3DSensorsFile
bool load3DSensorsFile()
Loads sensors_3d yaml file.
Definition: start_screen_widget.cpp:763
moveit_setup_assistant::StartScreenWidget::loadFilesClick
void loadFilesClick()
Button event for loading user chosen files.
Definition: start_screen_widget.cpp:293
moveit_setup_assistant::StartScreenWidget::createFullSRDFPath
bool createFullSRDFPath(const std::string &package_path)
Make the full SRDF path using the loaded .setup_assistant data.
Definition: start_screen_widget.cpp:748
moveit_setup_assistant::SelectModeWidget::btn_new_
QPushButton * btn_new_
Definition: start_screen_widget.h:184
moveit_setup_assistant::StartScreenWidget::right_image_
QImage * right_image_
Definition: start_screen_widget.h:85
moveit_setup_assistant::StartScreenWidget::createFullURDFPath
bool createFullURDFPath()
Make the full URDF path using the loaded .setup_assistant data.
Definition: start_screen_widget.cpp:715


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sat May 3 2025 02:28:05