diff --git a/jsk_rviz_plugins/CMakeLists.txt b/jsk_rviz_plugins/CMakeLists.txt index 2780ad414..0bd3eb7dd 100644 --- a/jsk_rviz_plugins/CMakeLists.txt +++ b/jsk_rviz_plugins/CMakeLists.txt @@ -51,9 +51,6 @@ add_definitions(-DQT_NO_KEYWORDS -g) #include(${wxWidgets_USE_FILE}) #include_directories( ${wxWidgets_INCLUDE_DIRS} ) -qt4_wrap_ui(UIC_FILES - config/robot_command_interface.ui - ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) #set(SOURCE_FILES src/ambient_sound_display.cpp src/ambient_sound_visual.cpp) diff --git a/jsk_rviz_plugins/README.md b/jsk_rviz_plugins/README.md index 68cead371..291e29e0c 100644 --- a/jsk_rviz_plugins/README.md +++ b/jsk_rviz_plugins/README.md @@ -175,6 +175,19 @@ This will publish std_msgs/Empty to the topic you designate. ![RobotCommandInterfaceAction](images/robot_command_interface_action.png) This will call service to /eus_command with jsk_rviz_plugins/EusCommand srv. +All the buttons are configured via `~robot_command_buttons` parameters. +See `robot_command_interface_sample.launch` file to know how to use it. + +Parameter format is: +```yaml +robot_command_buttons: + - name: + icon: + type: <"euscommand" or "emptysrv", required> + command: + srv: + - name: ... +``` #### SelectPointCloudPublishAction ![SelectPointCloudPublishAction](images/select_point_cloud_publish_action.png) diff --git a/jsk_rviz_plugins/config/default_robot_command.yaml b/jsk_rviz_plugins/config/default_robot_command.yaml new file mode 100644 index 000000000..f0b78504f --- /dev/null +++ b/jsk_rviz_plugins/config/default_robot_command.yaml @@ -0,0 +1,56 @@ +robot_command_buttons: + - name: "Reset Pose" + icon: "package://jsk_rviz_plugins/icons/reset-pose.jpg" + type: euscommand + command: "(send *ri* :angle-vector (send *robot* :reset-pose) 5000))" + - name: "Reset Manip Pose" + icon: "package://jsk_rviz_plugins/icons/reset-manip-pose.jpg" + type: euscommand + command: "(send *ri* :angle-vector (send *robot* :reset-manip-pose) 5000)" + - name: "Init Pose" + icon: "package://jsk_rviz_plugins/icons/init-pose.jpg" + type: euscommand + command: "(send *ri* :angle-vector (send *robot* :init-pose) 5000)" + - name: "Hand reset pose" + icon: "package://jsk_rviz_plugins/icons/hand-reset-pose.jpg" + type: euscommand + command: "(progn (send *robot* :hand :arms :reset-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))" + - name: "Hand hook pose" + icon: "package://jsk_rviz_plugins/icons/hand-hook-pose.jpg" + type: euscommand + command: "(progn (send *robot* :hand :arms :hook-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))" + - name: "Hand grasp pose" + icon: "package://jsk_rviz_plugins/icons/hand-grasp-pose.jpg" + type: euscommand + command: "(progn (send *robot* :hand :arms :grasp-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))" + - name: "Start ABC" + icon: "package://jsk_rviz_plugins/icons/start-abc.png" + type: euscommand + command: "(send *ri* :start-auto-balancer)" + - name: "Start ST" + icon: "package://jsk_rviz_plugins/icons/start-st.png" + type: euscommand + command: "(send *ri* :start-st)" + - name: "Start IMP" + icon: "package://jsk_rviz_plugins/icons/start-imp.png" + type: euscommand + command: "(send *ri* :start-impedance :arms :moment-gain #f(0 0 0) :k-p 1000 :d-p 400)" + - name: "Start IMP for Drill" + icon: "package://jsk_rviz_plugins/icons/start-imp-for-drill.png" + type: euscommand + command: "(send *ri* :start-impedance :rarm :force-gain #f(1 0 0) :moment-gain #f(0 0 0) :k-p 600 :d-p 60)" + - name: "Stop ABC" + icon: "package://jsk_rviz_plugins/icons/stop-abc.png" + type: euscommand + command: "(send *ri* :stop-auto-balancer)" + - name: "Stop ST" + icon: "package://jsk_rviz_plugins/icons/stop-st.png" + type: euscommand + command: "(send *ri* :stop-st)" + - name: "Stop IMP" + icon: "package://jsk_rviz_plugins/icons/stop-imp.png" + type: euscommand + command: "(send *ri* :stop-impedance :arms)" + - name: "sample" + type: emptysrv + srv: "/hoge" diff --git a/jsk_rviz_plugins/config/robot_command_interface.ui b/jsk_rviz_plugins/config/robot_command_interface.ui deleted file mode 100644 index a790757f0..000000000 --- a/jsk_rviz_plugins/config/robot_command_interface.ui +++ /dev/null @@ -1,210 +0,0 @@ - - - RobotCommandInterface - - - - 0 - 0 - 100 - 100 - - - - Robot Command Interface - - - - 0 - - - 0 - - - - - - - - Reset Pose - - - - 100 - 100 - - - - - - - - Manip Pose - - - - 100 - 100 - - - - - - - - Init Pose - - - - 100 - 100 - - - - - - - - - Reset Pose - - - - 100 - 100 - - - - - - - - Hook Pose - - - - 100 - 100 - - - - - - - - Grasp Pose - - - - 100 - 100 - - - - - - - - - Start ABC - - - - 100 - 100 - - - - - - - - Start ST - - - - 100 - 100 - - - - - - - - Start IMP - - - - 100 - 100 - - - - - - - - IMP for Drill - - - - 100 - 100 - - - - - - - - Stop ABC - - - - 100 - 100 - - - - - - - - Stop ST - - - - 100 - 100 - - - - - - - - Stop IMP - - - - 100 - 100 - - - - - - - - - - - BagGraphicsView - QGraphicsView - - - - - - diff --git a/jsk_rviz_plugins/launch/robot_command_interface_sample.launch b/jsk_rviz_plugins/launch/robot_command_interface_sample.launch new file mode 100644 index 000000000..7751e9ee7 --- /dev/null +++ b/jsk_rviz_plugins/launch/robot_command_interface_sample.launch @@ -0,0 +1,6 @@ + + + + + diff --git a/jsk_rviz_plugins/src/robot_command_interface.cpp b/jsk_rviz_plugins/src/robot_command_interface.cpp index 0d22acc3a..502dceeac 100644 --- a/jsk_rviz_plugins/src/robot_command_interface.cpp +++ b/jsk_rviz_plugins/src/robot_command_interface.cpp @@ -4,178 +4,160 @@ #include "robot_command_interface.h" #include "ros/time.h" #include +#include +#include +#include -#include "ui_robot_command_interface.h" - -using namespace rviz; namespace jsk_rviz_plugins { + + // Exception class + class RobotCommandParseException: public std::runtime_error + { + public: + RobotCommandParseException(const std::string& text): std::runtime_error(text) {} + }; + RobotCommandInterfaceAction::RobotCommandInterfaceAction( QWidget* parent ) : rviz::Panel( parent ) { - ui_ = new Ui::RobotCommandInterface(); - ui_->setupUi(this); - ui_->verticalLayout->setAlignment(Qt::AlignLeft); - + resource_retriever::Retriever r; + signal_mapper_ = new QSignalMapper(this); ros::NodeHandle nh("~"); - std::string reset_pose_button_icon_name, - reset_manip_pose_button_icon_name, - init_pose_button_icon_name, - hand_reset_pose_button_icon_name, - hand_hook_pose_button_icon_name, - hand_grasp_pose_button_icon_name, - hrpsys_start_abc_button_icon_name, - hrpsys_start_st_button_icon_name, - hrpsys_start_imp_button_icon_name, - hrpsys_start_imp_for_drill_button_icon_name, - hrpsys_stop_abc_button_icon_name, - hrpsys_stop_st_button_icon_name, - hrpsys_stop_imp_button_icon_name; - nh.param("/reset_pose_icon", reset_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/reset-pose.jpg")); - nh.param("/reset_manip_pose_icon", reset_manip_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/reset-manip-pose.jpg")); - nh.param("/init_pose_icon", init_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/init-pose.jpg")); - nh.param("/hand_reset_pose_icon", hand_reset_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/hand-reset-pose.jpg")); - nh.param("/hand_hook_pose_icon", hand_hook_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/hand-hook-pose.jpg")); - nh.param("/hand_grasp_pose_icon", hand_grasp_pose_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/hand-grasp-pose.jpg")); - nh.param("/start_abc_icon", hrpsys_start_abc_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/start-abc.png")); - nh.param("/start_st_icon", hrpsys_start_st_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/start-st.png")); - nh.param("/start_imp_icon", hrpsys_start_imp_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/start-imp.png")); - nh.param("/start_imp_for_drill_icon", hrpsys_start_imp_for_drill_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/start-imp-for-drill.png")); - nh.param("/stop_abc_icon", hrpsys_stop_abc_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/stop-abc.png")); - nh.param("/stop_st_icon", hrpsys_stop_st_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/stop-st.png")); - nh.param("/stop_imp_icon", hrpsys_stop_imp_button_icon_name, ros::package::getPath("jsk_rviz_plugins")+std::string("/icons/stop-imp.png")); - - ui_->reset_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->reset_pose_button->setIcon(QIcon(QPixmap(QString(reset_pose_button_icon_name.c_str())))); - ui_->reset_manip_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->reset_manip_pose_button->setIcon(QIcon(QPixmap(QString(reset_manip_pose_button_icon_name.c_str())))); - ui_->init_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->init_pose_button->setIcon(QIcon(QPixmap(QString(init_pose_button_icon_name.c_str())))); - ui_->hand_reset_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hand_reset_pose_button->setIcon(QIcon(QPixmap(QString(hand_reset_pose_button_icon_name.c_str())))); - ui_->hand_hook_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hand_hook_pose_button->setIcon(QIcon(QPixmap(QString(hand_hook_pose_button_icon_name.c_str())))); - ui_->hand_grasp_pose_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hand_grasp_pose_button->setIcon(QIcon(QPixmap(QString(hand_grasp_pose_button_icon_name.c_str())))); - ui_->hrpsys_start_abc_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_start_abc_button->setIcon(QIcon(QPixmap(QString(hrpsys_start_abc_button_icon_name.c_str())))); - ui_->hrpsys_start_st_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_start_st_button->setIcon(QIcon(QPixmap(QString(hrpsys_start_st_button_icon_name.c_str())))); - ui_->hrpsys_start_imp_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_start_imp_button->setIcon(QIcon(QPixmap(QString(hrpsys_start_imp_button_icon_name.c_str())))); - ui_->hrpsys_start_imp_for_drill_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_start_imp_for_drill_button->setIcon(QIcon(QPixmap(QString(hrpsys_start_imp_for_drill_button_icon_name.c_str())))); - ui_->hrpsys_stop_abc_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_stop_abc_button->setIcon(QIcon(QPixmap(QString(hrpsys_stop_abc_button_icon_name.c_str())))); - ui_->hrpsys_stop_st_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_stop_st_button->setIcon(QIcon(QPixmap(QString(hrpsys_stop_st_button_icon_name.c_str())))); - ui_->hrpsys_stop_imp_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - ui_->hrpsys_stop_imp_button->setIcon(QIcon(QPixmap(QString(hrpsys_stop_imp_button_icon_name.c_str())))); - - connect( ui_->reset_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestResetPose())); - connect( ui_->reset_manip_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestManipPose())); - connect( ui_->init_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestInitPose())); - - connect( ui_->hand_reset_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestResetGripperPose())); - connect( ui_->hand_hook_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestHookGrippePose())); - connect( ui_->hand_grasp_pose_button, SIGNAL( clicked() ), this, SLOT( callRequestGraspGrippePose())); - - connect( ui_->hrpsys_start_abc_button, SIGNAL( clicked() ), this, SLOT( callRequestStartABC())); - connect( ui_->hrpsys_start_st_button, SIGNAL( clicked() ), this, SLOT( callRequestStartST())); - connect( ui_->hrpsys_start_imp_button, SIGNAL( clicked() ), this, SLOT( callRequestStartIMP())); - connect( ui_->hrpsys_start_imp_for_drill_button, SIGNAL( clicked() ), this, SLOT( callRequestStartIMPforDrill())); - - connect( ui_->hrpsys_stop_abc_button, SIGNAL( clicked() ), this, SLOT( callRequestStopABC ())); - connect( ui_->hrpsys_stop_st_button, SIGNAL( clicked() ), this, SLOT( callRequestStopST())); - connect( ui_->hrpsys_stop_imp_button, SIGNAL( clicked() ), this, SLOT( callRequestStopIMP())); + QHBoxLayout* layout = new QHBoxLayout(); + // Parse yaml file from parameter + if (nh.hasParam("robot_command_buttons")) { + try { + XmlRpc::XmlRpcValue robot_command_buttons_xmlrpc; + nh.param("robot_command_buttons", robot_command_buttons_xmlrpc, robot_command_buttons_xmlrpc); + if (robot_command_buttons_xmlrpc.getType() != XmlRpc::XmlRpcValue::TypeArray) { + throw RobotCommandParseException("~robot_comamnd_buttons should be an array"); + } + else { + for (size_t i = 0; i < robot_command_buttons_xmlrpc.size(); i++) { + XmlRpc::XmlRpcValue button_xmlrpc = robot_command_buttons_xmlrpc[i]; + if (button_xmlrpc.getType() != XmlRpc::XmlRpcValue::TypeStruct) { + throw RobotCommandParseException("element of ~robot_comamnd_buttons should be an struct"); + } + else { + std::string name; + QToolButton* button = new QToolButton(); + //button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); + button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + if (button_xmlrpc.hasMember("name")) { + name = (std::string)button_xmlrpc["name"]; + } + else { + throw RobotCommandParseException("element of ~robot_comamnd_buttons should have name field"); + } + button->setText(QString(name.c_str())); + if (button_xmlrpc.hasMember("icon")) { + // TODO: resolve path + std::string icon; + icon = (std::string)button_xmlrpc["icon"]; + if (icon.find("package://") == 0) { + icon.erase(0, strlen("package://")); + size_t package_end = icon.find("/"); + std::string package = icon.substr(0, package_end); + icon.erase(0, package_end); + std::string package_path; + package_path = ros::package::getPath(package); + icon = package_path + icon; + } + button->setIcon(QIcon(QPixmap(QString(icon.c_str())))); + button->setIconSize(QSize(100, 100)); + button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + } + std::string type; + if (button_xmlrpc.hasMember("type")) { + type = (std::string)button_xmlrpc["type"]; + } + if (type == "euscommand") { + if (button_xmlrpc.hasMember("command")) { + euscommand_mapping_[i] = (std::string)button_xmlrpc["command"]; + button->setToolTip(euscommand_mapping_[i].c_str()); + } + else { + throw RobotCommandParseException("type: euscommand requires command field"); + } + } + else if (type == "emptysrv") { + if (button_xmlrpc.hasMember("srv")) { + emptyservice_mapping_[i] = (std::string)button_xmlrpc["srv"]; + button->setToolTip(emptyservice_mapping_[i].c_str()); + } + else { + throw RobotCommandParseException("type: emptysrv requires srv field"); + } + } + else { + throw RobotCommandParseException("type field is required"); + } + // connect + connect(button, SIGNAL(clicked()), signal_mapper_, SLOT(map())); + signal_mapper_->setMapping(button, i); + layout->addWidget(button); + } + } + } + } + catch (RobotCommandParseException& e) { + popupDialog((boost::format("Malformed ~robot_command_buttons parameter.\n" + "%s\n" + "See package://jsk_rviz_plugins/config/default_robot_command.yaml") + % e.what()).str().c_str()); + } + } + else { + popupDialog("You need to specify ~robot_command_buttons parameter.\n" + "See package://jsk_rviz_plugins/launch/robot_command_interface_sample.launch"); + } + layout->addStretch(); + connect(signal_mapper_, SIGNAL(mapped(int)), this, SLOT(buttonCallback(int))); + // QToolButton* button = new QToolButton(); + + // // button->setPopupMode(QToolButton::MenuButtonPopup); + // button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + // button->setIcon(QIcon(QPixmap(QString("/home/garaemon/ros/hydro/src/jsk-ros-pkg/jsk_visualization/jsk_rviz_plugins/icons/stop-imp.png")))); + + // button->setText("Hello worpld"); + // layout->addWidget(button); + this->setLayout(layout); } - void RobotCommandInterfaceAction::callRequestResetPose(){ - std::string command("(send *ri* :angle-vector (send *robot* :reset-pose) 5000))"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestManipPose(){ - std::string command("(send *ri* :angle-vector (send *robot* :reset-manip-pose) 5000)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestInitPose(){ - std::string command("(send *ri* :angle-vector (send *robot* :init-pose) 5000)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestResetGripperPose(){ - std::string command("(progn (send *robot* :hand :arms :reset-pose) (send *ri* :hand-angle-vector (apply #\'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestHookGrippePose(){ - std::string command("(progn (send *robot* :hand :arms :hook-pose) (send *ri* :hand-angle-vector (apply #\'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestGraspGrippePose(){ - std::string command("(progn (send *robot* :hand :arms :grasp-pose) (send *ri* :hand-angle-vector (apply #\'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStartABC(){ - std::string command("(send *ri* :start-auto-balancer)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStartST(){ - std::string command("(send *ri* :start-st)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStartIMP(){ - std::string command("(send *ri* :start-impedance :arms :moment-gain #f(0 0 0) :k-p 1000 :d-p 400)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStartIMPforDrill(){ - std::string command("(send *ri* :start-impedance :rarm :force-gain #f(1 0 0) :moment-gain #f(0 0 0) :k-p 600 :d-p 60)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStopABC(){ - std::string command("(send *ri* :stop-auto-balancer)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStopST(){ - std::string command("(send *ri* :stop-st)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestStopIMP(){ - std::string command("(send *ri* :stop-impedance :arms)"); - callRequestEusCommand(command); - }; - - void RobotCommandInterfaceAction::callRequestEusCommand(std::string command){ + bool RobotCommandInterfaceAction::callRequestEusCommand(const std::string& command){ ros::ServiceClient client = nh_.serviceClient("/eus_command", true); jsk_rviz_plugins::EusCommand srv; srv.request.command = command; - if(client.call(srv)) - { - ROS_INFO("Call Success"); - } - else{ - ROS_ERROR("Service call FAIL"); - }; + return client.call(srv); } - void RobotCommandInterfaceAction::save( rviz::Config config ) const + void RobotCommandInterfaceAction::buttonCallback(int i) { - rviz::Panel::save( config ); + ROS_INFO("buttonCallback(%d)", i); + if (euscommand_mapping_.find(i) != euscommand_mapping_.end()) { + if(!callRequestEusCommand(euscommand_mapping_[i])) { + popupDialog((boost::format("Failed to call %s") % euscommand_mapping_[i]).str().c_str()); + } + } + else if (emptyservice_mapping_.find(i) != emptyservice_mapping_.end()) { + std_srvs::Empty emp; + if (!ros::service::call(emptyservice_mapping_[i], emp)) { + popupDialog((boost::format("Failed to call %s") % emptyservice_mapping_[i]).str().c_str()); + } + } + else { + popupDialog((boost::format("Failed to find corresponding command for %d") % i).str().c_str()); + } } - void RobotCommandInterfaceAction::load( const rviz::Config& config ) + void RobotCommandInterfaceAction::popupDialog(const std::string& text) { - rviz::Panel::load( config ); + QMessageBox msg_box; + msg_box.setText("Unexpected error"); + msg_box.setText(QString(text.c_str())); + msg_box.exec(); } } diff --git a/jsk_rviz_plugins/src/robot_command_interface.h b/jsk_rviz_plugins/src/robot_command_interface.h index 7f909c4fe..ca1acd5ba 100644 --- a/jsk_rviz_plugins/src/robot_command_interface.h +++ b/jsk_rviz_plugins/src/robot_command_interface.h @@ -5,11 +5,7 @@ #include #include #include - -namespace Ui -{ - class RobotCommandInterface; -} +#include namespace jsk_rviz_plugins { @@ -19,34 +15,17 @@ namespace jsk_rviz_plugins public: RobotCommandInterfaceAction( QWidget* parent = 0 ); - virtual void load( const rviz::Config& config ); - virtual void save( rviz::Config config ) const; - protected Q_SLOTS: - - void callRequestResetPose(); - void callRequestManipPose(); - void callRequestInitPose(); - - void callRequestResetGripperPose(); - void callRequestHookGrippePose(); - void callRequestGraspGrippePose(); - - void callRequestStartABC(); - void callRequestStartST(); - void callRequestStartIMP(); - void callRequestStartIMPforDrill(); - - void callRequestStopABC(); - void callRequestStopST(); - void callRequestStopIMP(); - - void callRequestEusCommand(std::string command); - + bool callRequestEusCommand(const std::string& command); + void buttonCallback(int i); protected: + void popupDialog(const std::string& text); // The ROS node handle. ros::NodeHandle nh_; - Ui::RobotCommandInterface *ui_; + QSignalMapper* signal_mapper_; + std::map euscommand_mapping_; + std::map emptyservice_mapping_; + //std::vector buttons_; }; }