Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * pantilt.cpp - Abstract class defining a pan/tilt camera controller 00004 * 00005 * Created: Tue Apr 21 22:39:20 2009 00006 * Copyright 2009 Tobias Kellner 00007 * 2005-2009 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #include <fvcams/control/pantilt.h> 00026 00027 namespace firevision { 00028 #if 0 /* just to make Emacs auto-indent happy */ 00029 } 00030 #endif 00031 00032 /** @class CameraControlPanTilt <fvcams/control/pantilt.h> 00033 * Camera pan/tilt control interface. 00034 * Some cameras feature an actuator to allow for panning and tilting the 00035 * camera. 00036 * 00037 * This interface shall be implemented by such cameras or for other external 00038 * units for panning and tilting. 00039 * 00040 * @author Tim Niemueller 00041 * @author Tobias Kellner 00042 * 00043 * @fn void CameraControlPanTilt::process_pantilt() = 0 00044 * Process pan/tilt information. 00045 * Some operations allow for asynchronous usage (like fetching pan/tilt data). 00046 * This is because some cameras need some time to retrieve the information and 00047 * thus it is a good idea to let that run besides the image processing loop. With 00048 * process_control the incoming information is processed. 00049 * 00050 * @fn bool CameraControlPanTilt::supports_pan() = 0 00051 * Check whether this controller supports panning. 00052 * @return true if panning is supported 00053 * 00054 * @fn bool CameraControlPanTilt::supports_tilt() = 0 00055 * Check whether this controller supports tilting. 00056 * @return true if tilting is supported 00057 * 00058 * @fn void CameraControlPanTilt::set_pan(int pan) = 0 00059 * Set pan value. 00060 * The pan value is dependent on the camera control. See the implementations 00061 * documentation for details. 00062 * @param pan new pan value 00063 * 00064 * @fn void CameraControlPanTilt::set_tilt(int tilt) = 0 00065 * Set tilt value. 00066 * The tilt value is dependent on the camera control. See the implementations 00067 * documentation for details. 00068 * @param tilt new tilt value 00069 * 00070 * @fn void CameraControlPanTilt::set_pan_tilt(int pan, int tilt) = 0 00071 * Set pan and tilt in one go. 00072 * Sometimes camera controls have a command for setting pan and tilt at the 00073 * same time. If possible this should be preferred since is minimizes the 00074 * number of required operations and communication acts. See the 00075 * implementations documentation for details. 00076 * @param pan new pan value 00077 * @param tilt new tilt value 00078 * 00079 * @fn void CameraControlPanTilt::set_pan_tilt_rad(float pan, float tilt) = 0 00080 * Set pan and tilt as float value. 00081 * You give a radiant value where the camera should head relative to the basic 00082 * camera position. Implementations shall look forward (center the camera) for 00083 * if pan equals zero, look right if the pan is positive and left is the pan is 00084 * negative, they shall look forward (vertically centered) if tilt is zero, 00085 * upwards if tilt is negative and downwards if tilt is positive. 00086 * @param pan new pan value in radiant 00087 * @param tilt new tilt value in radiant 00088 * 00089 * @fn int CameraControlPanTilt::pan() = 0 00090 * Get pan value 00091 * @return camera control specific pan value 00092 * 00093 * @fn int CameraControlPanTilt::tilt() = 0 00094 * Get tilt value 00095 * @return camera control specific tilt value 00096 * 00097 * @fn void CameraControlPanTilt::start_get_pan_tilt() = 0 00098 * Start asynchronous fetch operation for pan and tilt values. 00099 * This will initiate fetching the pan and tilt values but will not wait until 00100 * the values have been received but will return immediately (non-blocking). 00101 * 00102 * @fn void CameraControlPanTilt::pan_tilt(int &pan, int &tilt) = 0 00103 * Get pan and tilt at the same time. 00104 * This will store the current pan and tilt values in the given arguments. 00105 * @param pan contains current pan after call 00106 * @param tilt contains current tilt after call 00107 * 00108 * @fn void CameraControlPanTilt::pan_tilt_rad(float &pan, float &tilt) = 0 00109 * Get pan and tilt at the same time in radiant. 00110 * This will store the current pan and tilt values in the given arguments. 00111 * @param pan contains current pan after call 00112 * @param tilt contains current tilt after call 00113 * @see set_pan_tilt_rad() 00114 * 00115 * @fn int CameraControlPanTilt::min_pan() 00116 * Get minimum pan value. 00117 * @return minimum camera-specific pan value 00118 * 00119 * @fn int CameraControlPanTilt::max_pan() 00120 * Get maximum pan value. 00121 * @return maximum camera-specific pan value 00122 * 00123 * @fn int CameraControlPanTilt::min_tilt() 00124 * Get minimum tilt value. 00125 * @return minimum camera-specific tilt value 00126 * 00127 * @fn int CameraControlPanTilt::max_tilt() 00128 * Get maximum tilt value. 00129 * @return maximum camera-specific tilt value 00130 * 00131 * @fn void CameraControlPanTilt::reset_pan_tilt() 00132 * Bring camera into home position. 00133 * After the reset the camera shall look forward (horizontally and 00134 * vertically centered "home" position). 00135 * 00136 * @fn void CameraControlPanTilt::set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down) = 0 00137 * Set pan/tilt limits. 00138 * Some camera controls allow for extra constraints to the min and max pan/tilt 00139 * values. 00140 * @param pan_left new minimum pan limit 00141 * @param pan_right new maximum pan limit 00142 * @param tilt_up new minimum tilt limit 00143 * @param tilt_down new maximum tilt limit 00144 * 00145 * @fn void CameraControlPanTilt::reset_pan_tilt_limit() = 0 00146 * Reset pan/tilt limits. 00147 * This removes all limits from the pan/tilt methods thus the only constraints 00148 * are hardware induced. 00149 */ 00150 00151 /** Empty virtual destructor. */ 00152 CameraControlPanTilt::~CameraControlPanTilt() 00153 { 00154 } 00155 00156 00157 } // end namespace firevision