1 #ifndef __TRANSFORMABLE_OBJECT_H__ 2 #define __TRANSFORMABLE_OBJECT_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> 12 #include <geometry_msgs/Point.h> 13 #include <jsk_rviz_plugins/RequestMarkerOperate.h> 16 #include <jsk_interactive_marker/InteractiveSettingConfig.h> 23 std::vector<visualization_msgs::InteractiveMarkerControl>
makeRotateTransFixControl(
unsigned int orientation_mode = visualization_msgs::InteractiveMarkerControl::FIXED);
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);
43 void setPose(geometry_msgs::Pose pose,
bool for_interactive_control=
false);
44 void addPose(geometry_msgs::Pose msg,
bool relative=
false);
47 geometry_msgs::Pose
getPose(
bool for_interactive_control=
false);
51 virtual bool setRadius(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){};
67 void setType(
int type) { type_ = type;
return; };
78 TransformableBox(
float length ,
float r,
float g,
float b,
float a, std::string
frame, std::string name, std::string description);
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);
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_;};
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;};
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;};
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);
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_;};
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;};
145 std::vector<geometry_msgs::Point > calcurateTriangleMesh();
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_;};
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;};
179 float cylinder_radius_;