transformable_interactive_server.h
Go to the documentation of this file.
1 #ifndef __TRANSFORMABLE_INTERACTIVE_SERVER_H__
2 #define __TRANSFORMABLE_INTERACTIVE_SERVER_H__
3 
4 #include <ros/ros.h>
9 #include <std_msgs/Float32.h>
10 #include <std_msgs/String.h>
11 #include <std_srvs/Empty.h>
12 #include <geometry_msgs/PoseStamped.h>
13 #include <map>
14 #include <jsk_rviz_plugins/OverlayText.h>
15 #include <iostream>
16 #include <sstream>
17 #include <tf/transform_listener.h>
18 #include <dynamic_reconfigure/server.h>
19 #include <jsk_interactive_marker/InteractiveSettingConfig.h>
20 #include <jsk_interactive_marker/GetTransformableMarkerPose.h>
21 #include <jsk_interactive_marker/SetTransformableMarkerPose.h>
22 #include <jsk_interactive_marker/GetTransformableMarkerColor.h>
23 #include <jsk_interactive_marker/SetTransformableMarkerColor.h>
24 #include <jsk_interactive_marker/GetTransformableMarkerFocus.h>
25 #include <jsk_interactive_marker/SetTransformableMarkerFocus.h>
26 #include <jsk_interactive_marker/GetMarkerDimensions.h>
27 #include <jsk_interactive_marker/SetMarkerDimensions.h>
28 #include <jsk_interactive_marker/GetType.h>
29 #include <jsk_interactive_marker/GetTransformableMarkerExistence.h>
30 #include <jsk_interactive_marker/MarkerDimensions.h>
31 #include <jsk_interactive_marker/PoseStampedWithName.h>
32 
33 using namespace std;
34 
35 namespace jsk_interactive_marker
36 {
38  public:
41 
42  void processFeedback( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
43  void setRadius(std_msgs::Float32 msg);
44  void setSmallRadius(std_msgs::Float32 msg);
45  void setX(std_msgs::Float32 msg);
46  void setY(std_msgs::Float32 msg);
47  void setZ(std_msgs::Float32 msg);
48 
49  void setPose( const geometry_msgs::PoseStampedConstPtr &msg_ptr , bool for_interactive_control=false);
50  void addPose(geometry_msgs::Pose msg);
51  void addPoseRelative(geometry_msgs::Pose msg);
52 
53  void setControlRelativePose(geometry_msgs::Pose msg);
54 
55  void setColor(std_msgs::ColorRGBA msg);
56 
57  void insertNewBox( std::string frame_id, std::string name, std::string description );
58  void insertNewCylinder( std::string frame_id, std::string name, std::string description );
59  void insertNewTorus( std::string frame_id, std::string name, std::string description );
60  void insertNewMesh( std::string frame_id, std::string name, std::string description , std::string mesh_resource, bool mesh_use_embedded_materials);
61 
62  void insertNewObject(TransformableObject* tobject, std::string name);
63  void eraseObject(std::string name);
64  void eraseAllObject();
65  void eraseFocusObject();
66 
67  void run();
68  void focusTextPublish();
69  void focusPosePublish();
70  void focusObjectMarkerNamePublish();
71  void focusInteractiveManipulatorDisplay();
72 
73  void enableInteractiveManipulatorDisplay(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback,
74  const bool enable);
75 
76  void updateTransformableObject(TransformableObject* tobject);
77 
78  bool getPoseService(jsk_interactive_marker::GetTransformableMarkerPose::Request &req,jsk_interactive_marker::GetTransformableMarkerPose::Response &res, bool for_interactive_control);
79  bool setPoseService(jsk_interactive_marker::SetTransformableMarkerPose::Request &req,jsk_interactive_marker::SetTransformableMarkerPose::Response &res, bool for_interactive_control);
80  bool getColorService(jsk_interactive_marker::GetTransformableMarkerColor::Request &req,jsk_interactive_marker::GetTransformableMarkerColor::Response &res);
81  bool setColorService(jsk_interactive_marker::SetTransformableMarkerColor::Request &req,jsk_interactive_marker::SetTransformableMarkerColor::Response &res);
82  bool getFocusService(jsk_interactive_marker::GetTransformableMarkerFocus::Request &req,jsk_interactive_marker::GetTransformableMarkerFocus::Response &res);
83  bool setFocusService(jsk_interactive_marker::SetTransformableMarkerFocus::Request &req,jsk_interactive_marker::SetTransformableMarkerFocus::Response &res);
84  bool getTypeService(jsk_interactive_marker::GetType::Request &req,jsk_interactive_marker::GetType::Response &res);
85  bool getExistenceService(jsk_interactive_marker::GetTransformableMarkerExistence::Request &req,jsk_interactive_marker::GetTransformableMarkerExistence::Response &res);
86  bool setDimensionsService(jsk_interactive_marker::SetMarkerDimensions::Request &req,jsk_interactive_marker::SetMarkerDimensions::Response &res);
87  bool getDimensionsService(jsk_interactive_marker::GetMarkerDimensions::Request &req,jsk_interactive_marker::GetMarkerDimensions::Response &res);
88  bool hideService(std_srvs::Empty::Request& req,
89  std_srvs::Empty::Response& res);
90  bool showService(std_srvs::Empty::Request& req,
91  std_srvs::Empty::Response& res);
92  void publishMarkerDimensions();
93 
94  bool requestMarkerOperateService(jsk_rviz_plugins::RequestMarkerOperate::Request &req,jsk_rviz_plugins::RequestMarkerOperate::Response &res);
95  virtual void configCallback(InteractiveSettingConfig &config, uint32_t level);
96  void SetInitialInteractiveMarkerConfig( TransformableObject* tobject );
97 
98  void tfTimerCallback(const ros::TimerEvent&);
99  bool setPoseWithTfTransformation(TransformableObject* tobject, geometry_msgs::PoseStamped pose_stamped, bool for_interactive_control=false);
100 
103 
105 
111 
113 
120 
137 
138  std::shared_ptr <dynamic_reconfigure::Server<InteractiveSettingConfig> > config_srv_;
139 
147  map<string, TransformableObject*> transformable_objects_map_;
148  std::shared_ptr<tf::TransformListener> tf_listener_;
151  jsk_interactive_marker::InteractiveSettingConfig config_;
155  std::shared_ptr <YamlMenuHandler> yaml_menu_handler_ptr_;
156  };
157 }
158 
159 #endif
msg
TFSIMD_FORCE_INLINE void setZ(tfScalar z)
config
void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
TFSIMD_FORCE_INLINE void setY(tfScalar y)
TFSIMD_FORCE_INLINE void setX(tfScalar x)
jsk_interactive_marker::InteractiveSettingConfig config_
std::shared_ptr< dynamic_reconfigure::Server< InteractiveSettingConfig > > config_srv_
void run(ClassLoader *loader)
boost::mutex mutex


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