rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
drag_box_marker.h
Go to the documentation of this file.
1 #ifndef _RAPID_VIZ_DRAG_BOX_MARKER_H_
2 #define _RAPID_VIZ_DRAG_BOX_MARKER_H_
3 
4 #include <string>
5 
6 #include "geometry_msgs/Point.h"
7 #include "geometry_msgs/PoseStamped.h"
8 #include "geometry_msgs/Vector3.h"
9 #include "interactive_markers/interactive_marker_server.h"
10 #include "transform_graph/graph.h"
11 #include "visualization_msgs/InteractiveMarker.h"
12 
13 namespace rapid {
15 //
39  public:
45  DragBoxMarker(const std::string& name,
46  interactive_markers::InteractiveMarkerServer* im_server);
47 
49  void Show();
50 
52  void Hide();
53 
55  void set_pose_stamped(const geometry_msgs::PoseStamped& pose_stamped);
56 
59  void set_min_x(double min_x);
60 
63  void set_max_x(double max_x);
64 
67  void set_min_y(double min_y);
68 
71  void set_max_y(double max_y);
72 
75  void set_min_z(double min_z);
76 
79  void set_max_z(double max_z);
80 
82  geometry_msgs::PoseStamped pose_stamped();
84  double min_x();
86  double max_x();
88  double min_y();
90  double max_y();
92  double min_z();
94  double max_z();
95 
96  private:
97  // Update the interactive markers, assuming that min/max_xyz have been set.
98  void Update();
99  // Computes min/max_xyz given a new arrow position
100  void UpdateArrow(const std::string& axis, const std::string& polarity,
101  const geometry_msgs::Point& point);
102  void Feedback(
103  const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback);
104  void MakeBox(visualization_msgs::InteractiveMarker* box);
105  void MakeArrow(const std::string& axis, const std::string& polarity,
106  visualization_msgs::InteractiveMarker* arrow);
107 
108  std::string name_;
109  interactive_markers::InteractiveMarkerServer* im_server_;
110 
111  geometry_msgs::PoseStamped pose_stamped_;
112  double min_x_;
113  double max_x_;
114  double min_y_;
115  double max_y_;
116  double min_z_;
117  double max_z_;
118 
119  transform_graph::Graph tf_graph_;
120 };
121 
122 } // namespace rapid
123 
124 #endif // _RAPID_VIZ_DRAG_BOX_MARKER_H_
void Hide()
Erases the marker.
void set_max_y(double max_y)
Sets the maximum y value of the box.
An interactive marker for a box with draggable sides.
geometry_msgs::PoseStamped pose_stamped()
void Show()
Show the marker.
void set_min_z(double min_z)
Sets the minimum z value of the box.
void set_min_x(double min_x)
Sets the minimum x value of the box.
void set_min_y(double min_y)
Sets the minimum y value of the box.
void set_max_x(double max_x)
Sets the maximum x value of the box.
void set_pose_stamped(const geometry_msgs::PoseStamped &pose_stamped)
Sets the marker's pose.
void set_max_z(double max_z)
Sets the maximum z value of the box.
DragBoxMarker(const std::string &name, interactive_markers::InteractiveMarkerServer *im_server)
Constructor.