8 qRegisterMetaType<QMessageBox::Icon>();
13 const QMessageBox::Icon icon)
15 const bool old_state(isEnabled());
18 msg_box.setWindowTitle(title);
19 msg_box.setText(text);
20 msg_box.setInformativeText(info);
21 msg_box.setIcon(icon);
22 msg_box.setStandardButtons(QMessageBox::Ok);
24 setEnabled(old_state);
30 setObjectName(
"MyRvizPanel");
33 QVBoxLayout* layout =
new QVBoxLayout();
37 button_ =
new QPushButton(
"Click me!");
39 layout->addWidget(
new QLabel(
"Value:"));
46 connect(
button_, &QPushButton::released,
this, [=]
71 "Call to service failed!",
73 QMessageBox::Icon::Critical);
76 else if (!
srv_.response.return_status)
79 "Service responded with an error:",
80 QString::fromStdString(
srv_.response.return_message),
81 QMessageBox::Icon::Warning);
87 QString::fromStdString(
srv_.response.return_message),
88 QMessageBox::Icon::Information);
113 <<
" connected to the service " << client.
getService());
virtual void load(const rviz::Config &config)
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
virtual void callService()
virtual QString getName() const
ros::ServiceClient service_
void connectToService(ros::ServiceClient &client)
bool call(MReq &req, MRes &res)
virtual void save(Config config) const
void mapSetValue(const QString &key, QVariant value)
void displayMessageBox(const QString, const QString, const QString, const QMessageBox::Icon)
virtual void setName(const QString &name)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
virtual void save(rviz::Config config) const
MyRvizPanel(QWidget *parent=0)
simple_node::GetMessage srv_
#define ROS_INFO_STREAM(args)
virtual void load(const Config &config)
bool mapGetInt(const QString &key, int *value_out) const
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)