task_panel.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017, Bielefeld University
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 Bielefeld University 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: Robert Haschke
36  Desc: Monitor manipulation tasks and visualize their solutions
37 */
38 
39 #include <stdio.h>
40 
41 #include "task_panel_p.h"
42 #include "meta_task_list_model.h"
43 #include "local_task_model.h"
44 #include "factory_model.h"
45 #include "pluginlib_factory.h"
46 #include "task_display.h"
50 
53 #include <rviz/display_group.h>
57 #include <rviz/panel_dock_widget.h>
58 #include <ros/console.h>
59 #include <QPointer>
60 #include <QButtonGroup>
61 
62 namespace moveit_rviz_plugin {
63 
65  static QPointer<rviz::PanelDockWidget> widget = nullptr;
66  if (!widget && mgr) { // create widget
67  StageFactoryPtr factory = getStageFactory();
68  if (!factory)
69  return nullptr;
70  QTreeView* view = new QTreeView();
71  view->setModel(new FactoryModel(*factory, factory->mimeType(), view));
72  view->expandAll();
73  view->setHeaderHidden(true);
74  view->setDragDropMode(QAbstractItemView::DragOnly);
75  widget = mgr->addPane("Motion Planning Stages", view);
76  }
77  widget->show();
78  return widget;
79 }
80 
81 // TaskPanel singleton
82 static QPointer<TaskPanel> SINGLETON;
83 // count active TaskDisplays
84 static uint DISPLAY_COUNT = 0;
85 
86 TaskPanel::TaskPanel(QWidget* parent) : rviz::Panel(parent), d_ptr(new TaskPanelPrivate(this)) {
87  Q_D(TaskPanel);
88 
89  // sync checked tool button with displayed widget
90 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
91  connect(d->tool_buttons_group, &QButtonGroup::idClicked, d->stackedWidget,
92  [d](int index) { d->stackedWidget->setCurrentIndex(index); });
93 #else
94  connect(d->tool_buttons_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
95  d->stackedWidget, [d](int index) { d->stackedWidget->setCurrentIndex(index); });
96 #endif
97  connect(d->stackedWidget, &QStackedWidget::currentChanged, d->tool_buttons_group,
98  [d](int index) { d->tool_buttons_group->button(index)->setChecked(true); });
99 
100  auto* task_view = new TaskView(this, d->property_root);
101  connect(d->button_exec_solution, SIGNAL(clicked()), task_view, SLOT(onExecCurrentSolution()));
102 
103  // create sub widgets with corresponding tool buttons
104  addSubPanel(task_view, "Tasks View", QIcon(":/icons/tasks.png"));
105  d->stackedWidget->setCurrentIndex(0); // Tasks View is show by default
106 
107  // settings widget should come last
108  addSubPanel(new GlobalSettingsWidget(this, d->property_root), "Global Settings", QIcon(":/icons/settings.png"));
109 
110  connect(d->button_show_stage_dock_widget, SIGNAL(clicked()), this, SLOT(showStageDockWidget()));
111 
112  // if still undefined, this becomes the global instance
113  if (SINGLETON.isNull())
114  SINGLETON = this;
115 }
116 
118  delete d_ptr;
119 }
120 
121 void TaskPanel::addSubPanel(SubPanel* w, const QString& title, const QIcon& icon) {
122  Q_D(TaskPanel);
123 
124  auto button = new QToolButton(w);
125  button->setToolTip(title);
126  button->setIcon(icon);
127  button->setCheckable(true);
128 
129  int index = d->stackedWidget->count();
130  d->tool_buttons_layout->insertWidget(index, button);
131  d->tool_buttons_group->addButton(button, index);
132  d->stackedWidget->addWidget(w);
133 
134  w->setWindowTitle(title);
135  connect(w, SIGNAL(configChanged()), this, SIGNAL(configChanged()));
136 }
137 
138 /* Realizing a singleton Panel is a nightmare with rviz...
139  * Formally, Panels (as a plugin class) cannot be singleton, because new instances are created on demand.
140  * Hence, we decided to use a true singleton for the underlying model only and a fake singleton for the panel.
141  * Thus, all panels (in case multiple were created) show the same content.
142  * The fake singleton shall ensure that only a single panel is created, even if several displays are created.
143  * To this end, the displays request() the need for a panel during their initialization and they release()
144  * this need during their destruction. This, in principle, allows to create a panel together with the first
145  * display and destroy it when the last display is gone.
146  * Obviously, the user can still decide to explicitly delete the panel (or create new ones).
147 
148  * The nightmare arises from the order of loading of displays and panels: Displays are loaded first.
149  * However, directly creating a panel with the first loaded display doesn't work, because panel loading
150  * will create another panel instance later (because there is no singleton support).
151  * Hence, we need to postpone the actual panel creation from displays until panel loading is finished as well.
152  * This was initially done, by postponing panel creation to TaskDisplay::update(). However, update()
153  * will never be called if the display is disabled...
154  */
155 
156 void TaskPanel::request(rviz::WindowManagerInterface* window_manager) {
157  ++DISPLAY_COUNT;
158 
159  rviz::VisualizationFrame* vis_frame = dynamic_cast<rviz::VisualizationFrame*>(window_manager);
160  if (SINGLETON || !vis_frame)
161  return; // already defined, nothing to do
162 
163  QDockWidget* dock = vis_frame->addPanelByName(
164  "Motion Planning Tasks", "moveit_task_constructor/Motion Planning Tasks", Qt::LeftDockWidgetArea);
165  Q_UNUSED(dock);
166  assert(dock->widget() == SINGLETON);
167 }
168 
169 void TaskPanel::release() {
170  Q_ASSERT(DISPLAY_COUNT > 0);
171  if (--DISPLAY_COUNT == 0 && SINGLETON)
172  SINGLETON->deleteLater();
173 }
174 
175 TaskPanelPrivate::TaskPanelPrivate(TaskPanel* panel) : q_ptr(panel) {
176  setupUi(panel);
177  tool_buttons_group = new QButtonGroup(panel);
178  tool_buttons_group->setExclusive(true);
179  button_show_stage_dock_widget->setEnabled(bool(getStageFactory()));
180  button_show_stage_dock_widget->setVisible(false); // hide for now
181  property_root = new rviz::Property("Global Settings");
182 }
183 
186 }
187 
188 void TaskPanel::save(rviz::Config config) const {
190  for (int i = 0; i < d_ptr->stackedWidget->count(); ++i) {
191  SubPanel* w = static_cast<SubPanel*>(d_ptr->stackedWidget->widget(i));
192  w->save(config.mapMakeChild(w->windowTitle()));
193  }
194 }
195 
196 void TaskPanel::load(const rviz::Config& config) {
197  rviz::Panel::load(config);
198  for (int i = 0; i < d_ptr->stackedWidget->count(); ++i) {
199  SubPanel* w = static_cast<SubPanel*>(d_ptr->stackedWidget->widget(i));
200  w->load(config.mapGetChild(w->windowTitle()));
201  }
202 }
203 
206  if (dock)
207  dock->show();
208 }
209 
210 // expand all children up to given depth
211 void setExpanded(QTreeView* view, const QModelIndex& index, bool expand, int depth = -1) {
212  if (!index.isValid())
213  return;
214 
215  // recursively expand all children
216  if (depth != 0) {
217  for (int row = 0, rows = index.model()->rowCount(index); row < rows; ++row)
218  setExpanded(view, index.model()->index(row, 0, index), expand, depth - 1);
219  }
220 
221  view->setExpanded(index, expand);
222 }
223 
224 TaskViewPrivate::TaskViewPrivate(TaskView* view) : q_ptr(view), exec_action_client_("execute_task_solution") {
225  setupUi(view);
226 
229  if (factory)
230  meta_model->setMimeTypes({ factory->mimeType() });
231  tasks_view->setModel(meta_model);
232  QObject::connect(meta_model, SIGNAL(rowsInserted(QModelIndex, int, int)), q_ptr,
233  SLOT(configureInsertedModels(QModelIndex, int, int)));
234 
235  tasks_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
236  tasks_view->setAcceptDrops(true);
237  tasks_view->setDefaultDropAction(Qt::CopyAction);
238  tasks_view->setDropIndicatorShown(true);
239  tasks_view->setDragEnabled(true);
240 
241  actionShowTimeColumn->setChecked(true);
242 
243  // init actions
244  // TODO(v4hn): add actionAddLocalTask once there is something meaningful to add
245  tasks_view->addActions({ /*actionAddLocalTask,*/ actionRemoveTaskTreeRows, actionShowTimeColumn });
246 }
247 
248 std::pair<TaskListModel*, TaskDisplay*> TaskViewPrivate::getTaskListModel(const QModelIndex& index) const {
249  auto* meta_model = static_cast<MetaTaskListModel*>(tasks_view->model());
250  return meta_model->getTaskListModel(index);
251 }
252 
253 std::pair<BaseTaskModel*, QModelIndex> TaskViewPrivate::getTaskModel(const QModelIndex& index) const {
254  auto* meta_model = static_cast<MetaTaskListModel*>(tasks_view->model());
255  return meta_model->getTaskModel(index);
256 }
257 
261 }
262 
264  auto* meta_model = static_cast<MetaTaskListModel*>(tasks_view->model());
265  for (int row = meta_model->rowCount() - 1; row >= 0; --row)
266  configureTaskListModel(meta_model->getTaskListModel(meta_model->index(row, 0)).first);
267 }
268 
269 void TaskViewPrivate::configureInsertedModels(const QModelIndex& parent, int first, int last) {
270  if (parent.isValid() && !parent.parent().isValid()) { // top-level task items inserted
271  int expand = q_ptr->initial_task_expand->getOptionInt();
272  for (int row = first; row <= last; ++row) {
273  // set expanded state of items
274  QModelIndex child = parent.model()->index(row, 0, parent);
275  if (expand != TaskView::EXPAND_NONE) {
276  // recursively expand all inserted items
277  setExpanded(tasks_view, child, true);
278  }
279  if (expand == TaskView::EXPAND_TOP) {
280  // collapse up to first level
281  setExpanded(tasks_view, child, false, 1);
282  // expand inserted item
283  setExpanded(tasks_view, child, true, 0);
284  }
285 
287  }
288  tasks_view->setExpanded(parent, true); // expand parent group item
289  }
290 }
291 
292 void TaskViewPrivate::lock(TaskDisplay* display) {
293  if (locked_display_ && locked_display_ != display) {
294  locked_display_->clearMarkers();
295  locked_display_->visualization()->unlock();
296  }
297  locked_display_ = display;
298 }
299 
301  : SubPanel(parent), d_ptr(new TaskViewPrivate(this)) {
302  Q_D(TaskView);
303 
304  d_ptr->tasks_property_splitter->setStretchFactor(0, 3);
305  d_ptr->tasks_property_splitter->setStretchFactor(1, 1);
306 
307  // connect signals
308  connect(d->actionRemoveTaskTreeRows, SIGNAL(triggered()), this, SLOT(removeSelectedStages()));
309  connect(d->actionAddLocalTask, SIGNAL(triggered()), this, SLOT(addTask()));
310  connect(d->actionShowTimeColumn, &QAction::triggered, [this](bool checked) { show_time_column->setValue(checked); });
311 
312  connect(d->tasks_view->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this,
313  SLOT(onCurrentStageChanged(QModelIndex, QModelIndex)));
314 
315  onCurrentStageChanged(d->tasks_view->currentIndex(), QModelIndex());
316 
317  // propagate infos about config changes
318  connect(d_ptr->tasks_property_splitter, SIGNAL(splitterMoved(int, int)), this, SIGNAL(configChanged()));
319  connect(d_ptr->tasks_solutions_splitter, SIGNAL(splitterMoved(int, int)), this, SIGNAL(configChanged()));
320  connect(d_ptr->tasks_view->header(), SIGNAL(sectionResized(int, int, int)), this, SIGNAL(configChanged()));
321  connect(d_ptr->solutions_view->header(), SIGNAL(sectionResized(int, int, int)), this, SIGNAL(configChanged()));
322  connect(d_ptr->solutions_view->header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this,
323  SIGNAL(configChanged()));
324 
325  // configuration settings
326  auto configs = new rviz::Property("Task View Settings", QVariant(), QString(), root);
327  initial_task_expand =
328  new rviz::EnumProperty("Task Expansion", "All Expanded", "Configure how to initially expand new tasks", configs);
329  initial_task_expand->addOption("Top-level Expanded", EXPAND_TOP);
330  initial_task_expand->addOption("All Expanded", EXPAND_ALL);
331  initial_task_expand->addOption("All Closed", EXPAND_NONE);
332 
333  old_task_handling =
334  new rviz::EnumProperty("Old task handling", "Keep",
335  "Configure what to do with old tasks whose solutions cannot be queried anymore", configs);
336  old_task_handling->addOption("Keep", OLD_TASK_KEEP);
337  old_task_handling->addOption("Replace", OLD_TASK_REPLACE);
338  old_task_handling->addOption("Remove", OLD_TASK_REMOVE);
339  connect(old_task_handling, &rviz::Property::changed, this, &TaskView::onOldTaskHandlingChanged);
340 
341  show_time_column = new rviz::BoolProperty("Show Computation Times", true, "Show the 'time' column", configs);
342  connect(show_time_column, &rviz::Property::changed, this, &TaskView::onShowTimeChanged);
343 
344  d_ptr->configureExistingModels();
345 }
346 
348  delete d_ptr;
349 }
350 
351 void TaskView::save(rviz::Config config) {
352  auto write_splitter_sizes = [&config](QSplitter* splitter, const QString& key) {
353  rviz::Config group = config.mapMakeChild(key);
354  for (int s : splitter->sizes()) {
355  rviz::Config item = group.listAppendNew();
356  item.setValue(s);
357  }
358  };
359  write_splitter_sizes(d_ptr->tasks_property_splitter, "property_splitter");
360  write_splitter_sizes(d_ptr->tasks_solutions_splitter, "solutions_splitter");
361 
362  auto write_column_sizes = [&config](QHeaderView* view, const QString& key) {
363  rviz::Config group = config.mapMakeChild(key);
364  for (int c = 0, end = view->count(); c != end; ++c) {
365  rviz::Config item = group.listAppendNew();
366  item.setValue(view->sectionSize(c));
367  }
368  };
369  write_column_sizes(d_ptr->tasks_view->header(), "tasks_view_columns");
370  write_column_sizes(d_ptr->solutions_view->header(), "solutions_view_columns");
371 
372  const QHeaderView* view = d_ptr->solutions_view->header();
373  rviz::Config group = config.mapMakeChild("solution_sorting");
374  group.mapSetValue("column", view->sortIndicatorSection());
375  group.mapSetValue("order", view->sortIndicatorOrder());
376 }
377 
378 void TaskView::load(const rviz::Config& config) {
379  if (!config.isValid())
380  return;
381 
382  auto read_sizes = [&config](const QString& key) {
383  rviz::Config group = config.mapGetChild(key);
384  QList<int> sizes, empty;
385  for (int i = 0; i < group.listLength(); ++i) {
386  rviz::Config item = group.listChildAt(i);
387  if (item.getType() != rviz::Config::Value)
388  return empty;
389  QVariant value = item.getValue();
390  bool ok = false;
391  int int_value = value.toInt(&ok);
392  if (!ok)
393  return empty;
394  sizes << int_value;
395  }
396  return sizes;
397  };
398  d_ptr->tasks_property_splitter->setSizes(read_sizes("property_splitter"));
399  d_ptr->tasks_solutions_splitter->setSizes(read_sizes("solutions_splitter"));
400 
401  int column = 0;
402  for (int w : read_sizes("tasks_view_columns"))
403  d_ptr->tasks_view->setColumnWidth(++column, w);
404  column = 0;
405  for (int w : read_sizes("solutions_view_columns"))
406  d_ptr->tasks_view->setColumnWidth(++column, w);
407 
408  QTreeView* view = d_ptr->solutions_view;
409  rviz::Config group = config.mapGetChild("solution_sorting");
410  int order = 0;
411  if (group.mapGetInt("column", &column) && group.mapGetInt("order", &order))
412  view->sortByColumn(column, static_cast<Qt::SortOrder>(order));
413 }
414 
415 void TaskView::addTask() {
416  QModelIndex current = d_ptr->tasks_view->currentIndex();
417  if (!current.isValid())
418  return;
419  bool is_top_level = !current.parent().isValid();
420 
421  TaskListModel* task_list_model = d_ptr->getTaskListModel(current).first;
422  task_list_model->insertModel(task_list_model->createLocalTaskModel(), is_top_level ? -1 : current.row());
423 
424  // select and edit newly inserted model
425  if (is_top_level)
426  current = current.model()->index(task_list_model->rowCount() - 1, 0, current);
427  d_ptr->tasks_view->scrollTo(current);
428  d_ptr->tasks_view->setCurrentIndex(current);
429  d_ptr->tasks_view->edit(current);
430 }
431 
433  auto* m = d_ptr->tasks_view->model();
434  for (const auto& range : d_ptr->tasks_view->selectionModel()->selection())
435  m->removeRows(range.top(), range.bottom() - range.top() + 1, range.parent());
436 }
437 
438 void TaskView::onCurrentStageChanged(const QModelIndex& current, const QModelIndex& /*previous*/) {
439  // adding task is allowed on top-level items and sub-top-level items
440  d_ptr->actionAddLocalTask->setEnabled(current.isValid() &&
441  (!current.parent().isValid() || !current.parent().parent().isValid()));
442  // removing stuff is allowed any valid selection except top-level items
443  d_ptr->actionRemoveTaskTreeRows->setEnabled(current.isValid() && current.parent().isValid());
444 
445  BaseTaskModel* task;
446  QModelIndex task_index;
447  std::tie(task, task_index) = d_ptr->getTaskModel(current);
448 
449  d_ptr->lock(nullptr); // unlocks any locked_display_
450 
451  // update the SolutionModel
452  QTreeView* view = d_ptr->solutions_view;
453  int sort_column = view->header()->sortIndicatorSection();
454  Qt::SortOrder sort_order = view->header()->sortIndicatorOrder();
455 
456  QItemSelectionModel* sm = view->selectionModel();
457  QAbstractItemModel* m = task ? task->getSolutionModel(task_index) : nullptr;
458  if (view->model() != m) {
459  view->setModel(m);
460  view->sortByColumn(sort_column, sort_order);
461  delete sm; // we don't store the selection model
462 
463  sm = view->selectionModel();
464  connect(sm, SIGNAL(currentChanged(QModelIndex, QModelIndex)), this,
465  SLOT(onCurrentSolutionChanged(QModelIndex, QModelIndex)));
466  connect(sm, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this,
467  SLOT(onSolutionSelectionChanged(QItemSelection, QItemSelection)));
468  }
469 
470  // update the PropertyModel
471  view = d_ptr->property_view;
472  sm = view->selectionModel();
473  m = task ? task->getPropertyModel(task_index) : nullptr;
474  if (view->model() != m) {
475  view->setModel(m);
476  delete sm; // we don't store the selection model
477  }
478 }
479 
480 void TaskView::onCurrentSolutionChanged(const QModelIndex& current, const QModelIndex& /*previous*/) {
481  TaskDisplay* display = d_ptr->getTaskListModel(d_ptr->tasks_view->currentIndex()).second;
482  d_ptr->lock(display);
483 
484  if (!display || !current.isValid())
485  return;
486 
487  BaseTaskModel* task = d_ptr->getTaskModel(d_ptr->tasks_view->currentIndex()).first;
488  Q_ASSERT(task);
489 
490  TaskSolutionVisualization* vis = display->visualization();
491  DisplaySolutionPtr solution;
492  try {
493  solution = task->getSolution(current);
494  display->setSolutionStatus(bool(solution));
495  } catch (const std::invalid_argument& e) {
496  ROS_ERROR_STREAM(e.what());
497  display->setSolutionStatus(false, e.what());
498  }
499  vis->interruptCurrentDisplay();
500  vis->showTrajectory(solution, true);
501 }
502 
503 void TaskView::onSolutionSelectionChanged(const QItemSelection& /*selected*/, const QItemSelection& /*deselected*/) {
504  QItemSelectionModel* sm = d_ptr->solutions_view->selectionModel();
505  const QModelIndexList& selected_rows = sm->selectedRows();
506 
507  TaskDisplay* display = d_ptr->getTaskListModel(d_ptr->tasks_view->currentIndex()).second;
508  Q_ASSERT(display);
509  BaseTaskModel* task = d_ptr->getTaskModel(d_ptr->tasks_view->currentIndex()).first;
510  Q_ASSERT(task);
511 
512  display->clearMarkers();
513  for (const auto& index : selected_rows) {
514  DisplaySolutionPtr solution;
515  try {
516  solution = task->getSolution(index);
517  display->setSolutionStatus(bool(solution));
518  } catch (const std::invalid_argument& e) {
519  ROS_ERROR_STREAM(e.what());
520  display->setSolutionStatus(false, e.what());
521  }
522  display->addMarkers(solution);
523  }
524 }
525 
526 void TaskView::onExecCurrentSolution() const {
527  const QModelIndex& current = d_ptr->solutions_view->currentIndex();
528  if (!current.isValid())
529  return;
530 
531  BaseTaskModel* task = d_ptr->getTaskModel(d_ptr->tasks_view->currentIndex()).first;
532  Q_ASSERT(task);
533 
534  const DisplaySolutionPtr& solution = task->getSolution(current);
535 
537  ROS_ERROR("Failed to connect to the 'execute_task_solution' action server");
538  return;
539  }
540 
541  moveit_task_constructor_msgs::ExecuteTaskSolutionGoal goal;
542  solution->fillMessage(goal.solution);
544 }
545 
547  auto* header = d_ptr->tasks_view->header();
548  bool show = show_time_column->getBool();
549  if (header->count() > 3)
550  d_ptr->tasks_view->header()->setSectionHidden(3, !show);
551  d_ptr->actionShowTimeColumn->setChecked(show);
552 }
553 
556 }
557 
559  : q_ptr(widget) {
560  setupUi(widget);
561  properties = new rviz::PropertyTreeModel(root, widget);
562  view->setModel(properties);
563 }
564 
566  : SubPanel(parent), d_ptr(new GlobalSettingsWidgetPrivate(this, root)) {
568 
569  d->view->expandAll();
571 }
572 
574  delete d_ptr;
575 }
576 
578  d_ptr->properties->getRoot()->save(config);
579 }
580 
581 void GlobalSettingsWidget::load(const rviz::Config& config) {
583 }
584 } // namespace moveit_rviz_plugin
585 
586 #include "moc_task_panel.cpp"
moveit_rviz_plugin::GlobalSettingsWidgetPrivate::properties
rviz::PropertyTreeModel * properties
Definition: task_panel_p.h:134
rviz::BoolProperty::getBool
virtual bool getBool() const
rviz::Panel::configChanged
void configChanged()
rviz::EnumProperty::getOptionInt
virtual int getOptionInt()
moveit_rviz_plugin::GlobalSettingsWidget::d_ptr
GlobalSettingsWidgetPrivate * d_ptr
Definition: task_panel.h:170
moveit_rviz_plugin::TaskViewPrivate::q_ptr
TaskView * q_ptr
Definition: task_panel_p.h:123
moveit_rviz_plugin::TaskView::initial_task_expand
rviz::EnumProperty * initial_task_expand
Definition: task_panel.h:128
moveit_rviz_plugin::TaskView::TaskView
TaskView(TaskPanel *parent, rviz::Property *root)
Definition: task_panel.cpp:332
moveit_rviz_plugin::TaskPanelPrivate::window_manager_
rviz::WindowManagerInterface * window_manager_
Definition: task_panel_p.h:99
moveit_rviz_plugin::TaskViewPrivate::locked_display_
QPointer< TaskDisplay > locked_display_
Definition: task_panel_p.h:124
rviz::VisualizationManager::getWindowManager
WindowManagerInterface * getWindowManager() const override
moveit_rviz_plugin::TaskView::save
void save(rviz::Config config) override
Definition: task_panel.cpp:383
moveit_rviz_plugin::utils::TreeMergeProxyModel::setMimeTypes
void setMimeTypes(const QStringList &mime_types)
Definition: tree_merge_proxy_model.cpp:408
display_group.h
ROS_ERROR_STREAM
#define ROS_ERROR_STREAM(args)
moveit_rviz_plugin::TaskPanel::~TaskPanel
~TaskPanel() override
Definition: task_panel.cpp:149
moveit_rviz_plugin::getStageFactory
StageFactoryPtr getStageFactory()
Definition: task_list_model.cpp:135
moveit_rviz_plugin::GlobalSettingsWidget
Definition: task_panel.h:166
moveit_rviz_plugin::TaskView::removeSelectedStages
void removeSelectedStages()
Definition: task_panel.cpp:464
moveit_rviz_plugin::setExpanded
void setExpanded(QTreeView *view, const QModelIndex &index, bool expand, int depth=-1)
Definition: task_panel.cpp:243
moveit_rviz_plugin::TaskViewPrivate
Definition: task_panel_p.h:102
moveit_rviz_plugin::GlobalSettingsWidget::load
void load(const rviz::Config &config) override
Definition: task_panel.cpp:613
moveit_rviz_plugin::TaskView::EXPAND_NONE
@ EXPAND_NONE
Definition: task_panel.h:125
rviz::PropertyTreeModel
moveit_rviz_plugin::TaskPanelPrivate::TaskPanelPrivate
TaskPanelPrivate(TaskPanel *q_ptr)
Definition: task_panel.cpp:207
actionlib::SimpleActionClient::waitForServer
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
task_panel_p.h
rviz::BoolProperty
moveit_rviz_plugin::TaskView::oldTaskHandlingChanged
void oldTaskHandlingChanged(int old_task_handling)
rviz::PanelDockWidget
rows
int rows
moveit_rviz_plugin::TaskView::d_ptr
TaskViewPrivate * d_ptr
Definition: task_panel.h:117
moveit_rviz_plugin::TaskViewPrivate::lock
void lock(TaskDisplay *display)
unlock locked_display_ if given display is different
Definition: task_panel.cpp:324
moveit_rviz_plugin::TaskView::~TaskView
~TaskView() override
Definition: task_panel.cpp:379
moveit_rviz_plugin::TaskView::show_time_column
rviz::BoolProperty * show_time_column
Definition: task_panel.h:130
moveit_rviz_plugin::GlobalSettingsWidgetPrivate::GlobalSettingsWidgetPrivate
GlobalSettingsWidgetPrivate(GlobalSettingsWidget *q_ptr, rviz::Property *root)
Definition: task_panel.cpp:590
moveit_rviz_plugin::TaskPanel::showStageDockWidget
void showStageDockWidget()
Definition: task_panel.cpp:236
enum_property.h
moveit_rviz_plugin::SubPanel
Base class for all sub panels within the Task Panel.
Definition: task_panel.h:61
moveit_rviz_plugin::DISPLAY_COUNT
static uint DISPLAY_COUNT
Definition: task_panel.cpp:116
factory_model.h
moveit_rviz_plugin::GlobalSettingsWidget::~GlobalSettingsWidget
~GlobalSettingsWidget() override
Definition: task_panel.cpp:605
moveit_rviz_plugin::TaskViewPrivate::exec_action_client_
actionlib::SimpleActionClient< moveit_task_constructor_msgs::ExecuteTaskSolutionAction > exec_action_client_
Definition: task_panel_p.h:125
ok
ROSCPP_DECL bool ok()
moveit_rviz_plugin::TaskViewPrivate::getTaskModel
std::pair< BaseTaskModel *, QModelIndex > getTaskModel(const QModelIndex &index) const
retrieve TaskModel corresponding to given index
Definition: task_panel.cpp:285
visualization_manager.h
moveit_rviz_plugin::TaskViewPrivate::configureExistingModels
void configureExistingModels()
configure all TaskListModels that were already created when TaskView gets instantiated
Definition: task_panel.cpp:295
moveit_rviz_plugin::TaskDisplay
Definition: task_display.h:72
moveit_rviz_plugin::TaskView::onOldTaskHandlingChanged
void onOldTaskHandlingChanged()
Definition: task_panel.cpp:586
rviz::EnumProperty
rviz::Property
console.h
moveit_rviz_plugin::TaskListModel::createLocalTaskModel
BaseTaskModel * createLocalTaskModel()
create a new LocalTaskModel
Definition: task_list_model.cpp:317
moveit_rviz_plugin::TaskPanel::save
void save(rviz::Config config) const override
Definition: task_panel.cpp:220
moveit_rviz_plugin::MetaTaskListModel::getTaskListModel
std::pair< TaskListModel *, TaskDisplay * > getTaskListModel(const QModelIndex &index) const
retrieve TaskListModel and TaskDisplay corresponding to given index
Definition: meta_task_list_model.cpp:130
moveit_rviz_plugin::TaskListModel
Definition: task_list_model.h:120
moveit_rviz_plugin::MetaTaskListModel::getTaskModel
std::pair< BaseTaskModel *, QModelIndex > getTaskModel(const QModelIndex &index) const
retrieve TaskModel and its source index corresponding to given proxy index
Definition: meta_task_list_model.cpp:139
moveit_rviz_plugin::TaskViewPrivate::configureTaskListModel
void configureTaskListModel(TaskListModel *model)
configure a (new) TaskListModel
Definition: task_panel.cpp:290
moveit_rviz_plugin::TaskPanel::load
void load(const rviz::Config &config) override
Definition: task_panel.cpp:228
moveit_rviz_plugin::getStageDockWidget
rviz::PanelDockWidget * getStageDockWidget(rviz::WindowManagerInterface *mgr)
Definition: task_panel.cpp:96
moveit_rviz_plugin::MetaTaskListModel
Definition: meta_task_list_model.h:90
window_manager_interface.h
rviz
c
c
actionlib::SimpleActionClient::sendGoal
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
moveit_rviz_plugin::StageFactoryPtr
std::shared_ptr< StageFactory > StageFactoryPtr
Definition: task_list_model.h:66
moveit_rviz_plugin::TaskView::onExecCurrentSolution
void onExecCurrentSolution() const
Definition: task_panel.cpp:558
moveit_rviz_plugin::TaskView::load
void load(const rviz::Config &config) override
Definition: task_panel.cpp:410
rviz::PropertyTreeModel::configChanged
void configChanged()
visualization_frame.h
moveit_rviz_plugin::SubPanel::load
virtual void load(const rviz::Config &)
Definition: task_panel.h:68
ROS_ERROR
#define ROS_ERROR(...)
moveit_rviz_plugin::SubPanel::save
virtual void save(rviz::Config)
Definition: task_panel.h:67
stage.h
moveit_rviz_plugin::TaskViewPrivate::configureInsertedModels
void configureInsertedModels(const QModelIndex &parent, int first, int last)
configure newly inserted models
Definition: task_panel.cpp:301
value
float value
task_display.h
d
d
moveit_rviz_plugin::TaskPanel
Definition: task_panel.h:76
moveit_rviz_plugin::GlobalSettingsWidget::GlobalSettingsWidget
GlobalSettingsWidget(TaskPanel *parent, rviz::Property *root)
Definition: task_panel.cpp:597
rviz::PropertyTreeModel::getRoot
Property * getRoot() const
moveit_rviz_plugin::TaskView::onCurrentSolutionChanged
void onCurrentSolutionChanged(const QModelIndex &current, const QModelIndex &previous)
Definition: task_panel.cpp:512
pluginlib_factory.h
moveit_rviz_plugin::TaskPanel::release
static void release()
Definition: task_panel.cpp:201
moveit_rviz_plugin::GlobalSettingsWidget::save
void save(rviz::Config config) override
Definition: task_panel.cpp:609
rviz::Config::Value
Value
moveit_rviz_plugin::TaskListModel::insertModel
bool insertModel(BaseTaskModel *model, int pos=-1)
insert a TaskModel, pos is relative to modelCount()
Definition: task_list_model.cpp:309
moveit_rviz_plugin::utils::FlatMergeProxyModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: flat_merge_proxy_model.cpp:313
moveit_rviz_plugin
task_solution_visualization.h
moveit_rviz_plugin::TaskView
Definition: task_panel.h:113
moveit_rviz_plugin::TaskView::onShowTimeChanged
void onShowTimeChanged()
Definition: task_panel.cpp:578
meta_task_list_model.h
m
m
moveit_rviz_plugin::TaskView::EXPAND_TOP
@ EXPAND_TOP
Definition: task_panel.h:123
rviz::Config::getType
Type getType() const
local_task_model.h
moveit_rviz_plugin::GlobalSettingsWidgetPrivate
Definition: task_panel_p.h:128
rviz::Panel::load
virtual void load(const Config &config)
moveit_rviz_plugin::TaskView::old_task_handling
rviz::EnumProperty * old_task_handling
Definition: task_panel.h:129
rviz::WindowManagerInterface::addPane
virtual PanelDockWidget * addPane(const QString &name, QWidget *pane, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=false)=0
property.h
moveit_rviz_plugin::MetaTaskListModel::instance
static MetaTaskListModel & instance()
Definition: meta_task_list_model.cpp:79
rviz::Panel::save
virtual void save(Config config) const
moveit_rviz_plugin::utils::TreeMergeProxyModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: tree_merge_proxy_model.cpp:302
rviz::VisualizationFrame
index
unsigned int index
moveit_rviz_plugin::utils::TreeMergeProxyModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: tree_merge_proxy_model.cpp:326
moveit_rviz_plugin::TaskViewPrivate::getTaskListModel
std::pair< TaskListModel *, TaskDisplay * > getTaskListModel(const QModelIndex &index) const
retrieve TaskListModel corresponding to given index
Definition: task_panel.cpp:280
rviz::Property::changed
void changed()
rviz::Property::save
virtual void save(Config config) const
moveit_rviz_plugin::TaskPanel::d_ptr
TaskPanelPrivate * d_ptr
Definition: task_panel.h:80
moveit_rviz_plugin::TaskPanel::addSubPanel
void addSubPanel(SubPanel *w, const QString &title, const QIcon &icon)
add a new sub panel widget
Definition: task_panel.cpp:153
moveit_rviz_plugin::SubPanel::configChanged
void configChanged()
root
root
rviz::WindowManagerInterface
header
const std::string header
ros::Duration
panel_dock_widget.h
config
config
rviz::Property::load
virtual void load(const Config &config)
moveit_rviz_plugin::TaskPanel::onInitialize
void onInitialize() override
Definition: task_panel.cpp:216
rviz::VisualizationFrame::addPanelByName
QDockWidget * addPanelByName(const QString &name, const QString &class_lookup_name, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=false)
moveit_rviz_plugin::TaskPanel::TaskPanel
TaskPanel(QWidget *parent=nullptr)
Definition: task_panel.cpp:118
moveit_rviz_plugin::TaskView::onSolutionSelectionChanged
void onSolutionSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition: task_panel.cpp:535
moveit_rviz_plugin::SINGLETON
static QPointer< TaskPanel > SINGLETON
Definition: task_panel.cpp:114
rviz::Config::setValue
void setValue(const QVariant &value)
rviz::Config
moveit_rviz_plugin::TaskView::addTask
void addTask()
Definition: task_panel.cpp:447
moveit_rviz_plugin::TaskListModel::setOldTaskHandling
void setOldTaskHandling(int mode)
Definition: task_list_model.cpp:206
moveit_rviz_plugin::TaskView::onCurrentStageChanged
void onCurrentStageChanged(const QModelIndex &current, const QModelIndex &previous)
Definition: task_panel.cpp:470
rviz::Config::getValue
QVariant getValue() const
moveit_rviz_plugin::TaskViewPrivate::TaskViewPrivate
TaskViewPrivate(TaskView *q_ptr)
Definition: task_panel.cpp:256
display_solution.h
moveit_rviz_plugin::TaskPanel::request
static void request(rviz::WindowManagerInterface *window_manager)
Definition: task_panel.cpp:188
group
group
rviz::Panel::vis_manager_
VisualizationManager * vis_manager_


visualization
Author(s): Robert Haschke
autogenerated on Thu Feb 27 2025 03:39:51