Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

SNCRZ30.h

Go to the documentation of this file.
00001 /* Copyright (C) 2004 Dominic Letourneau (dominic.letourneau@usherbrooke.ca)
00002 
00003    This library is free software; you can redistribute it and/or
00004    modify it under the terms of the GNU Lesser General Public
00005    License as published by the Free Software Foundation; either
00006    version 2.1 of the License, or (at your option) any later version.
00007    
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Lesser General Public License for more details.
00012    
00013    You should have received a copy of the GNU Lesser General Public
00014    License along with this library; if not, write to the Free Software
00015    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00016 */
00017 
00018 #ifndef _SNCRZ30_H_
00019 #define _SNCRZ30_H_
00020 
00021 #include <string>
00022 #include "SocketStream.h"
00023 #include "Image.h"
00024 #include "BufferedNode.h"
00025 
00026 //First prototype of Sony SNC-RZ30N network camera
00027 //(C) Dominic Letourneau 2004
00028 
00029 namespace RobotFlow {
00030 
00031 class SNCRZ30 : public FD::BufferedNode{
00032 
00033  public:
00034 
00035   SNCRZ30(std::string nodeName, FD::ParameterSet params);
00036 
00037   ~SNCRZ30();
00038   
00039   SNCRZ30(const std::string &host, int port = 80);
00040 
00041   virtual void calculate(int output_id, int count, FD::Buffer &out);
00042 
00043   int connect(const std::string &host);
00044 
00045   void send_pan_tilt_absolute_position(unsigned int pan_speed, int pan_position, unsigned int tilt_speed, int tilt_position);
00046 
00047   void send_pan_tilt_relative_position(unsigned int pan_speed, int pan_position, unsigned int tilt_speed, int tilt_position);
00048 
00049   void send_zoom_position(unsigned int zoom_position);
00050 
00051   void send_focus_position(unsigned int focus_position);
00052 
00053   void send_auto_pan_tilt_speed_off();
00054 
00055   void reset();
00056 
00057   void home();
00058 
00059   virtual void initialize();
00060 
00061   void inquiry_pan_tilt(int &pan_position, int &tilt_position);
00062 
00063   void inquiry_zoom(int &zoom_position);
00064 
00065  private:
00066 
00067   int process_image_data(char* data, int data_size);
00068 
00069   int single_grab();
00070 
00071   int update_data();
00072 
00073 
00074   FD::network_socket m_imageSocket;
00075   FD::network_socket m_dataSocket;
00076 
00077 
00078   //inputs
00079   int m_panAbsInID;
00080   int m_tiltAbsInID;
00081   int m_panRelInID;
00082   int m_tiltRelInID;
00083   int m_zoomAbsInID;
00084   int m_zoomRelInID;
00085 
00086   //outputs
00087   int m_panAbsOutID;
00088   int m_tiltAbsOutID;
00089   int m_zoomOutID;
00090   int m_imageOutID;
00091 
00092   //parameters
00093   std::string m_host;
00094   int m_port;
00095   int m_panSpeed;
00096   int m_tiltSpeed;
00097   int m_transmitSpeed;
00098   bool m_continuous;
00099   bool m_wait_reply;
00100 
00101   //variables
00102   Image m_image;
00103   int m_currentPan;
00104   int m_currentTilt;
00105   int m_currentZoom;
00106   bool m_inquiryPosition;
00107 
00108 };
00109 
00110 }//namespace RobotFlow
00111 
00112 #endif

Generated on Wed Oct 5 14:36:12 2005 for RobotFlow by  doxygen 1.4.4