00001 00018 #ifndef ENVIRONMENT_VISUALIZER_H 00019 #define ENVIRONMENT_VISUALIZER_H 00020 00021 #include <ros/ros.h> 00022 #include <asr_visualization_server/DrawAllModelsDome.h> 00023 #include <asr_visualization_server/DrawAllModelsMild.h> 00024 #include <asr_visualization_server/ClearAllModels.h> 00025 #include <asr_visualization_server/DrawModelDome.h> 00026 #include <asr_visualization_server/DrawModelMild.h> 00027 #include <asr_visualization_server/ClearModelDome.h> 00028 #include <asr_visualization_server/ClearModelMild.h> 00029 #include <asr_visualization_server/ShowAvailableModels.h> 00030 00031 #include "marker_helper.h" 00032 00033 00034 namespace visualization_server { 00035 00036 using namespace asr_visualization_server; 00037 00039 const static std::string NODE_NAME("visualization"); 00040 00042 const static std::string DRAW_ALL_DOME_SERVICE_NAME("draw_all_models_dome"); 00043 00045 const static std::string DRAW_ALL_MILD_SERVICE_NAME("draw_all_models_mild"); 00046 00048 const static std::string CLEAR_ALL_MODELS_SERVICE_NAME("clear_all_models"); 00049 00051 const static std::string DRAW_MODEL_DOME_SERVICE_NAME("draw_model_dome"); 00052 00054 const static std::string DRAW_MODEL_MILD_SERVICE_NAME("draw_model_mild"); 00055 00057 const static std::string CLEAR_MODEL_DOME_SERVICE_NAME("clear_model_dome"); 00058 00060 const static std::string CLEAR_MODEL_MILD_SERVICE_NAME("clear_model_mild"); 00061 00063 const static std::string SHOW_AVAILABLE_MODELS_SERVICE_NAME("show_available_models"); 00064 00065 class EnvironmentVisualizer { 00066 00067 private: 00068 00070 ros::NodeHandle nh_; 00071 00072 ros::Timer publish_timer_; 00073 00075 ros::ServiceServer draw_all_mild_service_; 00076 ros::ServiceServer draw_all_dome_service_; 00077 ros::ServiceServer clear_all_service_; 00078 ros::ServiceServer draw_model_dome_service_; 00079 ros::ServiceServer draw_model_mild_service_; 00080 ros::ServiceServer clear_model_dome_service_; 00081 ros::ServiceServer clear_model_mild_service_; 00082 ros::ServiceServer show_available_models_service_; 00083 00084 ros::Publisher model_pub_; 00085 00086 std::string output_models_topic_; 00087 00088 MarkerHelper marker_helper_; 00089 00090 visualization_msgs::MarkerArray dome_markers_; 00091 visualization_msgs::MarkerArray mild_markers_; 00092 00093 00094 void timerCallback(const ros::TimerEvent& e); 00095 00102 bool processDrawAllModelsDomeRequest(DrawAllModelsDome::Request &req, DrawAllModelsDome::Response &res); 00103 00110 bool processDrawAllModelsMildRequest(DrawAllModelsMild::Request &req, DrawAllModelsMild::Response &res); 00111 00118 bool processClearAllModelsRequest(ClearAllModels::Request &req, ClearAllModels::Response &res); 00119 00126 bool processDrawModelDomeRequest(DrawModelDome::Request &req, DrawModelDome::Response &res); 00127 00134 bool processDrawModelMildRequest(DrawModelMild::Request &req, DrawModelMild::Response &res); 00135 00142 bool processClearModelDomeRequest(ClearModelDome::Request &req, ClearModelDome::Response &res); 00143 00150 bool processClearModelMildRequest(ClearModelMild::Request &req, ClearModelMild::Response &res); 00151 00158 bool processShowAvailableModelsRequest(ShowAvailableModels::Request &req, ShowAvailableModels::Response &res); 00159 00160 00161 00162 00163 public: 00164 EnvironmentVisualizer(); 00165 00166 }; 00167 00168 } 00169 00170 #endif /* ENVIRONMENT_VISUALIZER_H */ 00171