moveit2
The MoveIt Motion Planning Framework for ROS 2.
setup_assistant_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 
39 // ROS
40 #include <pluginlib/class_loader.hpp>
41 #include <rviz_common/ros_integration/ros_client_abstraction.hpp>
42 
43 // Qt
44 #include <QWidget>
45 #include <QStackedWidget>
46 #include <QAbstractTableModel>
47 class QSplitter;
48 
49 // Setup Assistant
54 
55 #ifndef Q_MOC_RUN
56 // Other
57 #include <boost/program_options/variables_map.hpp> // for parsing input arguments
58 #endif
59 
60 namespace moveit_setup
61 {
62 namespace assistant
63 {
64 class SetupAssistantWidget : public QWidget
65 {
66  Q_OBJECT
67 
68 public:
69  // ******************************************************************************************
70  // Public Functions
71  // ******************************************************************************************
72 
78  SetupAssistantWidget(const rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr& node, QWidget* parent,
79  const boost::program_options::variables_map& args);
80 
86  void moveToScreen(const int index);
87 
92  void closeEvent(QCloseEvent* event) override;
93 
101  virtual bool notify(QObject* rec, QEvent* ev);
102 
107  // void showRviz( bool show );
108 
109  // ******************************************************************************************
110  // Qt Components
111  // ******************************************************************************************
112 
113 private Q_SLOTS:
114  // ******************************************************************************************
115  // Slot Event Functions
116  // ******************************************************************************************
117 
122  void navigationClicked(const QModelIndex& index);
123 
127  void updateTimer();
128 
132  void onDataUpdate();
133 
137  void onAdvanceRequest();
138 
144  void onModalModeUpdate(bool isModal);
145 
146 private:
147  // ******************************************************************************************
148  // Variables
149  // ******************************************************************************************
150  rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr node_abstraction_;
151  rclcpp::Node::SharedPtr node_;
152  QList<QString> nav_name_list_;
153  NavigationWidget* navs_view_;
154 
155  RVizPanel* rviz_panel_;
156  QSplitter* splitter_;
157  QStackedWidget* main_content_;
158  int current_index_;
159  std::mutex change_screen_lock_;
160 
161  // Setup Steps
162  pluginlib::ClassLoader<SetupStepWidget> widget_loader_;
163  std::vector<std::shared_ptr<SetupStepWidget>> steps_;
164 
166  DataWarehousePtr config_data_;
167 
168  // ******************************************************************************************
169  // Private Functions
170  // ******************************************************************************************
171 };
172 } // namespace assistant
173 } // namespace moveit_setup
SetupAssistantWidget(const rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr &node, QWidget *parent, const boost::program_options::variables_map &args)
virtual bool notify(QObject *rec, QEvent *ev)