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
jsk_interactive_marker::TransformableInteractiveServer::config_
jsk_interactive_marker::InteractiveSettingConfig config_
Definition: transformable_interactive_server.h:151
msg
msg
ros::Publisher
run
void run(class_loader::ClassLoader *loader)
jsk_interactive_marker::TransformableInteractiveServer::interactive_manipulator_orientation_
int interactive_manipulator_orientation_
Definition: transformable_interactive_server.h:153
jsk_interactive_marker::TransformableInteractiveServer::set_sm_r_sub_
ros::Subscriber set_sm_r_sub_
Definition: transformable_interactive_server.h:115
jsk_interactive_marker::TransformableInteractiveServer::mutex_
boost::mutex mutex_
Definition: transformable_interactive_server.h:104
jsk_interactive_marker::TransformableInteractiveServer::show_srv_
ros::ServiceServer show_srv_
Definition: transformable_interactive_server.h:122
ros.h
jsk_interactive_marker::TransformableInteractiveServer::get_exist_srv_
ros::ServiceServer get_exist_srv_
Definition: transformable_interactive_server.h:132
jsk_interactive_marker::TransformableInteractiveServer::get_dimensions_srv
ros::ServiceServer get_dimensions_srv
Definition: transformable_interactive_server.h:134
jsk_interactive_marker::TransformableInteractiveServer::torus_udiv_
int torus_udiv_
Definition: transformable_interactive_server.h:149
jsk_interactive_marker::TransformableInteractiveServer::tf_listener_
std::shared_ptr< tf::TransformListener > tf_listener_
Definition: transformable_interactive_server.h:148
description
description
jsk_interactive_marker::TransformableInteractiveServer::server_
interactive_markers::InteractiveMarkerServer * server_
Definition: transformable_interactive_server.h:146
jsk_interactive_marker::TransformableInteractiveServer::focus_name_text_pub_
ros::Publisher focus_name_text_pub_
Definition: transformable_interactive_server.h:141
jsk_interactive_marker::TransformableInteractiveServer::setrad_sub_
ros::Subscriber setrad_sub_
Definition: transformable_interactive_server.h:140
jsk_interactive_marker::TransformableInteractiveServer::set_focus_srv_
ros::ServiceServer set_focus_srv_
Definition: transformable_interactive_server.h:130
jsk_interactive_marker::TransformableInteractiveServer::get_pose_srv_
ros::ServiceServer get_pose_srv_
Definition: transformable_interactive_server.h:123
jsk_interactive_marker::TransformableInteractiveServer::set_control_pose_srv_
ros::ServiceServer set_control_pose_srv_
Definition: transformable_interactive_server.h:126
jsk_interactive_marker
Definition: camera_info_publisher.h:48
jsk_interactive_marker::TransformableInteractiveServer::set_y_sub_
ros::Subscriber set_y_sub_
Definition: transformable_interactive_server.h:118
jsk_interactive_marker::TransformableInteractiveServer::set_pose_srv_
ros::ServiceServer set_pose_srv_
Definition: transformable_interactive_server.h:125
jsk_interactive_marker::TransformableInteractiveServer::setcontrolpose_sub_
ros::Subscriber setcontrolpose_sub_
Definition: transformable_interactive_server.h:108
jsk_interactive_marker::TransformableInteractiveServer::set_x_sub_
ros::Subscriber set_x_sub_
Definition: transformable_interactive_server.h:117
jsk_interactive_marker::TransformableInteractiveServer::focus_object_marker_name_pub_
ros::Publisher focus_object_marker_name_pub_
Definition: transformable_interactive_server.h:143
ros::ServiceServer
jsk_interactive_marker::TransformableInteractiveServer::strict_tf_
bool strict_tf_
Definition: transformable_interactive_server.h:152
jsk_interactive_marker::TransformableInteractiveServer::focus_pose_text_pub_
ros::Publisher focus_pose_text_pub_
Definition: transformable_interactive_server.h:142
jsk_interactive_marker::TransformableInteractiveServer::setcolor_sub_
ros::Subscriber setcolor_sub_
Definition: transformable_interactive_server.h:106
mutex
boost::mutex mutex
Definition: bounding_box_marker.cpp:44
jsk_interactive_marker::TransformableInteractiveServer::marker_dimensions_pub_
ros::Publisher marker_dimensions_pub_
Definition: transformable_interactive_server.h:135
jsk_interactive_marker::TransformableObject
Definition: transformable_object.h:19
processFeedback
void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
Definition: bounding_box_marker.cpp:58
jsk_interactive_marker::TransformableInteractiveServer::get_focus_srv_
ros::ServiceServer get_focus_srv_
Definition: transformable_interactive_server.h:129
jsk_interactive_marker::TransformableInteractiveServer::set_color_srv_
ros::ServiceServer set_color_srv_
Definition: transformable_interactive_server.h:128
jsk_interactive_marker::TransformableInteractiveServer::set_h_sub_
ros::Subscriber set_h_sub_
Definition: transformable_interactive_server.h:116
jsk_interactive_marker::TransformableInteractiveServer::get_color_srv_
ros::ServiceServer get_color_srv_
Definition: transformable_interactive_server.h:127
jsk_interactive_marker::TransformableInteractiveServer::tf_timer
ros::Timer tf_timer
Definition: transformable_interactive_server.h:154
parent_and_child_interactive_marker_server.h
jsk_interactive_marker::TransformableInteractiveServer::setpose_sub_
ros::Subscriber setpose_sub_
Definition: transformable_interactive_server.h:107
ros::TimerEvent
jsk_interactive_marker::TransformableInteractiveServer::get_control_pose_srv_
ros::ServiceServer get_control_pose_srv_
Definition: transformable_interactive_server.h:124
jsk_interactive_marker::TransformableInteractiveServer::config_srv_
std::shared_ptr< dynamic_reconfigure::Server< InteractiveSettingConfig > > config_srv_
Definition: transformable_interactive_server.h:138
interactive_markers::InteractiveMarkerServer
transform_listener.h
jsk_interactive_marker::TransformableInteractiveServer::request_marker_operate_srv_
ros::ServiceServer request_marker_operate_srv_
Definition: transformable_interactive_server.h:136
jsk_interactive_marker::TransformableInteractiveServer::set_z_sub_
ros::Subscriber set_z_sub_
Definition: transformable_interactive_server.h:119
dummy_camera.frame_id
frame_id
Definition: dummy_camera.py:10
interactive_marker_server.h
yaml_menu_handler.h
transformable_object.h
std
jsk_interactive_marker::TransformableInteractiveServer::pose_with_name_pub_
ros::Publisher pose_with_name_pub_
Definition: transformable_interactive_server.h:145
jsk_interactive_marker::TransformableInteractiveServer::transformable_objects_map_
map< string, TransformableObject * > transformable_objects_map_
Definition: transformable_interactive_server.h:147
jsk_interactive_marker::TransformableInteractiveServer::set_dimensions_srv
ros::ServiceServer set_dimensions_srv
Definition: transformable_interactive_server.h:133
jsk_interactive_marker::TransformableInteractiveServer::setcontrol_relative_sub_
ros::Subscriber setcontrol_relative_sub_
Definition: transformable_interactive_server.h:112
jsk_interactive_marker::TransformableInteractiveServer::focus_object_marker_name_
std::string focus_object_marker_name_
Definition: transformable_interactive_server.h:101
jsk_interactive_marker::TransformableInteractiveServer::get_type_srv_
ros::ServiceServer get_type_srv_
Definition: transformable_interactive_server.h:131
jsk_interactive_marker::TransformableInteractiveServer::set_r_sub_
ros::Subscriber set_r_sub_
Definition: transformable_interactive_server.h:114
jsk_interactive_marker::TransformableInteractiveServer::addpose_relative_sub_
ros::Subscriber addpose_relative_sub_
Definition: transformable_interactive_server.h:110
config
config
ros::Timer
jsk_interactive_marker::TransformableInteractiveServer::yaml_menu_handler_ptr_
std::shared_ptr< YamlMenuHandler > yaml_menu_handler_ptr_
Definition: transformable_interactive_server.h:155
jsk_interactive_marker::TransformableInteractiveServer::pose_pub_
ros::Publisher pose_pub_
Definition: transformable_interactive_server.h:144
jsk_interactive_marker::TransformableInteractiveServer::addpose_sub_
ros::Subscriber addpose_sub_
Definition: transformable_interactive_server.h:109
ros::NodeHandle
ros::Subscriber
jsk_interactive_marker::TransformableInteractiveServer::hide_srv_
ros::ServiceServer hide_srv_
Definition: transformable_interactive_server.h:121
jsk_interactive_marker::TransformableInteractiveServer
Definition: transformable_interactive_server.h:37
jsk_interactive_marker::TransformableInteractiveServer::n_
ros::NodeHandle * n_
Definition: transformable_interactive_server.h:102
jsk_interactive_marker::TransformableInteractiveServer::torus_vdiv_
int torus_vdiv_
Definition: transformable_interactive_server.h:150


jsk_interactive_marker
Author(s): furuta
autogenerated on Fri Aug 2 2024 08:50:24