table_visualization.cpp
Go to the documentation of this file.
00001 
00060 // ROS includes
00061 #include <ros/ros.h>
00062 
00063 #include <cob_3d_visualization/table_visualization.h>
00064 #include <cob_3d_mapping_msgs/GetObjectsOfClass.h>
00065 #include <cob_3d_mapping_msgs/MoveToTable.h>
00066 #include <cob_3d_mapping_msgs/GetTables.h>
00067 
00068 
00069 #include <cob_3d_mapping_msgs/GetGeometryMap.h>
00070 
00071 
00072 void TableVisualization::tableVisualizationCallback (const cob_3d_mapping_msgs::ShapeArrayPtr& ta) {
00073 
00074   // Service request and response
00075   /*cob_3d_mapping_msgs::GetObjectsOfClass::Request reqObject;
00076   cob_3d_mapping_msgs::GetObjectsOfClass::Response resObject;
00077 
00078   cob_3d_mapping_msgs::GetTables::Request reqTable ;
00079   cob_3d_mapping_msgs::GetTables::Response resTable;
00080 
00081   //
00082   if (ros::service::call("/table_extraction/get_objects_of_class",reqObject,resObject)){
00083     ROS_INFO("Service called...");
00084   }
00085 
00086   if (ros::service::call("/table_extraction/get_tables",reqTable,resTable)){
00087     ROS_INFO("Service called...");
00088   }*/
00089 
00090   //  std::cout << "response size: "<< "\t" << res.tables.size() << "\n" ;
00091   /*if (!resTable.tables.empty()){
00092     for (unsigned int i=0;i<resTable.tables.size();i++){
00093       ROS_WARN("table id : %d", i) ;//res.objects.shapes[i].id) ;
00094 //      ROS_WARN("table x_min is: %f , table y_min is: %f", resTable.tables[i].table.x_min , resTable.tables[i].table.y_min);
00095     }
00096   }*/
00097   //    tables->shapes[i] = res.objects.shapes[i] ;
00098   //      boost::shared_ptr<TableMarker> tm(new TableMarker(table_im_server_,res.objects.shapes[i],i)) ;//,ctr_));
00099   //      v_tm_.push_back(tm) ;
00100   //    ctr_ ++ ;
00101 
00102 
00103 
00104   //  std::cout << "response size: "<< "\t" << res.objects.shapes.size() << "\n" ;
00105   if (!ta->shapes.empty()){
00106     for (unsigned int i=0;i<ta->shapes.size();i++){
00107       ROS_WARN("table id : %d", i) ;//res.objects.shapes[i].id) ;
00108 
00109       //    tables->shapes[i] = res.objects.shapes[i] ;
00110       boost::shared_ptr<TableMarker> tm(new TableMarker(table_im_server_,ta->shapes[i],i/*,resTable.tables[i].table*/)) ;//,ctr_));
00111       v_tm_.push_back(tm) ;
00112       //    ctr_ ++ ;
00113     }
00114   }
00115 }
00116 
00117 
00118 int main (int argc, char** argv){
00119   ros::init (argc, argv, "table_visualization");
00120   ROS_INFO("table_visualization node started....");
00121   TableVisualization tablevis;
00122   ros::spin();
00123 }
00124 
00125 
00126 


cob_3d_visualization
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:04:10