WaypointController.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * \package RobotTrajectoryDesigner::gui-plugins::Controller::WaypointController
17 * \author Max Beddies
18 * \date 2018
19 * \copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 #include "WaypointController.h"
23 #include "VirtualRobot/IK/IKSolver.h"
24 
25 namespace armarx
26 {
28  {
29  ARMARX_INFO << "RobotTrajectoryDesigner: WaypointController on init";
30 
31  // Fill cartesian selection combo box with items
32  initCSComboBox();
33  // Add validator to line edits
34  initValidator(-10000.000, 10000.000, 3);
35 
36  // Set single selection and clear waypoint list
37  this->guiWaypointTab->getWaypointTab()->waypointList->
38  setSelectionMode(QAbstractItemView::SingleSelection);
39  this->guiWaypointTab->getWaypointTab()->waypointList->clear();
40  }
41 
43  {
44  ARMARX_INFO << "RobotTrajectoryDesigner: WaypointController on connect";
45 
46  // Waypoint: update selected waypoint
47  QObject::connect(guiWaypointTab->getWaypointTab()->waypointList,
48  SIGNAL(itemClicked(QListWidgetItem*)),
49  this, SLOT(updateSelectedWaypoint(QListWidgetItem*)));
50 
51  // Waypoint: change x-coordinate
52  QObject::connect(guiWaypointTab->getWaypointTab()->xPositionLineEdit,
53  SIGNAL(editingFinished()),
54  this, SLOT(setXCoordinate()));
55 
56  // Waypoint: change y-coordinate
57  QObject::connect(guiWaypointTab->getWaypointTab()->yPositionLineEdit,
58  SIGNAL(editingFinished()),
59  this, SLOT(setYCoordinate()));
60 
61  // Waypoint: change x-coordinate
62  QObject::connect(guiWaypointTab->getWaypointTab()->zPositionLineEdit,
63  SIGNAL(editingFinished()),
64  this, SLOT(setZCoordinate()));
65 
66  // Waypoint: change euler angle roll
67  QObject::connect(guiWaypointTab->getWaypointTab()->eulerRLineEdit,
68  SIGNAL(editingFinished()),
69  this, SLOT(setEulerAngleR()));
70 
71  // Waypoint: change euler angle pitch
72  QObject::connect(guiWaypointTab->getWaypointTab()->eulerPLineEdit,
73  SIGNAL(editingFinished()),
74  this, SLOT(setEulerAngleP()));
75 
76  // Waypoint: change euler angle yaw
77  QObject::connect(guiWaypointTab->getWaypointTab()->eulerYLineEdit,
78  SIGNAL(editingFinished()),
79  this, SLOT(setEulerAngleY()));
80 
81  // Waypoint: change cartesian selection
82  QObject::connect(guiWaypointTab->getWaypointTab()->ikSelectionComboBox,
83  SIGNAL(activated(int)),
84  this, SLOT(setCartesianSelection(int)));
85 
86  // Waypoint: is breakpoint
87  QObject::connect(guiWaypointTab->getWaypointTab()->isBreakpointCheckBox,
88  SIGNAL(clicked(bool)),
89  this, SLOT(setBreakpoint(bool)));
90 
91  // Waypoint: add waypoint
92  QObject::connect(guiWaypointTab->getWaypointTab()->insertButton,
93  SIGNAL(clicked()),
94  this, SLOT(addWaypoint()));
95 
96  // Waypoint: remove waypoint
97  QObject::connect(guiWaypointTab->getWaypointTab()->deleteButton,
98  SIGNAL(clicked()),
99  this, SLOT(removeWaypoint()));
100  }
101 
103  {
104  ARMARX_INFO << "RobotTrajectoryDesigner: WaypointController on disconnect";
105  }
106 
108  {
109  ARMARX_INFO << "RobotTrajectoryDesigner: WaypointController on exit";
110  }
111 
113  guiWaypointTab(guiWaypointTab)
114  {
115  onInitComponent();
117  }
118 
120  {
121  return this->guiWaypointTab;
122  }
123 
125  {
126  if (guiWaypointTab != NULL)
127  {
128  this->guiWaypointTab = guiWaypointTab;
129  }
130  }
131 
132  void WaypointController::addWaypoint(
133  int index,
134  std::vector<double> values,
135  int cartesianSelection,
136  bool isBreakpoint)
137  {
138  if (values.size() == 6)
139  {
140  // Create struct representing waypoint
141  struct GuiWaypoint waypoint;
142  waypoint.values = values;
143  waypoint.cartesianSelection = cartesianSelection;
144  waypoint.isBreakpoint = isBreakpoint;
145 
146  // create qvariant from struct
147  QVariant data;
148  data.setValue(waypoint);
149 
150  // add data to item and insert
151  QListWidgetItem* item = new QListWidgetItem(QString::fromStdString("Waypoint: " + std::to_string(index)));
152  item->setData(Qt::UserRole, data);
153  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
154 
155  waypoints->insertItem(index, item);
157 
158  // Check if waypoint list contains exactly one waypoint
159  if (waypoints->count() == 1)
160  {
161  emit enableIKSolutionButton(false);
162  }
163  }
164  changeTextListWidgetItems();
165  }
166 
167  void WaypointController::removeWaypoint(int index)
168  {
169  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
170 
171  if (waypoints->count() > index)
172  {
173  delete waypoints->takeItem(index);
174 
175  // Check if waypoint list contains no item
176  if (waypoints->count() == 0)
177  {
178  // Enables the button for a new ik solution
179  emit enableIKSolutionButton(true);
180  }
181  }
182  changeTextListWidgetItems();
183  }
184 
185  void WaypointController::updateSelectedWaypoint(QListWidgetItem* item)
186  {
187  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
188 
189  // Update all gui elements
190  updateWaypointElements(waypoint);
191 
192  // Set current row to row of selected item
193  int row = guiWaypointTab->getWaypointTab()->waypointList->row(item);
194  guiWaypointTab->getWaypointTab()->waypointList->setCurrentRow(row);
195 
196  emit setCurrentIndex(row);
198  }
199 
201  {
202  QListWidgetItem* item = guiWaypointTab->getWaypointTab()->waypointList->item(index);
203  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
204 
205  // Update all gui elements
206  updateWaypointElements(waypoint);
207 
208  // Set current row to row of selected item
209  guiWaypointTab->getWaypointTab()->waypointList->setCurrentRow(index);
210 
211  emit setCurrentIndex(index);
212  }
213 
214  void WaypointController::setXCoordinate()
215  {
216  // Check whether input is valid
217  if (guiWaypointTab->getWaypointTab()->xPositionLineEdit->hasAcceptableInput())
218  {
219  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
220  QListWidgetItem* item = waypoints->currentItem();
221 
222  // Check if list widget has any item
223  if (item != NULL)
224  {
225  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
226  double x = guiWaypointTab->getWaypointTab()->
227  xPositionLineEdit->text().toDouble();
228 
229  // Check if x-coordinate of waypoint has changed
230  if ((waypoint.values.size() == 6)
231  && (x != waypoint.values[0]))
232  {
233  std::vector<double> values = waypoint.values;
234  values[0] = x;
235  emit changedWaypoint(waypoints->currentRow(), values);
236  }
237  }
238  }
239  else
240  {
241  (new QErrorMessage(0))->showMessage("Invalid input.");
242  }
243  }
244 
245  void WaypointController::setYCoordinate()
246  {
247  // Check whether input is valid
248  if (guiWaypointTab->getWaypointTab()->yPositionLineEdit->hasAcceptableInput())
249  {
250  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
251  QListWidgetItem* item = waypoints->currentItem();
252 
253  // Check if list widget has any item
254  if (item != NULL)
255  {
256  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
257  double y = guiWaypointTab->getWaypointTab()->
258  yPositionLineEdit->text().toDouble();
259 
260  // Check if x-coordinate of waypoint has changed
261  if ((waypoint.values.size() == 6)
262  && (y != waypoint.values[1]))
263  {
264  std::vector<double> values = waypoint.values;
265  values[1] = y;
266  emit changedWaypoint(waypoints->currentRow(), values);
267  }
268  }
269  }
270  else
271  {
272  (new QErrorMessage(0))->showMessage("Invalid input.");
273  }
274  }
275 
276  void WaypointController::setZCoordinate()
277  {
278  // Check whether input is valid
279  if (guiWaypointTab->getWaypointTab()->zPositionLineEdit->hasAcceptableInput())
280  {
281  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
282  QListWidgetItem* item = waypoints->currentItem();
283 
284  // Check if list widget has any item
285  if (item != NULL)
286  {
287  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
288  double z = guiWaypointTab->getWaypointTab()->
289  xPositionLineEdit->text().toDouble();
290 
291  // Check if x-coordinate of waypoint has changed
292  if ((waypoint.values.size() == 6)
293  && (z != waypoint.values[2]))
294  {
295  std::vector<double> values = waypoint.values;
296  values[2] = z;
297  emit changedWaypoint(waypoints->currentRow(), values);
298  }
299  }
300  }
301  else
302  {
303  (new QErrorMessage(0))->showMessage("Invalid Input.");
304  }
305  }
306 
307  void WaypointController::setEulerAngleR()
308  {
309  // Check whether input is valid
310  if (guiWaypointTab->getWaypointTab()->eulerRLineEdit->hasAcceptableInput())
311  {
312  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
313  QListWidgetItem* item = waypoints->currentItem();
314 
315  // Check if list widget has any item
316  if (item != NULL)
317  {
318  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
319  double r = guiWaypointTab->getWaypointTab()->
320  eulerRLineEdit->text().toDouble();
321 
322  // Check if x-coordinate of waypoint has changed
323  if ((waypoint.values.size() == 6)
324  && (r != waypoint.values[3]))
325  {
326  std::vector<double> values = waypoint.values;
327  values[3] = r;
328  emit changedWaypoint(waypoints->currentRow(), values);
329  }
330  }
331  }
332  else
333  {
334  (new QErrorMessage(0))->showMessage("Invalid Input.");
335  }
336  }
337 
338  void WaypointController::setEulerAngleP()
339  {
340  // Check whether input is valid
341  if (guiWaypointTab->getWaypointTab()->eulerPLineEdit->hasAcceptableInput())
342  {
343  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
344  QListWidgetItem* item = waypoints->currentItem();
345 
346  // Check if list widget has any item
347  if (item != NULL)
348  {
349  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
350  double p = guiWaypointTab->getWaypointTab()->
351  eulerPLineEdit->text().toDouble();
352 
353  // Check if x-coordinate of waypoint has changed
354  if ((waypoint.values.size() == 6)
355  && (p != waypoint.values[4]))
356  {
357  std::vector<double> values = waypoint.values;
358  values[4] = p;
359  emit changedWaypoint(waypoints->currentRow(), values);
360  }
361  }
362  }
363  else
364  {
365  (new QErrorMessage(0))->showMessage("Invalid Input.");
366  }
367  }
368 
369  void WaypointController::setEulerAngleY()
370  {
371  // Check whether input is valid
372  if (guiWaypointTab->getWaypointTab()->eulerYLineEdit->hasAcceptableInput())
373  {
374  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
375  QListWidgetItem* item = waypoints->currentItem();
376 
377  // Check if list widget has any item
378  if (item != NULL)
379  {
380  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
381  double y = guiWaypointTab->getWaypointTab()->
382  eulerYLineEdit->text().toDouble();
383 
384  // Check if x-coordinate of waypoint has changed
385  if ((waypoint.values.size() == 6)
386  && (y != waypoint.values[5]))
387  {
388  std::vector<double> values = waypoint.values;
389  values[5] = y;
390  emit changedWaypoint(waypoints->currentRow(), values);
391  }
392  }
393  }
394  else
395  {
396  (new QErrorMessage(0))->showMessage("Invalid Input.");
397  }
398  }
399 
400  void WaypointController::setCartesianSelection(int cs)
401  {
402  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
403  QListWidgetItem* item = waypoints->currentItem();
404 
405  // Check if list widget has any item
406  if (item != NULL)
407  {
408  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
409 
410  // Check if x-coordinate of waypoint has changed
411  int cartesianSelection = guiWaypointTab->getWaypointTab()->
412  ikSelectionComboBox->itemData(cs, Qt::UserRole).toInt();
413  if (cartesianSelection != waypoint.cartesianSelection)
414  {
415  emit changedWaypoint(waypoints->currentRow(), cartesianSelection);
416  }
417  }
418  }
419 
420  void WaypointController::setBreakpoint(bool isBreakpoint)
421  {
422  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
423  QListWidgetItem* item = waypoints->currentItem();
424 
425  // Check if list widget has any item
426  if (item != NULL)
427  {
428  GuiWaypoint waypoint = item->data(Qt::UserRole).value<GuiWaypoint>();
429 
430  // Check if x-coordinate of waypoint has changed
431  if (isBreakpoint != waypoint.isBreakpoint)
432  {
433  emit changedWaypoint(waypoints->currentRow(), isBreakpoint);
434  }
435  }
436  }
437 
439  int index,
440  std::vector<double> values,
441  int cartesianSelection,
442  bool isBreakpoint)
443  {
444  // Create struct holding relevant data
445  struct GuiWaypoint waypoint;
446  waypoint.values = values;
447  waypoint.cartesianSelection = cartesianSelection;
448  waypoint.isBreakpoint = isBreakpoint;
449 
450  if (waypoint.values.size() == 6)
451  {
452  // Create QVariant from struct
453  QVariant data;
454  data.setValue(waypoint);
455 
456  QListWidget* waypoints = guiWaypointTab->getWaypointTab()->waypointList;
457  QListWidgetItem* item = waypoints->item(index);
458 
459  // Update data
460  item->setData(Qt::UserRole, data);
461  // Display updated data
462  if (waypoints->currentRow() == index)
463  {
464  updateWaypointElements(waypoint);
465  }
466  }
467 
468  }
469 
470  void WaypointController::addWaypoint()
471  {
472  if (guiWaypointTab->getWaypointTab()->waypointList->count() == 0)
473  {
474  emit addedWaypoint(guiWaypointTab->getWaypointTab()->waypointList->count(),
475  guiWaypointTab->getWaypointTab()->
476  insertAfterButton->isChecked());
477  }
478  else if (guiWaypointTab->getWaypointTab()->waypointList->currentRow() == -1)
479  {
480  emit addedWaypoint(guiWaypointTab->getWaypointTab()->waypointList->count() - 1,
481  guiWaypointTab->getWaypointTab()->
482  insertAfterButton->isChecked());
483  }
484  else
485  {
486  emit addedWaypoint(guiWaypointTab->getWaypointTab()->
487  waypointList->currentRow(),
488  guiWaypointTab->getWaypointTab()->
489  insertAfterButton->isChecked());
490  }
491  }
492 
493  void WaypointController::removeWaypoint()
494  {
495  QListWidget* waypoints = this->guiWaypointTab->getWaypointTab()->waypointList;
496  if (waypoints->count() > 0)
497  {
498  int index = waypoints->currentRow();
499  emit deletedWaypoint(index);
500  }
501  }
502 
504  {
505  ARMARX_INFO << "not yet implemented";
506  }
507 
509  {
510  // Clear waypoint list
511  this->guiWaypointTab->getWaypointTab()->waypointList->clear();
512  // Clear line edits
513  this->guiWaypointTab->getWaypointTab()->xPositionLineEdit->clear();
514  this->guiWaypointTab->getWaypointTab()->yPositionLineEdit->clear();
515  this->guiWaypointTab->getWaypointTab()->zPositionLineEdit->clear();
516  this->guiWaypointTab->getWaypointTab()->eulerRLineEdit->clear();
517  this->guiWaypointTab->getWaypointTab()->eulerPLineEdit->clear();
518  this->guiWaypointTab->getWaypointTab()->eulerYLineEdit->clear();
519  // Reset cartesian selection to "all"
520  this->guiWaypointTab->getWaypointTab()->ikSelectionComboBox->setCurrentIndex(5);
521  // Uncheck breakpoint check box
522  this->guiWaypointTab->getWaypointTab()->isBreakpointCheckBox->setChecked(false);
523  // Set insert after button as checked
524  this->guiWaypointTab->getWaypointTab()->insertAfterButton->setChecked(true);
525  this->guiWaypointTab->getWaypointTab()->insertBeforeButton->setChecked(false);
526  // Reset current waypoint index
527  emit setCurrentIndex(0);
528  }
529 
531  {
532  guiWaypointTab->getWaypointTab()->deleteButton->setEnabled(enable);
533  guiWaypointTab->getWaypointTab()->ikSelectionComboBox->setEnabled(enable);
534  guiWaypointTab->getWaypointTab()->isBreakpointCheckBox->setEnabled(enable);
535  }
536 
538  {
539  guiWaypointTab->getWaypointTab()->insertButton->setEnabled(enable);
540  guiWaypointTab->getWaypointTab()->insertAfterButton->setEnabled(enable);
541  guiWaypointTab->getWaypointTab()->insertBeforeButton->setEnabled(enable);
542  }
543 
545  {
546  guiWaypointTab->getWaypointTab()->eulerPLineEdit->setEnabled(enable);
547  guiWaypointTab->getWaypointTab()->eulerRLineEdit->setEnabled(enable);
548  guiWaypointTab->getWaypointTab()->eulerYLineEdit->setEnabled(enable);
549  guiWaypointTab->getWaypointTab()->waypointList->setEnabled(enable);
550  guiWaypointTab->getWaypointTab()->xPositionLineEdit->setEnabled(enable);
551  guiWaypointTab->getWaypointTab()->yPositionLineEdit->setEnabled(enable);
552  guiWaypointTab->getWaypointTab()->zPositionLineEdit->setEnabled(enable);
553  }
554 
555  /************************************************************************************/
556  /* Private Functions */
557  /************************************************************************************/
558  void WaypointController::initCSComboBox()
559  {
560  QComboBox* cs = guiWaypointTab->getWaypointTab()->ikSelectionComboBox;
561 
562  // Set strong focus, add wheel event filter
563  cs->setFocusPolicy(Qt::StrongFocus);
564  cs->installEventFilter(new WheelEventFilter(this));
565 
566  // Clear combo box and insert items
567  cs->clear();
568  QVariant xpos(1), ypos(2), zpos(4), position(7), orientation(8), all(15);
569  cs->addItem(QString::fromStdString("X Position"), xpos);
570  cs->addItem(QString::fromStdString("Y Position"), ypos);
571  cs->addItem(QString::fromStdString("Z Position"), zpos);
572  cs->addItem(QString::fromStdString("Position"), position);
573  cs->addItem(QString::fromStdString("Orientation"), orientation);
574  cs->addItem(QString::fromStdString("Position and Orientation"), all);
575  cs->setEnabled(true);
576  cs->setCurrentIndex(5);
577  }
578 
579  void WaypointController::initValidator(double bottom, double top, int decimals)
580  {
581  QDoubleValidator* validator = new QDoubleValidator(bottom,
582  top,
583  decimals,
584  guiWaypointTab.get());
585  validator->setNotation(QDoubleValidator::StandardNotation);
586 
587  this->guiWaypointTab->getWaypointTab()->xPositionLineEdit->
588  setValidator(validator);
589  this->guiWaypointTab->getWaypointTab()->yPositionLineEdit->
590  setValidator(validator);
591  this->guiWaypointTab->getWaypointTab()->zPositionLineEdit->
592  setValidator(validator);
593  this->guiWaypointTab->getWaypointTab()->eulerRLineEdit->setValidator(validator);
594  this->guiWaypointTab->getWaypointTab()->eulerPLineEdit->setValidator(validator);
595  this->guiWaypointTab->getWaypointTab()->eulerYLineEdit->setValidator(validator);
596  }
597 
598  void WaypointController::updateWaypointElements(GuiWaypoint waypoint)
599  {
600  if (waypoint.values.size() == 6)
601  {
602  // x-coordinate line edit
603  guiWaypointTab->getWaypointTab()->xPositionLineEdit->
604  setText(QString::number(waypoint.values[0]));
605  // y-coordinate line edit
606  guiWaypointTab->getWaypointTab()->yPositionLineEdit->
607  setText(QString::number(waypoint.values[1]));
608  // z-coordinate line edit
609  guiWaypointTab->getWaypointTab()->zPositionLineEdit->
610  setText(QString::number(waypoint.values[2]));
611  // roll euler angle line edit
612  guiWaypointTab->getWaypointTab()->eulerRLineEdit->
613  setText(QString::number(waypoint.values[3]));
614  // pitch euler angle line edit
615  guiWaypointTab->getWaypointTab()->eulerPLineEdit->
616  setText(QString::number(waypoint.values[4]));
617  // yaw euler angle line edit
618  guiWaypointTab->getWaypointTab()->eulerYLineEdit->
619  setText(QString::number(waypoint.values[5]));
620  // cartesian selection combo box
621  guiWaypointTab->getWaypointTab()->ikSelectionComboBox->
622  setCurrentIndex(guiWaypointTab->getWaypointTab()->ikSelectionComboBox->
623  findData(QVariant(waypoint.cartesianSelection)));
624  // is breakpoint check box
625  guiWaypointTab->getWaypointTab()->isBreakpointCheckBox->
626  setChecked(waypoint.isBreakpoint);
627  }
628  }
629 
630  void WaypointController::changeTextListWidgetItems()
631  {
632  QListWidget* waypoints = this->guiWaypointTab->getWaypointTab()->waypointList;
633  for (int i = 0; i < waypoints->count(); i++)
634  {
635  waypoints->item(i)->setText(QString::fromStdString(("Waypoint: " + std::to_string(i))));
636  }
637  }
638 }
armarx::WaypointController::enableDeleteButton
void enableDeleteButton(bool enable)
Enables or disables the delete button.
Definition: WaypointController.cpp:530
armarx::GuiWaypoint::cartesianSelection
int cartesianSelection
Definition: WaypointController.h:46
armarx::WaypointController::setCurrentIndexRobotVisualization
void setCurrentIndexRobotVisualization(int index)
Notifies RobotVisualizationController about changes of the current waypoint.
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::WaypointController::retranslateGui
void retranslateGui()
Retranslates the guiWaypointTab.
Definition: WaypointController.cpp:503
WaypointController.h
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::WaypointController::addedWaypoint
void addedWaypoint(int waypoint, bool insertAfter)
Notifies other controllers about the addition of a new waypoint with given constraints.
armarx::WheelEventFilter
Definition: WheelEventFilter.h:31
armarx::GuiWaypoint::isBreakpoint
bool isBreakpoint
Definition: WaypointController.h:47
armarx::WaypointController::onInitComponent
void onInitComponent() override
Definition: WaypointController.cpp:27
armarx::WaypointController::enableWaypointListLineEdit
void enableWaypointListLineEdit(bool enable)
Enables or disables the waypoint list and line edit.
Definition: WaypointController.cpp:544
armarx::WaypointController::changedWaypoint
void changedWaypoint(int waypoint, std::vector< double > values)
Notifies other controllers about changes of the given waypoint.
armarx::WaypointController::enableIKSolutionButton
void enableIKSolutionButton(bool enable)
Notifies other controllers whether to enable or disable the button for a new IK solution.
armarx::WaypointController::WaypointController
WaypointController(WaypointTabPtr guiWaypointTab)
Creates a new WaypointController and assigns a WaypointTab to handle.
Definition: WaypointController.cpp:112
WaypointTabPtr
std::shared_ptr< WaypointTab > WaypointTabPtr
Definition: WaypointTab.h:50
armarx::WaypointController::addWaypoint
void addWaypoint(int index, std::vector< double > values, int cartesianSelection, bool isBreakpoint)
Adds a new waypoint to the list widget.
Definition: WaypointController.cpp:132
armarx::armem::client::query_fns::all
auto all()
Definition: query_fns.h:10
armarx::GuiWaypoint::values
std::vector< double > values
Definition: WaypointController.h:45
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::WaypointController::setWaypointData
void setWaypointData(int index, std::vector< double > values, int cartesianSelection, bool isBreakpoint)
Connected with signals from other controllers, sets all values of the waypoint at a given index.
Definition: WaypointController.cpp:438
armarx::WaypointController::setGuiWaypointTab
void setGuiWaypointTab(WaypointTabPtr guiWaypointTab)
Setter for the WaypointTab pointer to guiWaypointTab.
Definition: WaypointController.cpp:124
armarx::WaypointController::deletedWaypoint
void deletedWaypoint(int waypoint)
Notifies other controllers about the deletion of a given waypoint.
armarx::WaypointController::enableAddButton
void enableAddButton(bool enable)
Enables or disables the add button.
Definition: WaypointController.cpp:537
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
armarx::WaypointController::onExitComponent
void onExitComponent() override
Definition: WaypointController.cpp:107
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::WaypointController::clearWaypointList
void clearWaypointList()
Removes all items of the waypoint list.
Definition: WaypointController.cpp:508
armarx::WaypointController::setCurrentIndex
void setCurrentIndex(int index)
Notifies other controllers about changes of the current waypoint.
armarx::WaypointController::onDisconnectComponent
void onDisconnectComponent() override
Definition: WaypointController.cpp:102
armarx::GuiWaypoint
struct armarx::GuiWaypoint GuiWaypoint
Struct which allows storing relevant data to display within a list widget item as QVariant.
armarx::WaypointController::removeWaypoint
void removeWaypoint(int index)
Removes the waypoint at a given index.
Definition: WaypointController.cpp:167
armarx::GuiWaypoint
Struct which allows storing relevant data to display within a list widget item as QVariant.
Definition: WaypointController.h:43
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::WaypointController::updateSelectedWaypoint
void updateSelectedWaypoint(int index)
Updates the currently selected waypoint.
Definition: WaypointController.cpp:200
armarx::WaypointController::getGuiWaypointTab
WaypointTabPtr getGuiWaypointTab()
Getter for the WaypointTab pointer to guiWaypointTab.
Definition: WaypointController.cpp:119
armarx::WaypointController::onConnectComponent
void onConnectComponent() override
Definition: WaypointController.cpp:42