kinematic_chain_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 #include <QWidget>
40 class QLabel;
41 class QLineEdit;
42 class QTreeWidget;
43 class QTreeWidgetItem;
44 
45 #ifndef Q_MOC_RUN
47 #endif
48 
49 namespace moveit_setup_assistant
50 {
51 class KinematicChainWidget : public QWidget
52 {
53  Q_OBJECT
54 
55  // ******************************************************************************************
56  // Reusable double list widget for selecting and deselecting a subset from a set
57  // ******************************************************************************************
58 public:
59  // ******************************************************************************************
60  // Public Functions
61  // ******************************************************************************************
62 
64  KinematicChainWidget(QWidget* parent, const MoveItConfigDataPtr& config_data);
65 
67  void setAvailable();
68 
70  void setSelected(const std::string& base_link, const std::string& tip_link);
71 
73 
74  bool addLinkChildRecursive(QTreeWidgetItem* parent, const moveit::core::LinkModel* link,
75  const std::string& parent_name);
76 
77  // ******************************************************************************************
78  // Qt Components
79  // ******************************************************************************************
80 
81  QLabel* title_; // specify the title from the parent widget
82  QTreeWidget* link_tree_;
83  QLineEdit* base_link_field_;
84  QLineEdit* tip_link_field_;
85 
86 private Q_SLOTS:
87 
88  // ******************************************************************************************
89  // Slot Event Functions
90  // ******************************************************************************************
91 
93  void baseLinkTreeClick();
94 
96  void tipLinkTreeClick();
97 
99  void alterTree(const QString& link);
100 
102  void itemSelected();
103 
104 Q_SIGNALS:
105 
106  // ******************************************************************************************
107  // Emitted Signals
108  // ******************************************************************************************
109 
111  void doneEditing();
112 
114  void cancelEditing();
115 
117  void highlightLink(const std::string& name, const QColor& /*_t2*/);
118 
120  void unhighlightAll();
121 
122 private:
123  // ******************************************************************************************
124  // Variables
125  // ******************************************************************************************
126 
128  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
129 
132 
133  // ******************************************************************************************
134  // Private Functions
135  // ******************************************************************************************
136 };
137 } // namespace moveit_setup_assistant
moveit::core::LinkModel
moveit_setup_assistant::KinematicChainWidget::addLinkChildRecursive
bool addLinkChildRecursive(QTreeWidgetItem *parent, const moveit::core::LinkModel *link, const std::string &parent_name)
Definition: kinematic_chain_widget.cpp:225
moveit_setup_assistant::KinematicChainWidget::itemSelected
void itemSelected()
Highlight the selected link in the kinematic chain.
Definition: kinematic_chain_widget.cpp:297
moveit_setup_assistant::KinematicChainWidget::setAvailable
void setAvailable()
Loads the availble data list.
Definition: kinematic_chain_widget.cpp:173
moveit_setup_assistant::KinematicChainWidget::base_link_field_
QLineEdit * base_link_field_
Definition: kinematic_chain_widget.h:83
moveit_setup_assistant::KinematicChainWidget::cancelEditing
void cancelEditing()
Event sent when user presses cancel button.
moveit_setup_assistant::KinematicChainWidget::unhighlightAll
void unhighlightAll()
Event for telling rviz to unhighlight all links of the robot.
moveit_config_data.h
moveit_setup_assistant::KinematicChainWidget::KinematicChainWidget
KinematicChainWidget(QWidget *parent, const MoveItConfigDataPtr &config_data)
Constructor.
Definition: kinematic_chain_widget.cpp:85
moveit_setup_assistant::KinematicChainWidget::title_
QLabel * title_
Definition: kinematic_chain_widget.h:81
moveit_setup_assistant::KinematicChainWidget::tipLinkTreeClick
void tipLinkTreeClick()
Choose the tip link.
Definition: kinematic_chain_widget.cpp:274
moveit_setup_assistant::KinematicChainWidget::tip_link_field_
QLineEdit * tip_link_field_
Definition: kinematic_chain_widget.h:84
moveit_setup_assistant::KinematicChainWidget::baseLinkTreeClick
void baseLinkTreeClick()
Choose the base link.
Definition: kinematic_chain_widget.cpp:262
moveit_setup_assistant::KinematicChainWidget::addLinktoTreeRecursive
void addLinktoTreeRecursive(const moveit::core::LinkModel *link, const moveit::core::LinkModel *parent)
Definition: kinematic_chain_widget.cpp:194
moveit_setup_assistant::KinematicChainWidget::link_tree_
QTreeWidget * link_tree_
Definition: kinematic_chain_widget.h:82
moveit_setup_assistant::KinematicChainWidget::highlightLink
void highlightLink(const std::string &name, const QColor &)
Event for telling rviz to highlight a link of the robot.
moveit_setup_assistant::KinematicChainWidget::config_data_
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
Definition: kinematic_chain_widget.h:128
moveit_setup_assistant
Definition: compute_default_collisions.h:46
moveit_setup_assistant::KinematicChainWidget::alterTree
void alterTree(const QString &link)
Expand/Collapse Tree.
Definition: kinematic_chain_widget.cpp:286
moveit_setup_assistant::KinematicChainWidget::doneEditing
void doneEditing()
Event sent when this widget is done making data changes and parent widget can save.
moveit_setup_assistant::KinematicChainWidget::setSelected
void setSelected(const std::string &base_link, const std::string &tip_link)
Set the link field with previous value.
Definition: kinematic_chain_widget.cpp:253
moveit_setup_assistant::KinematicChainWidget
Definition: kinematic_chain_widget.h:51
moveit_setup_assistant::KinematicChainWidget::kinematic_chain_loaded_
bool kinematic_chain_loaded_
Remember if the chain tree has been loaded.
Definition: kinematic_chain_widget.h:131


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