Fawkes API  Fawkes Development Version
pantilt.cpp
1 
2 /***************************************************************************
3  * pantilt.cpp - Abstract class defining a pan/tilt camera controller
4  *
5  * Created: Tue Apr 21 22:39:20 2009
6  * Copyright 2009 Tobias Kellner
7  * 2005-2009 Tim Niemueller [www.niemueller.de]
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #include <fvcams/control/pantilt.h>
26 
27 namespace firevision {
28 
29 /** @class CameraControlPanTilt <fvcams/control/pantilt.h>
30  * Camera pan/tilt control interface.
31  * Some cameras feature an actuator to allow for panning and tilting the
32  * camera.
33  *
34  * This interface shall be implemented by such cameras or for other external
35  * units for panning and tilting.
36  *
37  * @author Tim Niemueller
38  * @author Tobias Kellner
39  *
40  * @fn void CameraControlPanTilt::process_pantilt() = 0
41  * Process pan/tilt information.
42  * Some operations allow for asynchronous usage (like fetching pan/tilt data).
43  * This is because some cameras need some time to retrieve the information and
44  * thus it is a good idea to let that run besides the image processing loop. With
45  * process_control the incoming information is processed.
46  *
47  * @fn bool CameraControlPanTilt::supports_pan() = 0
48  * Check whether this controller supports panning.
49  * @return true if panning is supported
50  *
51  * @fn bool CameraControlPanTilt::supports_tilt() = 0
52  * Check whether this controller supports tilting.
53  * @return true if tilting is supported
54  *
55  * @fn void CameraControlPanTilt::set_pan(int pan) = 0
56  * Set pan value.
57  * The pan value is dependent on the camera control. See the implementations
58  * documentation for details.
59  * @param pan new pan value
60  *
61  * @fn void CameraControlPanTilt::set_tilt(int tilt) = 0
62  * Set tilt value.
63  * The tilt value is dependent on the camera control. See the implementations
64  * documentation for details.
65  * @param tilt new tilt value
66  *
67  * @fn void CameraControlPanTilt::set_pan_tilt(int pan, int tilt) = 0
68  * Set pan and tilt in one go.
69  * Sometimes camera controls have a command for setting pan and tilt at the
70  * same time. If possible this should be preferred since is minimizes the
71  * number of required operations and communication acts. See the
72  * implementations documentation for details.
73  * @param pan new pan value
74  * @param tilt new tilt value
75  *
76  * @fn void CameraControlPanTilt::set_pan_tilt_rad(float pan, float tilt) = 0
77  * Set pan and tilt as float value.
78  * You give a radiant value where the camera should head relative to the basic
79  * camera position. Implementations shall look forward (center the camera) for
80  * if pan equals zero, look right if the pan is positive and left is the pan is
81  * negative, they shall look forward (vertically centered) if tilt is zero,
82  * upwards if tilt is negative and downwards if tilt is positive.
83  * @param pan new pan value in radiant
84  * @param tilt new tilt value in radiant
85  *
86  * @fn int CameraControlPanTilt::pan() = 0
87  * Get pan value
88  * @return camera control specific pan value
89  *
90  * @fn int CameraControlPanTilt::tilt() = 0
91  * Get tilt value
92  * @return camera control specific tilt value
93  *
94  * @fn void CameraControlPanTilt::start_get_pan_tilt() = 0
95  * Start asynchronous fetch operation for pan and tilt values.
96  * This will initiate fetching the pan and tilt values but will not wait until
97  * the values have been received but will return immediately (non-blocking).
98  *
99  * @fn void CameraControlPanTilt::pan_tilt(int &pan, int &tilt) = 0
100  * Get pan and tilt at the same time.
101  * This will store the current pan and tilt values in the given arguments.
102  * @param pan contains current pan after call
103  * @param tilt contains current tilt after call
104  *
105  * @fn void CameraControlPanTilt::pan_tilt_rad(float &pan, float &tilt) = 0
106  * Get pan and tilt at the same time in radiant.
107  * This will store the current pan and tilt values in the given arguments.
108  * @param pan contains current pan after call
109  * @param tilt contains current tilt after call
110  * @see set_pan_tilt_rad()
111  *
112  * @fn int CameraControlPanTilt::min_pan()
113  * Get minimum pan value.
114  * @return minimum camera-specific pan value
115  *
116  * @fn int CameraControlPanTilt::max_pan()
117  * Get maximum pan value.
118  * @return maximum camera-specific pan value
119  *
120  * @fn int CameraControlPanTilt::min_tilt()
121  * Get minimum tilt value.
122  * @return minimum camera-specific tilt value
123  *
124  * @fn int CameraControlPanTilt::max_tilt()
125  * Get maximum tilt value.
126  * @return maximum camera-specific tilt value
127  *
128  * @fn void CameraControlPanTilt::reset_pan_tilt()
129  * Bring camera into home position.
130  * After the reset the camera shall look forward (horizontally and
131  * vertically centered "home" position).
132  *
133  * @fn void CameraControlPanTilt::set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down) = 0
134  * Set pan/tilt limits.
135  * Some camera controls allow for extra constraints to the min and max pan/tilt
136  * values.
137  * @param pan_left new minimum pan limit
138  * @param pan_right new maximum pan limit
139  * @param tilt_up new minimum tilt limit
140  * @param tilt_down new maximum tilt limit
141  *
142  * @fn void CameraControlPanTilt::reset_pan_tilt_limit() = 0
143  * Reset pan/tilt limits.
144  * This removes all limits from the pan/tilt methods thus the only constraints
145  * are hardware induced.
146  */
147 
148 /** Empty virtual destructor. */
150 {
151 }
152 
153 } // end namespace firevision
firevision::CameraControlPanTilt::~CameraControlPanTilt
virtual ~CameraControlPanTilt()
Empty virtual destructor.
Definition: pantilt.cpp:156