37 #include <QVBoxLayout> 38 #include <QHBoxLayout> 39 #include <QMessageBox> 40 #include <QFormLayout> 52 : QWidget(parent), config_data_(config_data)
55 QVBoxLayout* layout =
new QVBoxLayout();
57 QGroupBox* group1 =
new QGroupBox(
"Kinematics");
58 QGroupBox* group2 =
new QGroupBox(
"OMPL Planning");
62 QFont group_title_font(QFont().defaultFamily(), 12, QFont::Bold);
63 title_->setFont(group_title_font);
67 QFormLayout* form_layout =
new QFormLayout();
68 form_layout->setContentsMargins(0, 12, 0, 12);
96 group1->setLayout(form_layout);
100 QFormLayout* form_layout2 =
new QFormLayout();
101 form_layout2->setContentsMargins(0, 12, 0, 12);
109 group2->setLayout(form_layout2);
111 layout->addWidget(group1);
112 layout->addWidget(group2);
114 layout->setAlignment(Qt::AlignTop);
119 QVBoxLayout* new_buttons_layout_container =
new QVBoxLayout();
120 QHBoxLayout* label_layout =
new QHBoxLayout();
121 QHBoxLayout* recommended_options =
new QHBoxLayout();
122 QHBoxLayout* advanced_options =
new QHBoxLayout();
124 QLabel* save_and_add =
new QLabel(
"Next, Add Components To Group:",
this);
125 QFont save_and_add_font(QFont().defaultFamily(), 12, QFont::Bold);
126 save_and_add->setFont(save_and_add_font);
127 label_layout->addWidget(save_and_add);
130 QLabel* add_subtitle =
new QLabel(
"Recommended: ",
this);
131 QFont add_subtitle_font(QFont().defaultFamily(), 10, QFont::Bold);
132 add_subtitle->setFont(add_subtitle_font);
133 recommended_options->addWidget(add_subtitle, 0, Qt::AlignLeft);
136 QPushButton* btn_save_joints =
new QPushButton(
"Add Joints",
this);
137 btn_save_joints->setMaximumWidth(200);
138 connect(btn_save_joints, SIGNAL(clicked()),
this, SIGNAL(
saveJoints()));
139 recommended_options->addWidget(btn_save_joints);
142 QLabel* add_subtitle2 =
new QLabel(
"Advanced Options:",
this);
143 add_subtitle2->setFont(add_subtitle_font);
144 advanced_options->addWidget(add_subtitle2, 0, Qt::AlignLeft);
147 QPushButton* btn_save_links =
new QPushButton(
"Add Links",
this);
148 btn_save_links->setMaximumWidth(200);
149 connect(btn_save_links, SIGNAL(clicked()),
this, SIGNAL(
saveLinks()));
150 advanced_options->addWidget(btn_save_links);
153 QPushButton* btn_save_chain =
new QPushButton(
"Add Kin. Chain",
this);
154 btn_save_chain->setMaximumWidth(200);
155 connect(btn_save_chain, SIGNAL(clicked()),
this, SIGNAL(
saveChain()));
156 advanced_options->addWidget(btn_save_chain);
159 QPushButton* btn_save_subgroups =
new QPushButton(
"Add Subgroups",
this);
160 btn_save_subgroups->setMaximumWidth(200);
161 connect(btn_save_subgroups, SIGNAL(clicked()),
this, SIGNAL(
saveSubgroups()));
162 advanced_options->addWidget(btn_save_subgroups);
165 new_buttons_layout_container->addLayout(label_layout);
166 new_buttons_layout_container->addLayout(recommended_options);
167 new_buttons_layout_container->addLayout(advanced_options);
174 QWidget* vspacer =
new QWidget(
this);
175 vspacer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
176 layout->addWidget(vspacer);
179 QHBoxLayout* controls_layout =
new QHBoxLayout();
182 btn_delete_ =
new QPushButton(
"&Delete Group",
this);
186 controls_layout->setAlignment(
btn_delete_, Qt::AlignRight);
189 QWidget* spacer =
new QWidget(
this);
190 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
191 controls_layout->addWidget(spacer);
194 btn_save_ =
new QPushButton(
"&Save",
this);
198 controls_layout->setAlignment(
btn_save_, Qt::AlignRight);
201 QPushButton* btn_cancel =
new QPushButton(
"&Cancel",
this);
202 btn_cancel->setMaximumWidth(200);
203 connect(btn_cancel, SIGNAL(clicked()),
this, SIGNAL(
cancelEditing()));
204 controls_layout->addWidget(btn_cancel);
205 controls_layout->setAlignment(btn_cancel, Qt::AlignRight);
208 layout->addLayout(controls_layout);
211 this->setLayout(layout);
224 double* resolution = &
config_data_->group_meta_data_[group_name].kinematics_solver_search_resolution_;
225 if (*resolution == 0)
233 double* timeout = &
config_data_->group_meta_data_[group_name].kinematics_solver_timeout_;
242 int* attempts = &
config_data_->group_meta_data_[group_name].kinematics_solver_attempts_;
251 std::string kin_solver =
config_data_->group_meta_data_[group_name].kinematics_solver_;
254 if (kin_solver.empty())
263 QMessageBox::warning(
this,
"Missing Kinematic Solvers",
264 QString(
"Unable to find the kinematic solver '")
265 .
append(kin_solver.c_str())
266 .
append(
"'. Trying running rosmake for this package. Until fixed, this setting will be " 267 "lost the next time the MoveIt! configuration files are generated"));
276 std::string default_planner =
config_data_->group_meta_data_[group_name].default_planner_;
279 if (default_planner.empty())
281 default_planner =
"None";
287 QMessageBox::warning(
this,
"Missing Default Planner",
288 QString(
"Unable to find the default planner '%1'").arg(default_planner.c_str()));
302 static bool hasLoaded =
false;
316 std::unique_ptr<pluginlib::ClassLoader<kinematics::KinematicsBase>> loader;
323 QMessageBox::warning(
this,
"Missing Kinematic Solvers",
"Exception while creating class loader for kinematic " 330 const std::vector<std::string>& classes = loader->getDeclaredClasses();
335 QMessageBox::warning(
this,
"Missing Kinematic Solvers",
"No MoveIt!-compatible kinematics solvers found. Try " 336 "installing moveit_kinematics (sudo apt-get install " 337 "ros-${ROS_DISTRO}-moveit-kinematics)");
342 for (std::vector<std::string>::const_iterator plugin_it = classes.begin(); plugin_it != classes.end(); ++plugin_it)
347 std::vector<OMPLPlannerDescription> planners =
config_data_->getOMPLPlanners();
348 for (std::size_t i = 0; i < planners.size(); ++i)
350 std::string planner_name = planners[i].name_;
static const int DEFAULT_KIN_SOLVER_ATTEMPTS_
static const double DEFAULT_KIN_SOLVER_TIMEOUT_
static const double DEFAULT_KIN_SOLVER_SEARCH_RESOLUTION_
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
#define ROS_ERROR_STREAM(args)