36 #include <QVBoxLayout> 37 #include <QHBoxLayout> 38 #include <QMessageBox> 39 #include <QFormLayout> 50 : QWidget(parent), config_data_(config_data)
53 QVBoxLayout* layout =
new QVBoxLayout();
55 QGroupBox* controller_options_group =
new QGroupBox(
"Controller Options");
59 QFont group_title_font(QFont().defaultFamily(), 12, QFont::Bold);
60 title_->setFont(group_title_font);
63 QFormLayout* form_layout =
new QFormLayout();
64 form_layout->setContentsMargins(0, 15, 0, 15);
77 controller_options_group->setLayout(form_layout);
79 layout->addWidget(controller_options_group);
81 layout->setAlignment(Qt::AlignTop);
85 QVBoxLayout* new_buttons_layout =
new QVBoxLayout();
87 QLabel* save_and_add =
new QLabel(
"Next, Add Components To Controller:",
this);
88 QFont save_and_add_font(QFont().defaultFamily(), 12, QFont::Bold);
89 save_and_add->setFont(save_and_add_font);
90 new_buttons_layout->addWidget(save_and_add);
92 QLabel* add_subtitle =
new QLabel(
"Recommended: ",
this);
93 QFont add_subtitle_font(QFont().defaultFamily(), 10, QFont::Bold);
94 add_subtitle->setFont(add_subtitle_font);
95 new_buttons_layout->addWidget(add_subtitle);
98 QPushButton* btn_save_groups_joints =
new QPushButton(
"Add Planning Group Joints",
this);
99 btn_save_groups_joints->setMaximumWidth(200);
100 connect(btn_save_groups_joints, SIGNAL(clicked()),
this, SIGNAL(
saveJointsGroups()));
101 new_buttons_layout->addWidget(btn_save_groups_joints);
103 QLabel* add_subtitle2 =
new QLabel(
"Advanced Options:",
this);
104 add_subtitle2->setFont(add_subtitle_font);
105 new_buttons_layout->addWidget(add_subtitle2);
108 QPushButton* btn_save_joints =
new QPushButton(
"Add Individual Joints",
this);
109 btn_save_joints->setMaximumWidth(200);
110 connect(btn_save_joints, SIGNAL(clicked()),
this, SIGNAL(
saveJoints()));
111 new_buttons_layout->addWidget(btn_save_joints);
118 QWidget* vspacer =
new QWidget(
this);
119 vspacer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
120 layout->addWidget(vspacer);
123 QHBoxLayout* controls_layout =
new QHBoxLayout();
126 btn_delete_ =
new QPushButton(
"&Delete Controller",
this);
130 controls_layout->setAlignment(
btn_delete_, Qt::AlignRight);
133 QWidget* spacer =
new QWidget(
this);
134 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
135 controls_layout->addWidget(spacer);
138 btn_save_ =
new QPushButton(
"&Save",
this);
142 controls_layout->setAlignment(
btn_save_, Qt::AlignRight);
145 QPushButton* btn_cancel =
new QPushButton(
"&Cancel",
this);
146 btn_cancel->setMaximumWidth(200);
147 connect(btn_cancel, SIGNAL(clicked()),
this, SIGNAL(
cancelEditing()));
148 controls_layout->addWidget(btn_cancel);
149 controls_layout->setAlignment(btn_cancel, Qt::AlignRight);
152 layout->addLayout(controls_layout);
155 this->setLayout(layout);
166 if (searched_controller !=
NULL)
168 const std::string controller_type = searched_controller->
type_;
172 if (type_index == -1)
174 QMessageBox::warning(
this,
"Missing Controller Type", QString(
"Setting controller type to the default value"));
198 const std::array<std::string, 8> default_types = {
199 "effort_controllers/JointTrajectoryController",
"effort_controllers/JointPositionController",
200 "effort_controllers/JointVelocityController",
"effort_controllers/JointEffortController",
201 "position_controllers/JointPositionController",
"position_controllers/JointTrajectoryController",
202 "velocity_controllers/JointTrajectoryController",
"velocity_controllers/JointVelocityController" 212 for (
const std::string& type : default_types)