$search
00001 /* 00002 * Copyright (c) 2009, Willow Garage, Inc. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * * Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * * Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * * Neither the name of the Willow Garage, Inc. nor the names of its 00014 * contributors may be used to endorse or promote products derived from 00015 * this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00021 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00022 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00023 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00024 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00025 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00026 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 * POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 #ifndef INTERACTIVE_MANIPULATION_FRONTEND 00031 #define INTERACTIVE_MANIPULATION_FRONTEND 00032 00033 #include <ros/ros.h> 00034 00035 #include <actionlib/client/simple_action_client.h> 00036 00037 #include <std_msgs/String.h> 00038 00039 #include "pr2_interactive_manipulation/interactive_manipulation_ui.h" 00040 #include "pr2_interactive_manipulation/advanced_options_dialog.h" 00041 #include "pr2_object_manipulation_msgs/IMGUIOptions.h" 00042 #include "pr2_object_manipulation_msgs/IMGUIAdvancedOptions.h" 00043 #include "pr2_object_manipulation_msgs/IMGUIAction.h" 00044 #include "pr2_object_manipulation_msgs/ActionInfo.h" 00045 00046 namespace rviz { 00047 class VisualizationManager; 00048 class FrameManager; 00049 } 00050 00051 namespace pr2_interactive_manipulation { 00052 00053 class InteractiveManipulationFrontend : public InteractiveManipulationFrameBase 00054 { 00055 public: 00056 InteractiveManipulationFrontend(wxWindow *parent, rviz::VisualizationManager* manager); 00057 00058 ~InteractiveManipulationFrontend(); 00059 00060 void update(); 00061 00062 void setAdvancedOptions(pr2_object_manipulation_msgs::IMGUIAdvancedOptions ago){adv_options_ = ago;} 00063 00064 int interface_number_; 00065 00066 int task_number_; 00067 00068 protected: 00069 00070 void feedbackCallback(const pr2_object_manipulation_msgs::IMGUIFeedbackConstPtr &feedback); 00071 00072 void statusCallback( const std_msgs::StringConstPtr &status); 00073 00074 void rcommanderRefresh(); 00075 00076 virtual void graspButtonClicked( wxCommandEvent& event ); 00077 00078 virtual void placeButtonClicked( wxCommandEvent& event ); 00079 00080 virtual void plannedMoveButtonClicked( wxCommandEvent& event ); 00081 00082 virtual void cancelButtonClicked( wxCommandEvent& event ); 00083 00084 virtual void stopNavButtonClicked( wxCommandEvent& event ); 00085 00086 virtual void resetButtonClicked( wxCommandEvent& event ); 00087 00088 virtual void armGoButtonClicked( wxCommandEvent& event ); 00089 00090 virtual void cameraLeftButtonClicked( wxCommandEvent& event ); 00091 00092 virtual void cameraRightButtonClicked( wxCommandEvent& event ); 00093 00094 virtual void cameraFrontButtonClicked( wxCommandEvent& event ); 00095 00096 virtual void cameraTopButtonClicked( wxCommandEvent& event ); 00097 00098 virtual void advancedOptionsClicked( wxCommandEvent& event ); 00099 00100 virtual void modelObjectClicked( wxCommandEvent& event); 00101 00102 //virtual void openDrawerButtonClicked( wxCommandEvent& event); 00103 00104 virtual void rcommandRunButtonClicked( wxCommandEvent& event); 00105 00106 virtual void rcommandRefreshButtonClicked(wxCommandEvent& event); 00107 00108 virtual void gripperSliderScrollChanged( wxScrollEvent& ); 00109 00110 pr2_object_manipulation_msgs::IMGUIOptions getDialogOptions(); 00111 00112 void setCamera(std::vector<double> params); 00113 00114 rviz::VisualizationManager* vis_manager_; 00115 00116 ros::NodeHandle root_nh_; 00117 ros::NodeHandle priv_nh_; 00118 00119 ros::ServiceClient rcommander_action_info_client_; 00120 actionlib::SimpleActionClient<pr2_object_manipulation_msgs::IMGUIAction> *action_client_; 00121 //actionlib::SimpleActionClient<RunScriptAction> *scripted_action_client_; 00122 //std::string scripted_action_name_; 00123 ros::Subscriber status_sub_; 00124 00125 std::string rcommander_action_info_name_; 00126 std::string rcommander_group_name_; 00127 std::string action_name_; 00128 std::string status_name_; 00129 00130 std::string status_label_text_; 00131 00132 boost::mutex status_label_mutex_; 00133 00134 pr2_object_manipulation_msgs::IMGUIAdvancedOptions adv_options_; 00135 }; 00136 00137 } 00138 00139 #endif