transformable_object.h
Go to the documentation of this file.
1 #ifndef __TRANSFORMABLE_OBJECT_H__
2 #define __TRANSFORMABLE_OBJECT_H__
3 
4 #include <ros/ros.h>
5 #include <visualization_msgs/Marker.h>
6 #include <visualization_msgs/InteractiveMarker.h>
7 #include <visualization_msgs/InteractiveMarkerControl.h>
8 #include <std_msgs/Float32.h>
9 #include <std_msgs/ColorRGBA.h>
11 #include <tf/transform_datatypes.h>
12 #include <geometry_msgs/Point.h>
13 #include <jsk_rviz_plugins/RequestMarkerOperate.h>
14 #include <vector>
15 #include <algorithm>
16 #include <jsk_interactive_marker/InteractiveSettingConfig.h>
17 
18 namespace jsk_interactive_marker {
20  public:
22 
23  std::vector<visualization_msgs::InteractiveMarkerControl> makeRotateTransFixControl(unsigned int orientation_mode = visualization_msgs::InteractiveMarkerControl::FIXED);
24 
26  visualization_msgs::InteractiveMarker getInteractiveMarker();
27  virtual visualization_msgs::Marker getVisualizationMsgMarker(){};
28  void addMarker(visualization_msgs::InteractiveMarker &int_marker, bool always_visible = true, unsigned int interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_3D);
29  void addControl(visualization_msgs::InteractiveMarker &int_marker);
30 
31  visualization_msgs::Marker marker_;
32  geometry_msgs::Pose pose_;
33  geometry_msgs::Pose control_offset_pose_;
34  std::string name_;
35  std::string frame_id_;
36  std::string description_;
37  int type_;
41  unsigned int interaction_mode_;
42 
43  void setPose(geometry_msgs::Pose pose, bool for_interactive_control=false);
44  void addPose(geometry_msgs::Pose msg, bool relative=false);
45  void publishTF();
46  std::string getFrameId() { return frame_id_; }
47  geometry_msgs::Pose getPose(bool for_interactive_control=false);
49  void setDisplayDescription(bool v);
50  void setInteractiveMarkerSetting(const InteractiveSettingConfig& config);
51  virtual bool setRadius(std_msgs::Float32 recieve_val){return false;};
52  virtual bool setSmallRadius(std_msgs::Float32 recieve_val){return false;};
53  virtual bool setHeight(std_msgs::Float32 recieve_val){return false;};
54  virtual bool setX(std_msgs::Float32 recieve_val){return false;};
55  virtual bool setY(std_msgs::Float32 recieve_val){return false;};
56  virtual bool setZ(std_msgs::Float32 recieve_val){return false;};
57  virtual void setRGBA(float r , float g, float b, float a){};
58  virtual void getRGBA(float &r , float &g, float &b, float &a){};
59  virtual void setXYZ(float x , float y, float z){};
60  virtual void getXYZ(float &x, float &y, float&z){};
61  virtual void setRSR(float r , float sr){};
62  virtual void getRSR(float &r , float &sr){};
63  virtual void setRZ(float r , float z){};
64  virtual void getRZ(float &r , float &z){};
65 
66  int getType() { return type_; };
67  void setType(int type) { type_ = type; return; };
68 
69  virtual float getInteractiveMarkerScale(){};
70  };
71 };
72 
73 namespace jsk_interactive_marker
74 {
76  {
77  public:
78  TransformableBox( float length , float r, float g, float b, float a, std::string frame, std::string name, std::string description);
79 
80  TransformableBox( float x, float y, float z, float r, float g, float b, float a, std::string frame, std::string name, std::string description);
81 
82  visualization_msgs::Marker getVisualizationMsgMarker();
83  void setRGBA( float r , float g, float b, float a){box_r_=r;box_g_=g;box_b_=b;box_a_=a;};
84  void getRGBA(float &r , float &g, float &b, float &a){r=box_r_;g=box_g_;b=box_b_;a=box_a_;}
85  void setXYZ( float x , float y, float z){box_x_=x;box_y_=y;box_z_=z;};
86  void getXYZ(float &x, float &y, float&z){x=box_x_;y=box_y_;z=box_z_;};
87 
88  bool setX(std_msgs::Float32 x){box_x_=x.data;return true;};
89  bool setY(std_msgs::Float32 y){box_y_=y.data;return true;};
90  bool setZ(std_msgs::Float32 z){box_z_=z.data;return true;};
91 
92  float getInteractiveMarkerScale(){return 1.25*std::max(std::max(box_x_, box_y_),box_z_);};
93 
94  float box_x_;
95  float box_y_;
96  float box_z_;
97  float box_r_;
98  float box_g_;
99  float box_b_;
100  float box_a_;
101  };
102 };
103 
104 namespace jsk_interactive_marker
105 {
107  {
108  public:
109  TransformableMesh(std::string frame, std::string name, std::string description, std::string mesh_resource, bool mesh_use_embedded_materials);
110  visualization_msgs::Marker getVisualizationMsgMarker();
111  void setRGBA( float r , float g, float b, float a){mesh_r_=r;mesh_g_=g;mesh_b_=b;mesh_a_=a;};
112  void getRGBA(float &r , float &g, float &b, float &a){r=mesh_r_;g=mesh_g_;b=mesh_b_;a=mesh_a_;};
113  void setXYZ( float x , float y, float z){marker_scale_=x; return;};
114  void getXYZ(float &x, float &y, float&z){return;};
115  bool setX(std_msgs::Float32 x){marker_scale_=x.data; return true;};
116  bool setY(std_msgs::Float32 y){return true;};
117  bool setZ(std_msgs::Float32 z){return true;};
118  float getInteractiveMarkerScale(){return marker_scale_;};
119  float marker_scale_;
120  std::string mesh_resource_;
122  float mesh_r_;
123  float mesh_g_;
124  float mesh_b_;
125  float mesh_a_;
126  };
127 };
128 
129 namespace jsk_interactive_marker
130 {
132  {
133  public:
134  TransformableTorus( float radius, float small_radius, int u_div, int v_div, float r, float g, float b, float a, std::string frame, std::string name, std::string description);
135 
136  visualization_msgs::Marker getVisualizationMsgMarker();
137  void setRGBA( float r , float g, float b, float a){torus_r_=r;torus_g_=g;torus_b_=b;torus_a_=a;};
138  void getRGBA(float &r , float &g, float &b, float &a){r=torus_r_;g=torus_g_;b=torus_b_;a=torus_a_;}
139  void setRSR( float r , float sr){torus_radius_=r; torus_small_radius_=sr;};
140  void getRSR(float &r , float &sr){r=torus_radius_; sr=torus_small_radius_;};
141 
142  bool setRadius(std_msgs::Float32 r){torus_radius_=r.data;return true;};
143  bool setSmallRadius(std_msgs::Float32 sr){torus_small_radius_=sr.data;return true;};
144 
145  std::vector<geometry_msgs::Point > calcurateTriangleMesh();
146 
147  float getInteractiveMarkerScale(){return (torus_radius_+torus_small_radius_+1);};
148 
149  float torus_radius_;
151  float torus_r_;
152  float torus_g_;
153  float torus_b_;
154  float torus_a_;
155 
158  };
159 };
160 
161 namespace jsk_interactive_marker
162 {
164  {
165  public:
166  TransformableCylinder( float radius, float z, float r, float g, float b, float a, std::string frame, std::string name, std::string description);
167 
168  visualization_msgs::Marker getVisualizationMsgMarker();
169  void setRGBA( float r , float g, float b, float a){cylinder_r_=r;cylinder_g_=g;cylinder_b_=b;cylinder_a_=a;};
170  void getRGBA(float &r , float &g, float &b, float &a){r=cylinder_r_;g=cylinder_g_;b=cylinder_b_;a=cylinder_a_;}
171  void setRZ( float r , float z){cylinder_radius_=r; cylinder_z_=z;};
172  void getRZ(float &r , float &z){r=cylinder_radius_; z=cylinder_z_;};
173 
174  bool setRadius(std_msgs::Float32 r){cylinder_radius_=r.data;return true;};
175  bool setZ(std_msgs::Float32 z){cylinder_z_=z.data;return true;};
176 
177  float getInteractiveMarkerScale(){return 1.25*std::max(cylinder_radius_, cylinder_z_);};
178 
179  float cylinder_radius_;
180  float cylinder_z_;
181  float cylinder_r_;
182  float cylinder_g_;
183  float cylinder_b_;
184  float cylinder_a_;
185  };
186 };
187 
188 #endif
void setRGBA(float r, float g, float b, float a)
geometry_msgs::Pose getPose(bool for_interactive_control=false)
small_radius
virtual void setRGBA(float r, float g, float b, float a)
x
void setRGBA(float r, float g, float b, float a)
void setXYZ(float x, float y, float z)
config
void addControl(visualization_msgs::InteractiveMarker &int_marker)
void addMarker(visualization_msgs::InteractiveMarker &int_marker, bool always_visible=true, unsigned int interaction_mode=visualization_msgs::InteractiveMarkerControl::MOVE_3D)
void getXYZ(float &x, float &y, float &z)
virtual void getRGBA(float &r, float &g, float &b, float &a)
void getRGBA(float &r, float &g, float &b, float &a)
void getRGBA(float &r, float &g, float &b, float &a)
std::vector< visualization_msgs::InteractiveMarkerControl > makeRotateTransFixControl(unsigned int orientation_mode=visualization_msgs::InteractiveMarkerControl::FIXED)
void setPose(geometry_msgs::Pose pose, bool for_interactive_control=false)
virtual bool setX(std_msgs::Float32 recieve_val)
virtual void getXYZ(float &x, float &y, float &z)
void addPose(geometry_msgs::Pose msg, bool relative=false)
y
void setRGBA(float r, float g, float b, float a)
void setXYZ(float x, float y, float z)
frame
virtual void getRSR(float &r, float &sr)
void getRGBA(float &r, float &g, float &b, float &a)
virtual bool setHeight(std_msgs::Float32 recieve_val)
GLfloat v[8][3]
virtual visualization_msgs::Marker getVisualizationMsgMarker()
virtual void getRZ(float &r, float &z)
virtual bool setZ(std_msgs::Float32 recieve_val)
void setInteractiveMarkerSetting(const InteractiveSettingConfig &config)
GLdouble radius
void getRGBA(float &r, float &g, float &b, float &a)
void getXYZ(float &x, float &y, float &z)
virtual void setXYZ(float x, float y, float z)
z
void setRGBA(float r, float g, float b, float a)
visualization_msgs::InteractiveMarker getInteractiveMarker()
char a[26]
virtual bool setSmallRadius(std_msgs::Float32 recieve_val)
virtual bool setRadius(std_msgs::Float32 recieve_val)
virtual bool setY(std_msgs::Float32 recieve_val)


jsk_interactive_marker
Author(s): furuta
autogenerated on Sat Mar 20 2021 03:03:33