$search
00001 /**************************************************************** 00002 * 00003 * Copyright (c) 2010 00004 * 00005 * Fraunhofer Institute for Manufacturing Engineering 00006 * and Automation (IPA) 00007 * 00008 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 * 00010 * Project name: care-o-bot 00011 * ROS stack name: cob_environment_perception_intern 00012 * ROS package name: cob_3d_mapping_common 00013 * Description: 00014 * 00015 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00016 * 00017 *\author 00018 * Author: Shaghayegh Nazari, email:georg.arbeiter@ipa.fhg.de 00019 * \author 00020 * Supervised by: Georg Arbeiter, email:georg.arbeiter@ipa.fhg.de 00021 * 00022 * Date of creation: 09/2012 00023 * ToDo: 00024 * 00025 * 00026 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00027 * 00028 * Redistribution and use in source and binary forms, with or without 00029 * modification, are permitted provided that the following conditions are met: 00030 * 00031 * * Redistributions of source code must retain the above copyright 00032 * notice, this list of conditions and the following disclaimer. 00033 * * Redistributions in binary form must reproduce the above copyright 00034 * notice, this list of conditions and the following disclaimer in the 00035 * documentation and/or other materials provided with the distribution. 00036 * * Neither the name of the Fraunhofer Institute for Manufacturing 00037 * Engineering and Automation (IPA) nor the names of its 00038 * contributors may be used to endorse or promote products derived from 00039 * this software without specific prior written permission. 00040 * 00041 * This program is free software: you can redistribute it and/or modify 00042 * it under the terms of the GNU Lesser General Public License LGPL as 00043 * published by the Free Software Foundation, either version 3 of the 00044 * License, or (at your option) any later version. 00045 * 00046 * This program is distributed in the hope that it will be useful, 00047 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00048 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00049 * GNU Lesser General Public License LGPL for more details. 00050 * 00051 * You should have received a copy of the GNU Lesser General Public 00052 * License LGPL along with this program. 00053 * If not, see <http://www.gnu.org/licenses/>. 00054 * 00055 ****************************************************************/ 00056 // ROS includes 00057 #include <ros/ros.h> 00058 00059 #include <cob_3d_visualization/table_visualization.h> 00060 #include <cob_3d_mapping_msgs/GetObjectsOfClass.h> 00061 #include <cob_3d_mapping_msgs/MoveToTable.h> 00062 #include <cob_3d_mapping_msgs/GetTables.h> 00063 00064 00065 #include <cob_3d_mapping_msgs/GetGeometryMap.h> 00066 00067 00068 void TableVisualization::tableVisualizationCallback (const cob_3d_mapping_msgs::ShapeArrayPtr& ta) { 00069 00070 // Service request and response 00071 /*cob_3d_mapping_msgs::GetObjectsOfClass::Request reqObject; 00072 cob_3d_mapping_msgs::GetObjectsOfClass::Response resObject; 00073 00074 cob_3d_mapping_msgs::GetTables::Request reqTable ; 00075 cob_3d_mapping_msgs::GetTables::Response resTable; 00076 00077 // 00078 if (ros::service::call("/table_extraction/get_objects_of_class",reqObject,resObject)){ 00079 ROS_INFO("Service called..."); 00080 } 00081 00082 if (ros::service::call("/table_extraction/get_tables",reqTable,resTable)){ 00083 ROS_INFO("Service called..."); 00084 }*/ 00085 00086 // std::cout << "response size: "<< "\t" << res.tables.size() << "\n" ; 00087 /*if (!resTable.tables.empty()){ 00088 for (unsigned int i=0;i<resTable.tables.size();i++){ 00089 ROS_WARN("table id : %d", i) ;//res.objects.shapes[i].id) ; 00090 // ROS_WARN("table x_min is: %f , table y_min is: %f", resTable.tables[i].table.x_min , resTable.tables[i].table.y_min); 00091 } 00092 }*/ 00093 // tables->shapes[i] = res.objects.shapes[i] ; 00094 // boost::shared_ptr<TableMarker> tm(new TableMarker(table_im_server_,res.objects.shapes[i],i)) ;//,ctr_)); 00095 // v_tm_.push_back(tm) ; 00096 // ctr_ ++ ; 00097 00098 00099 00100 // std::cout << "response size: "<< "\t" << res.objects.shapes.size() << "\n" ; 00101 if (!ta->shapes.empty()){ 00102 for (unsigned int i=0;i<ta->shapes.size();i++){ 00103 ROS_WARN("table id : %d", i) ;//res.objects.shapes[i].id) ; 00104 00105 // tables->shapes[i] = res.objects.shapes[i] ; 00106 boost::shared_ptr<TableMarker> tm(new TableMarker(table_im_server_,ta->shapes[i],i/*,resTable.tables[i].table*/)) ;//,ctr_)); 00107 v_tm_.push_back(tm) ; 00108 // ctr_ ++ ; 00109 } 00110 } 00111 } 00112 00113 00114 int main (int argc, char** argv){ 00115 ros::init (argc, argv, "table_visualization"); 00116 ROS_INFO("table_visualization node started...."); 00117 TableVisualization tablevis; 00118 ros::spin(); 00119 } 00120 00121 00122