SegmentPrototype.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 by Ulrich Friedrich Klank <klank@in.tum.de>
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 #ifndef BLOB_H
00020 #define BLOB_H
00021 
00022 #include "Descriptor.h"
00023 #include <sensor_msgs/PointCloud.h>
00024 
00025 #define XML_NODE_SEGMENTPROTOTYPE "SegmentPrototype"
00026 
00027 namespace cop
00028 {
00029 
00030   sensor_msgs::PointCloud cloud_trans (LocatedObjectID_t swissranger_jlo_id, LocatedObjectID_t ptu_base_jlo_id,  const sensor_msgs::PointCloud& cloud_in);
00031 
00032   class SegmentPrototype :
00033     public Descriptor
00034   {
00035   public:
00036     SegmentPrototype();
00037     SegmentPrototype(std::string sensor_frame, const sensor_msgs::PointCloud& pcd, std::string classname, ObjectID_t id, ObjectID_t class_id);
00038 
00039 
00040     void SaveTo(XMLTag* tag);
00041     virtual void Show(RelPose* pose, Sensor* cam);
00042 
00043     virtual std::string GetNodeName() const{return XML_NODE_SEGMENTPROTOTYPE;}
00044     virtual ElemType_t GetType() const{return DESCRIPTOR_SEGMPROTO;}
00045 
00046     LocatedObjectID_t GetFrameId();
00047     LocatedObjectID_t GetSensorFrameId(const LocatedObjectID_t &id);
00048     void UpdateRefFrame();
00049 
00053     /***
00054     *   SetTable
00055     *   @brief stores the table the cluster was detected on
00056     *   @param id   a lo id where te table is in space and how is the oriantation
00057     *   @param pcd  a point cloud containing all points that were classified as table points
00058     */
00059     void SetTable(const LocatedObjectID_t &id, const sensor_msgs::PointCloud &pcd){m_LastTableID = id; m_mapPCD[id] = pcd;}
00060 
00061     /***
00062     *   GetTable
00063     *   @brief Get the current table
00064     *   @return the lo aid and a point cloudwith table points from the last detection
00065     */
00066     std::pair<LocatedObjectID_t, sensor_msgs::PointCloud> GetTable()
00067     {
00068       std::pair<LocatedObjectID_t, sensor_msgs::PointCloud> pair;
00069       pair.first = m_LastTableID;
00070       pair.second = m_mapPCD[m_LastTableID];
00071       return pair;}
00072 
00073 
00074     /***
00075     *   SetPointCloud
00076     *   @brief stores the clusters that was detected, this list is cleared on each search for clusters,
00077               so on all detected clusters it will contain all other clusters detected at the same time
00078     *   @param id   a lo id where the cluster is in space and how is the oriantation
00079     *   @param pcd  a point cloud containing all points that were classified as cluster points
00080     */
00081     void SetPointCloud(const LocatedObjectID_t &id, const sensor_msgs::PointCloud &pcd, const LocatedObjectID_t &sensor_id);
00086     sensor_msgs::PointCloud GetPointCloud(LocatedObjectID_t id){if(m_mapPCD.find(id) != m_mapPCD.end())return m_mapPCD[id]; else return sensor_msgs::PointCloud();}
00087 
00091     void ClearPointClouds(){m_mapPCD.clear();}
00095     virtual bool GetShape(GeometricShape &objectShape) const;
00096 
00097 
00098     virtual Elem* Duplicate(bool bStaticCopy);
00099     virtual void PropagatePose(RelPose* pose);
00100   protected:
00101     virtual void SetData(XMLTag* tag);
00102   public:
00103     ~SegmentPrototype(void);
00104 
00105   private:
00106     std::map<LocatedObjectID_t, sensor_msgs::PointCloud> m_mapPCD;
00107     LocatedObjectID_t  m_LastTableID;
00108 
00109     std::string m_relFrame;
00110     LocatedObjectID_t  m_frameID;
00111     RelPose* m_relPoseOfRefFrame;
00112     
00113     std::map<LocatedObjectID_t, LocatedObjectID_t>  m_sensorFrameID;
00114   public:
00115     double m_covRotX;
00116     double m_covRotY;
00117     double m_covRotZ;
00118     bool   m_parallel;
00119   };
00120 }
00121 #endif /*BLOB_H*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


cop_sr4_plugins
Author(s): U. Klank
autogenerated on Thu May 23 2013 09:52:16