Flatland
interactive_marker_manager.h
1 #ifndef INTERACTIVEMARKERMANAGER_H
2 #define INTERACTIVEMARKERMANAGER_H
3 
4 #include <flatland_server/geometry.h>
5 #include <flatland_server/model.h>
6 #include <flatland_server/plugin_manager.h>
7 #include <flatland_server/types.h>
8 #include <interactive_markers/interactive_marker_server.h>
9 #include <interactive_markers/menu_handler.h>
10 #include <visualization_msgs/MarkerArray.h>
11 
12 namespace flatland_server {
13 
15  public:
22  InteractiveMarkerManager(std::vector<Model*>* model_list_ptr,
23  PluginManager* plugin_manager_ptr);
24 
29 
37  const std::string& model_name, const Pose& pose,
38  const visualization_msgs::MarkerArray& body_markers);
39 
45  void deleteInteractiveMarker(const std::string& model_name);
46 
51  void update();
52 
53  bool isManipulating() { return manipulating_model_; }
54 
55  private:
56  interactive_markers::MenuHandler
57  menu_handler_;
58  boost::shared_ptr<interactive_markers::InteractiveMarkerServer>
59  interactive_marker_server_;
60  std::vector<Model*>*
61  models_;
63  plugin_manager_;
64  bool manipulating_model_;
65  ros::WallTime pose_update_stamp_;
67 
78  void processMouseUpFeedback(
79  const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback);
80 
88  void processMouseDownFeedback(
89  const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback);
90 
97  void processPoseUpdateFeedback(
98  const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback);
99 
106  void deleteModelMenuCallback(
107  const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback);
108 };
109 }
110 
111 #endif // INTERACTIVEMARKERMANAGER_H
Definition: body.h:55
void createInteractiveMarker(const std::string &model_name, const Pose &pose, const visualization_msgs::MarkerArray &body_markers)
Add a new interactive marker when spawning a model.
Definition: interactive_marker_manager.cpp:26
~InteractiveMarkerManager()
Destructor for the interactive marker manager class.
Definition: interactive_marker_manager.cpp:236
Definition: types.h:84
void update()
Update the interactive marker poses after running physics update to synchronize the markers with the ...
Definition: interactive_marker_manager.cpp:205
Definition: interactive_marker_manager.h:14
Definition: plugin_manager.h:64
InteractiveMarkerManager(std::vector< Model * > *model_list_ptr, PluginManager *plugin_manager_ptr)
Constructor for the interactive marker manager class.
Definition: interactive_marker_manager.cpp:5
void deleteInteractiveMarker(const std::string &model_name)
Remove interactive marker corresponding to a given model when deleting it from the simulation...
Definition: interactive_marker_manager.cpp:165