8 setObjectName(
"Entry, exit strategies");
25 QGridLayout* entry_layout =
new QGridLayout;
26 entry_layout->addWidget(
new QLabel(
"Number of poses:"), 0, 0);
28 entry_layout->addWidget(
new QLabel(
"Angle:"));
30 entry_layout->addWidget(
new QLabel(
"Distance:"));
49 QGridLayout* exit_layout =
new QGridLayout;
50 exit_layout->addWidget(
new QLabel(
"Number of poses:"), 0, 0);
52 exit_layout->addWidget(
new QLabel(
"Angle:"));
54 exit_layout->addWidget(
new QLabel(
"Distance:"));
58 QVBoxLayout *scroll_widget_layout =
new QVBoxLayout();
59 QWidget *scroll_widget =
new QWidget;
60 scroll_widget->setLayout(scroll_widget_layout);
61 QScrollArea *scroll_area =
new QScrollArea;
62 scroll_area->setWidget(scroll_widget);
63 scroll_area->setWidgetResizable(
true);
64 scroll_area->setFrameShape(QFrame::NoFrame);
66 QVBoxLayout* main_layout =
new QVBoxLayout(
this);
67 main_layout->addWidget(scroll_area);
68 scroll_widget_layout->addWidget(
new QLabel(
"<b>Entry strategy</b>"));
69 scroll_widget_layout->addLayout(entry_layout);
70 scroll_widget_layout->addStretch(1);
71 scroll_widget_layout->addWidget(
new QLabel(
"<b>Exit strategy</b>"));
72 scroll_widget_layout->addLayout(exit_layout);
73 scroll_widget_layout->addStretch(1);
75 scroll_widget_layout->addStretch(1);
118 Q_EMIT setEnabled(
false);
125 "RViz panel " <<
getName().toStdString() <<
" connected to the service " << client.
getService());
131 "RViz panel " <<
getName().toStdString() <<
" could not connect to ROS service: " << client.
getService());
139 Q_EMIT setEnabled(
false);
145 Q_EMIT setEnabled(
true);
149 const QString message,
150 const QString info_msg)
152 bool old_state(isEnabled());
153 Q_EMIT setEnabled(
false);
155 msg_box.setWindowTitle(title);
156 msg_box.setText(message);
157 msg_box.setInformativeText(info_msg);
158 msg_box.setIcon(QMessageBox::Critical);
159 msg_box.setStandardButtons(QMessageBox::Ok);
161 Q_EMIT setEnabled(old_state);
166 Q_EMIT setEnabled(
false);
176 Q_EMIT setEnabled(
true);
189 Q_EMIT setEnabled(
true);
193 Q_EMIT setEnabled(
true);
199 float tmp_float(0.01);
202 if (config.
mapGetInt(
"entry_number_of_poses", &tmp_int))
212 if (config.
mapGetFloat(
"entry_distance", &tmp_float))
217 if (config.
mapGetInt(
"exit_number_of_poses", &tmp_int))
227 if (config.
mapGetFloat(
"exit_distance", &tmp_float))
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
QDoubleSpinBox * exit_angle_
QDoubleSpinBox * entry_distance_
ram_utils::EntryExitParameters exit_parameters_
bool call(MReq &req, MRes &res)
bool mapGetFloat(const QString &key, float *value_out) const
EntryExitStrategies(QWidget *parent=NULL)
void connectToService(ros::ServiceClient &client)
void mapSetValue(const QString &key, QVariant value)
void load(const rviz::Config &config)
QPushButton * entry_exit_button_
virtual void setName(const QString &name)
ros::ServiceClient exit_parameters_client_
void sendEntryExitParameters()
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
QSpinBox * exit_number_of_poses_
QDoubleSpinBox * entry_angle_
virtual QString getName() const
virtual ~EntryExitStrategies()
bool mapGetInt(const QString &key, int *value_out) const
ram_utils::EntryExitParameters entry_parameters_
void save(rviz::Config config) const
void displayErrorBoxHandler(const QString title, const QString message, const QString info_msg)
#define ROS_INFO_STREAM(args)
QDoubleSpinBox * exit_distance_
virtual void save(Config config) const
#define ROS_ERROR_STREAM(args)
virtual void load(const Config &config)
QSpinBox * entry_number_of_poses_
void updateInternalParameters()
ros::ServiceClient entry_parameters_client_
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void displayErrorMessageBox(const QString, const QString, const QString)