00001 00012 #ifndef RAIL_PICK_AND_PLACE_GRASP_COLLECTION_PANEL_H_ 00013 #define RAIL_PICK_AND_PLACE_GRASP_COLLECTION_PANEL_H_ 00014 00015 // ROS 00016 #include <actionlib/client/simple_action_client.h> 00017 #include <rail_pick_and_place_msgs/GraspAndStoreAction.h> 00018 #include <rviz/panel.h> 00019 00020 // Qt 00021 #include <QCheckBox> 00022 #include <QLabel> 00023 #include <QLineEdit> 00024 #include <QPushButton> 00025 00026 namespace rail 00027 { 00028 namespace pick_and_place 00029 { 00030 00037 class GraspCollectionPanel : public rviz::Panel 00038 { 00039 00040 // this class uses Qt slots and is a subclass of QObject, so it needs the Q_OBJECT macro 00041 Q_OBJECT 00042 00043 public: 00051 GraspCollectionPanel(QWidget *parent = NULL); 00052 00060 virtual void load(const rviz::Config &config); 00061 00069 virtual void save(rviz::Config config) const; 00070 00071 private: 00080 void doneCallback(const actionlib::SimpleClientGoalState &state, 00081 const rail_pick_and_place_msgs::GraspAndStoreResultConstPtr &result); 00082 00090 void feedbackCallback(const rail_pick_and_place_msgs::GraspAndStoreFeedbackConstPtr &feedback); 00091 00093 actionlib::SimpleActionClient<rail_pick_and_place_msgs::GraspAndStoreAction> grasp_and_store_ac_; 00094 00096 QCheckBox *lift_box_, *verify_box_; 00098 QLabel *grasp_and_store_status_; 00100 QLineEdit *name_input_; 00102 QPushButton *grasp_and_store_button_; 00103 00104 // used as UI callbacks 00105 private 00106 Q_SLOTS: 00107 00113 void executeGraspAndStore(); 00114 }; 00115 00116 } 00117 } 00118 00119 #endif