From 4fc9c6566bfecd78e56546b1f5ce9e188421944c Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 16 Aug 2018 18:13:54 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20du=20probl=C3=A8me=20de=20fra?= =?UTF-8?q?me=5Fid=20des=20header=20(RvizInterface)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - README.md~ | 9 +++++---- ongoing/pcl_tests/src/plannar_segmentation.cpp | 4 ++-- rviz_interface/launch/interface.launch | 1 + rviz_interface/launch/interface.launch~ | 1 + rviz_interface/launch/interface_matching.launch | 1 + rviz_interface/launch/interface_matching.launch~ | 4 +++- rviz_interface/launch/interface_plannar_seg.launch | 4 +++- rviz_interface/launch/interface_plannar_seg.launch~ | 5 +++-- rviz_interface/msg/StateSpace.msg | 4 ++-- rviz_interface/msg/StateSpace.msg~ | 12 ++++++------ rviz_interface/src/InteractiveObject.cpp | 8 ++++---- rviz_interface/src/InteractiveObject.hpp | 4 ++-- rviz_interface/src/RvizInterface.cpp | 8 ++++---- 14 files changed, 37 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index db99591..2ac40fb 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Thus refrences are required for the module to work properly. It can be loaded th ### Done ### Todo -rviz_interface - InteractiveObject : Solve the issue with the frame_id, so it could be chosen in the launch file. asift_matching - ASIFT_matcher : Issue on total number of match (after filtering ?). asift_matching - ROS_matcher : Working loader of images for reference. asift_matching - ROS_matcher : Improve reactivity. Slow process due to the message queue length ? diff --git a/README.md~ b/README.md~ index a303d28..db99591 100644 --- a/README.md~ +++ b/README.md~ @@ -30,10 +30,11 @@ Thus refrences are required for the module to work properly. It can be loaded th ### Done ### Todo -ASIFT_matcher : Issue on total number of match (after filtering ?). -ROS_matcher : Working loader of images for reference. -ROS_matcher : Improve reactivity. Slow process due to the message queue length ? -ROS_matcher : Swap the callback function to a service called for matching. +rviz_interface - InteractiveObject : Solve the issue with the frame_id, so it could be chosen in the launch file. +asift_matching - ASIFT_matcher : Issue on total number of match (after filtering ?). +asift_matching - ROS_matcher : Working loader of images for reference. +asift_matching - ROS_matcher : Improve reactivity. Slow process due to the message queue length ? +asift_matching - ROS_matcher : Swap the callback function to a service called for matching. ## How to use it ? diff --git a/ongoing/pcl_tests/src/plannar_segmentation.cpp b/ongoing/pcl_tests/src/plannar_segmentation.cpp index 35b64bf..c39bbc7 100644 --- a/ongoing/pcl_tests/src/plannar_segmentation.cpp +++ b/ongoing/pcl_tests/src/plannar_segmentation.cpp @@ -92,7 +92,7 @@ cloud_cb (const sensor_msgs::PointCloud2ConstPtr& input) // geometry_msgs::PointStamped center_msg; rviz_interface::NamedPoint center_msg; - center_msg.name = "6DOF"; + center_msg.name = "foo"; // for (size_t i = 0; i < pcl_output->size (); ++i) // { // if( pcl_output->points[i].x) @@ -134,7 +134,7 @@ int main (int argc, char** argv) // Create a ROS publisher for the output point cloud pub = nh.advertise ("/plane_output", 1); // pubc = nh.advertise ("/object_center", 1); - pubc = nh.advertise ("/RvizInterface/object_center", 1); + pubc = nh.advertise ("/object_center", 1); // printinfo(); // Spin diff --git a/rviz_interface/launch/interface.launch b/rviz_interface/launch/interface.launch index a76559b..f7041ff 100644 --- a/rviz_interface/launch/interface.launch +++ b/rviz_interface/launch/interface.launch @@ -4,6 +4,7 @@ + ["Foo", "KungFoo", "Panda", "Boo"] [3, 2, 1, 0] diff --git a/rviz_interface/launch/interface.launch~ b/rviz_interface/launch/interface.launch~ index 356fe39..ac77ab8 100644 --- a/rviz_interface/launch/interface.launch~ +++ b/rviz_interface/launch/interface.launch~ @@ -3,6 +3,7 @@ + ["Foo", "KungFoo", "Panda", "Boo"] [3, 2, 1, 0] diff --git a/rviz_interface/launch/interface_matching.launch b/rviz_interface/launch/interface_matching.launch index fa2138a..9460e0d 100644 --- a/rviz_interface/launch/interface_matching.launch +++ b/rviz_interface/launch/interface_matching.launch @@ -3,6 +3,7 @@ + ["Foo", "KungFoo", "Panda", "Boo"] [3, 2, 1, 0] diff --git a/rviz_interface/launch/interface_matching.launch~ b/rviz_interface/launch/interface_matching.launch~ index d976f68..84b8b26 100644 --- a/rviz_interface/launch/interface_matching.launch~ +++ b/rviz_interface/launch/interface_matching.launch~ @@ -3,6 +3,8 @@ + + ["Foo", "KungFoo", "Panda", "Boo"] [3, 2, 1, 0] @@ -17,7 +19,7 @@ - + diff --git a/rviz_interface/launch/interface_plannar_seg.launch b/rviz_interface/launch/interface_plannar_seg.launch index 0b207ca..696ecae 100644 --- a/rviz_interface/launch/interface_plannar_seg.launch +++ b/rviz_interface/launch/interface_plannar_seg.launch @@ -2,9 +2,11 @@ - ["6DOF"] + + ["foo"] [0] + diff --git a/rviz_interface/launch/interface_plannar_seg.launch~ b/rviz_interface/launch/interface_plannar_seg.launch~ index ee884f3..0c6f02d 100644 --- a/rviz_interface/launch/interface_plannar_seg.launch~ +++ b/rviz_interface/launch/interface_plannar_seg.launch~ @@ -2,9 +2,10 @@ - ["6DOF"] - [0] + ["foo"] + [0] + diff --git a/rviz_interface/msg/StateSpace.msg b/rviz_interface/msg/StateSpace.msg index 98e0126..5dfd18b 100644 --- a/rviz_interface/msg/StateSpace.msg +++ b/rviz_interface/msg/StateSpace.msg @@ -11,7 +11,7 @@ string name # ORDINARY : General display / compute of the state space without any assumption. # STATE_2D : Expect a 2D position and orientation (Dimension = 3). # STATE_3D : Expect a 3D position and orientation (quaternion) (Dimension = 7). -# STATE_BOOL : Expect a single boolean information (ie bouton on/off) (Dimension = 1). +# STATE_BOOL : Expect a single boolean information (ie on/off button) (Dimension = 1). uint8 ORDINARY=0 uint8 STATE_BOOL=1 uint8 STATE_2D=2 @@ -19,7 +19,7 @@ uint8 STATE_3D=3 uint8 state_type -#Objective type: boolean (true : Juste bouger l'objet) +#Objective type: boolean (true : Just interact with the object without taking in account State Space data) uint8 objective_type #Maximum distance error allowed arround the objective diff --git a/rviz_interface/msg/StateSpace.msg~ b/rviz_interface/msg/StateSpace.msg~ index 6e2a2f6..df87682 100644 --- a/rviz_interface/msg/StateSpace.msg~ +++ b/rviz_interface/msg/StateSpace.msg~ @@ -11,15 +11,15 @@ string name # ORDINARY : General display / compute of the state space without any assumption. # STATE_2D : Expect a 2D position and orientation (Dimension = 3). # STATE_3D : Expect a 3D position and orientation (quaternion) (Dimension = 7). -# STATE_BOOL : Expect a single boolean information (ie bouton on/off) (Dimension = 1). -uint8 ORDINARY=0 -uint8 STATE_2D=1 -uint8 STATE_3D=2 -uint8 STATE_BOOL=3 +# STATE_BOOL : Expect a single boolean information (ie on/off button) (Dimension = 1). +uint8 ORDINARY=0 +uint8 STATE_BOOL=1 +uint8 STATE_2D=2 +uint8 STATE_3D=3 uint8 state_type -#Objective type: boolean (true : Juste bouger l'objet) +#Objective type: boolean (true : Just move the object without taking in account State Space data) uint8 objective_type #Maximum distance error allowed arround the objective diff --git a/rviz_interface/src/InteractiveObject.cpp b/rviz_interface/src/InteractiveObject.cpp index 81a4891..0b5e330 100644 --- a/rviz_interface/src/InteractiveObject.cpp +++ b/rviz_interface/src/InteractiveObject.cpp @@ -9,7 +9,7 @@ unsigned int InteractiveObject::nextObjectID = 1; //Constructeur -InteractiveObject::InteractiveObject(interactive_markers::InteractiveMarkerServer* server, const std::string& name, unsigned int type, unsigned int shape = Marker::CUBE, const tf::Vector3& position) : _name(name), _type(type), _server(server), _showVisuals(true), _followObject(true) +InteractiveObject::InteractiveObject(interactive_markers::InteractiveMarkerServer* server, const std::string& name, const std::string& frame_id, unsigned int type, unsigned int shape = Marker::CUBE, const tf::Vector3& position) : _name(name), _type(type), _server(server), _showVisuals(true), _followObject(true) { _objectID = nextObjectID++; _state.name = name; @@ -26,16 +26,16 @@ InteractiveObject::InteractiveObject(interactive_markers::InteractiveMarkerServe marker.color.b = 0.5; marker.color.a = 1.0; - createInteractiveMarker(marker, position); + createInteractiveMarker(marker, frame_id, position); addButtoncontrol(); } //Construit un InteractiveMarker -void InteractiveObject::createInteractiveMarker(Marker& marker, const tf::Vector3& position) +void InteractiveObject::createInteractiveMarker(Marker& marker, const std::string& frame_id, const tf::Vector3& position) { //// Création d'un marker interactif //// // _int_marker.header.frame_id = "/map"; //Par défaut - _int_marker.header.frame_id = "/camera_rgb_optical_frame"; + _int_marker.header.frame_id = frame_id; _int_marker.header.stamp= ros::Time::now(); _int_marker.name = _name; //ATTENTION ! _int_marker.description = _name; diff --git a/rviz_interface/src/InteractiveObject.hpp b/rviz_interface/src/InteractiveObject.hpp index 126d23e..43b080d 100644 --- a/rviz_interface/src/InteractiveObject.hpp +++ b/rviz_interface/src/InteractiveObject.hpp @@ -36,10 +36,10 @@ protected: ros::Publisher* _visual_pub; public: - InteractiveObject(interactive_markers::InteractiveMarkerServer* server, const std::string& name, unsigned int type, unsigned int shape, const tf::Vector3& position = tf::Vector3(0,0,0)); + InteractiveObject(interactive_markers::InteractiveMarkerServer* server, const std::string& name, const std::string& frame_id, unsigned int type, unsigned int shape, const tf::Vector3& position = tf::Vector3(0,0,0)); //Construit un InteractiveMarker - void createInteractiveMarker(Marker& marker, const tf::Vector3& position = tf::Vector3(0,0,0)); + void createInteractiveMarker(Marker& marker, const std::string& frame_id, const tf::Vector3& position = tf::Vector3(0,0,0)); //Fonction callback du serveur d' InteractiveMarker void processFeedback( const InteractiveMarkerFeedbackConstPtr &feedback ); diff --git a/rviz_interface/src/RvizInterface.cpp b/rviz_interface/src/RvizInterface.cpp index dbebcb1..9a0d21d 100644 --- a/rviz_interface/src/RvizInterface.cpp +++ b/rviz_interface/src/RvizInterface.cpp @@ -54,19 +54,19 @@ RvizInterface::RvizInterface(): _server("RvizInterface") switch(object_types[i]) { case 0: - _objects.push_back(new InteractiveObject(&_server, object_names[i], (int) rviz_interface::StateSpace::ORDINARY, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); + _objects.push_back(new InteractiveObject(&_server, object_names[i], frame_id, (int) rviz_interface::StateSpace::ORDINARY, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); _objects[i]->add6DOFcontrol(); break; case 1: - _objects.push_back(new InteractiveObject(&_server, object_names[i], (int) rviz_interface::StateSpace::STATE_BOOL, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); + _objects.push_back(new InteractiveObject(&_server, object_names[i], frame_id, (int) rviz_interface::StateSpace::STATE_BOOL, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); // _objects[i]->addButtoncontrol(); break; case 2: - _objects.push_back(new InteractiveObject(&_server, object_names[i], (int) rviz_interface::StateSpace::STATE_2D, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); + _objects.push_back(new InteractiveObject(&_server, object_names[i], frame_id, (int) rviz_interface::StateSpace::STATE_2D, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); _objects[i]->add3DOFcontrol(); break; case 3: - _objects.push_back(new InteractiveObject(&_server, object_names[i], (int) rviz_interface::StateSpace::STATE_3D, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); + _objects.push_back(new InteractiveObject(&_server, object_names[i], frame_id, (int) rviz_interface::StateSpace::STATE_3D, (int) visualization_msgs::Marker::SPHERE, tf::Vector3(0,0,0))); _objects[i]->add6DOFcontrol(); break; }