interactive_point_cloud.h
Go to the documentation of this file.
1 #ifndef INTERACTIVE_POINT_CLOUD
2 #define INTERACTIVE_POINT_CLOUD
3 
4 #include <ros/ros.h>
5 
8 #include <sensor_msgs/PointCloud2.h>
9 #include <jsk_recognition_msgs/BoundingBoxArray.h>
10 #include <jsk_recognition_msgs/BoundingBoxMovement.h>
11 #include <jsk_recognition_msgs/Int32Stamped.h>
12 #include <geometry_msgs/PoseArray.h>
13 
15 //#include <point_cloud_server/StoreCloudAction.h>
16 #include <pcl/search/kdtree.h>
17 #include <tf/tf.h>
18 #include <tf/transform_listener.h>
19 
20 //#include <object_manipulator/tools/mechanism_interface.h>
21 #include "jsk_interactive_marker/InteractivePointCloudConfig.h"
23 #include <dynamic_reconfigure/server.h>
24 
29 
30 typedef pcl::PointXYZRGB PointT;
31 
32 
34 {
35 public:
36 
38  std::string marker_name,
39  std::string topic_name, std::string server_name);
40 
42 
44  void hide(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback);
45  void handlePoseCallback(const geometry_msgs::PoseStampedConstPtr &ps);
46  void pointCloudAndBoundingBoxCallback(const sensor_msgs::PointCloud2ConstPtr &cloud, const jsk_recognition_msgs::BoundingBoxArrayConstPtr &box, const geometry_msgs::PoseStampedConstPtr &handle);
47  void pointCloudCallback(const sensor_msgs::PointCloud2ConstPtr &cloud);
48  // void handlePoseAndBoundingBoxCallback(const geometry_msgs::PoseStampedConstPtr &ps, const jsk_recognition_msgs::BoundingBoxArrayConstPtr &box);
49  void setHandlePoseCallback(const geometry_msgs::PoseStampedConstPtr &ps);
50  void handlePoseAndBoundingBoxCallback(const jsk_recognition_msgs::Int32StampedConstPtr &index, const geometry_msgs::PoseArrayConstPtr &pa, const jsk_recognition_msgs::BoundingBoxArrayConstPtr &box);
51 private:
52 
53  typedef jsk_interactive_marker::InteractivePointCloudConfig Config;
54  std::shared_ptr <dynamic_reconfigure::Server<Config> > srv_;
56  virtual void configCallback (Config &config, uint32_t level);
57 
60  //typedef message_filters::sync_policies::ExactTime<geometry_msgs::PoseStamped, jsk_recognition_msgs::BoundingBoxArray> SyncHandlePose;
61 
63 
64 
65  void makeMenu();
66 
67  void pickup( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
68 
69  void makeMarker(const sensor_msgs::PointCloud2ConstPtr cloud, float size);
70  void makeMarker(const sensor_msgs::PointCloud2ConstPtr cloud, const jsk_recognition_msgs::BoundingBoxArrayConstPtr box, const geometry_msgs::PoseStampedConstPtr handle, float size);
71 
72  void menuPoint( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
73  void move( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
74 
75  void leftClickPoint( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
76 
77  void markerFeedback( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback);
78 
79  void publishGraspPose();
80  void publishHandPose( geometry_msgs::PoseStamped box_pose);
81 
82  void setMarkerPoseCallback( const geometry_msgs::PoseStampedConstPtr &pose_stamped_msg);
83 
84  std::string marker_name_, topic_;
90  //ros::Subscriber sub_point_cloud_, sub_bounding_box_;
94  //message_filters::Subscriber<geometry_msgs::PoseStamped> sub_handle_pose_;
98  std::shared_ptr<message_filters::Synchronizer<SyncPolicy> >sync_;
99  std::shared_ptr<message_filters::Synchronizer<SyncHandlePose> > sync_handle_;
100 
103 
104  sensor_msgs::PointCloud2 msg_cloud_;
105  double point_size_;
107 
108  geometry_msgs::PoseStamped marker_pose_;
110 
111  sensor_msgs::PointCloud2 current_croud_;
112  jsk_recognition_msgs::BoundingBoxArray current_box_;
113  geometry_msgs::PoseStamped handle_pose_;
117 
118  jsk_recognition_msgs::BoundingBoxMovement box_movement_;
119 };
120 
121 #endif
void pointCloudCallback(const sensor_msgs::PointCloud2ConstPtr &cloud)
jsk_interactive_marker::ParentAndChildInteractiveMarkerServer marker_server_
sensor_msgs::PointCloud2 current_croud_
void makeMarker(const sensor_msgs::PointCloud2ConstPtr cloud, float size)
message_filters::Subscriber< jsk_recognition_msgs::BoundingBoxArray > sub_bounding_box_
ros::Publisher pub_handle_pose_array_
geometry_msgs::PoseStamped handle_pose_
void setHandlePoseCallback(const geometry_msgs::PoseStampedConstPtr &ps)
jsk_recognition_msgs::BoundingBoxArray current_box_
tf::TransformListener tfl_
pa
void markerFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
message_filters::Subscriber< geometry_msgs::PoseStamped > sub_initial_handle_pose_
void move(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
void handlePoseCallback(const geometry_msgs::PoseStampedConstPtr &ps)
void handlePoseAndBoundingBoxCallback(const jsk_recognition_msgs::Int32StampedConstPtr &index, const geometry_msgs::PoseArrayConstPtr &pa, const jsk_recognition_msgs::BoundingBoxArrayConstPtr &box)
interactive_markers::MenuHandler MenuHandler
geometry_msgs::PoseStamped marker_pose_
sensor_msgs::PointCloud2 msg_cloud_
std::shared_ptr< message_filters::Synchronizer< SyncPolicy > > sync_
message_filters::Subscriber< sensor_msgs::PointCloud2 > sub_point_cloud_
message_filters::sync_policies::ExactTime< sensor_msgs::PointCloud2, jsk_recognition_msgs::BoundingBoxArray, geometry_msgs::PoseStamped > SyncPolicy
void setMarkerPoseCallback(const geometry_msgs::PoseStampedConstPtr &pose_stamped_msg)
pcl::PointXYZRGB PointT
message_filters::sync_policies::ExactTime< jsk_recognition_msgs::Int32Stamped, geometry_msgs::PoseArray, jsk_recognition_msgs::BoundingBoxArray > SyncHandlePose
std::shared_ptr< message_filters::Synchronizer< SyncHandlePose > > sync_handle_
message_filters::Subscriber< geometry_msgs::PoseArray > sub_handle_array_
virtual void configCallback(Config &config, uint32_t level)
message_filters::Subscriber< jsk_recognition_msgs::Int32Stamped > sub_selected_index_
void pointCloudAndBoundingBoxCallback(const sensor_msgs::PointCloud2ConstPtr &cloud, const jsk_recognition_msgs::BoundingBoxArrayConstPtr &box, const geometry_msgs::PoseStampedConstPtr &handle)
std::shared_ptr< dynamic_reconfigure::Server< Config > > srv_
jsk_recognition_msgs::BoundingBoxMovement box_movement_
char * index(char *sp, char c)
void hide(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
Clear the cloud stored in this object.
void leftClickPoint(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
void menuPoint(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
void pickup(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
ros::Publisher pub_left_click_relative_
void publishHandPose(geometry_msgs::PoseStamped box_pose)
boost::mutex mutex
jsk_interactive_marker::InteractivePointCloudConfig Config
InteractivePointCloud(std::string marker_name, std::string topic_name, std::string server_name)
interactive_markers::MenuHandler menu_handler_


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