6 #include <QSignalMapper> 11 EmptyServiceCallInterfaceAction::EmptyServiceCallInterfaceAction( QWidget* parent )
16 QHBoxLayout*
h_layout =
new QHBoxLayout;
17 h_layout->setAlignment(Qt::AlignLeft);
18 layout =
new QVBoxLayout();
23 QToolButton* tbutton =
new QToolButton(
this);
24 tbutton->setText(target_button.
text.c_str());
25 tbutton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
26 tbutton->setIconSize(QSize(100, 100));
27 tbutton->setIcon(QIcon(QPixmap(QString(target_button.
icon_file_path.c_str()))));
28 connect(tbutton, SIGNAL(clicked()),
signal_mapper, SLOT(map()));
30 h_layout->addWidget(tbutton);
34 layout->addLayout(h_layout);
42 std::string icon_package_name;
43 nh.
param<std::string>(
"icon_include_package", icon_package_name, std::string(
"jsk_rviz_plugins"));
44 ROS_INFO(
"Find Icons In %s package.", icon_package_name.c_str());
46 std::string icon_path_prefix;
47 if(!icon_package_name.empty())
51 nh.
getParam(
"rviz_service_call/buttons", buttons_list);
52 for (int32_t i = 0; i < buttons_list.
size(); ++i)
55 new_button.
icon_file_path = icon_path_prefix +
static_cast<std::string
>(buttons_list[i][
"icon"]);
56 new_button.
service_name =
static_cast<std::string
>(buttons_list[i][
"service_name"]);
57 new_button.
text =
static_cast<std::string
>(buttons_list[i][
"text"]);
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
virtual void load(const rviz::Config &config)
PLUGINLIB_EXPORT_CLASS(jsk_rviz_plugins::PictogramArrayDisplay, rviz::Display)
bool call(MReq &req, MRes &res)
void parseROSParameters()
virtual void save(Config config) const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
bool getParam(const std::string &key, std::string &s) const
ROSLIB_DECL std::string getPath(const std::string &package_name)
QSignalMapper * signal_mapper
virtual void save(rviz::Config config) const
virtual void load(const Config &config)
std::vector< ServiceCallButtonInfo > service_call_button_infos_
void callRequestEmptyCommand(int button_id)