Gazebo

MonoCameraSensor.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: A persepective X11 OpenGL Camera Sensor
00022  * Author: Nate Koenig
00023  * Date: 15 July 2003
00024  * CVS: $Id: CameraSensor.hh 208 2008-01-05 15:33:33Z robotos $
00025  */
00026 
00027 #ifndef MONOCAMERASENSOR_HH
00028 #define MONOCAMERASENSOR_HH
00029 
00030 #include <OgrePrerequisites.h>
00031 #include <OgreTexture.h>
00032 
00033 #include "CameraSensor.hh"
00034 
00035 // Forward Declarations
00036 namespace Ogre
00037 {
00038   class TexturePtr;
00039   class RenderTarget;
00040   class Camera;
00041   class Viewport;
00042   class SceneNode;
00043 }
00044 
00045 namespace gazebo
00046 {
00052 // \{
00053 
00054 
00060 class MonoCameraSensor : public CameraSensor
00061 {
00063   public: MonoCameraSensor(Body *body);
00064 
00066   public: virtual ~MonoCameraSensor();
00067 
00070   protected: virtual void LoadChild( XMLConfigNode *node );
00071 
00073   protected: virtual void InitChild();
00074 
00076   protected: virtual void UpdateChild(UpdateParams &params);
00077 
00079   protected: virtual void FiniChild();
00080 
00082   public: virtual std::string GetMaterialName() const;
00083 
00085   public: virtual const unsigned char *GetImageData(unsigned int i=0);
00086 
00087   // Save the camera frame
00088   private: void SaveFrame();
00089 
00090   private: Ogre::TexturePtr renderTexture;
00091   private: Ogre::RenderTarget *renderTarget;
00092 
00093   private: std::string ogreTextureName;
00094   private: std::string ogreMaterialName;
00095 };
00096 
00099 }
00100 #endif
00101 

Last updated Aug 04 2007