PTU46 Pan Tilt Unit Driver Copyright (C) 2009 Erik Karulf (erik@cse.wustl.edu) More...
#include <ptu46_driver.h>
Public Member Functions | |
| float | GetMax (char type) |
| float | GetMaxSpeed (char type) |
| float | GetMin (char type) |
| float | GetMinSpeed (char type) |
| char | GetMode () |
| float | GetPosition (char type) |
| float | GetResolution (char type) |
| float | GetSpeed (char type) |
| bool | isOpen () |
| PTU46 (const char *port, int rate) | |
| bool | SetMode (char type) |
| bool | SetPosition (char type, float pos, bool Block=false) |
| bool | SetSpeed (char type, float speed) |
| ~PTU46 () | |
Protected Member Functions | |
| void | Disconnect () |
| int | Write (const char *data, int length=0) |
Protected Attributes | |
| char | buffer [PTU46_BUFFER_LEN+1] |
| read buffer More... | |
| int | fd |
| serial port descriptor More... | |
| struct termios | oldtio |
| old terminal settings More... | |
| float | pr |
| pan resolution (rads/count) More... | |
| float | tr |
| tilt resolution (rads/count) More... | |
Private Member Functions | |
| int | GetLimit (char type, char LimType) |
| float | GetRes (char type) |
Private Attributes | |
| int | PMax |
| Max Pan in Counts. More... | |
| int | PMin |
| Min Pan in Counts. More... | |
| int | PSMax |
| Max Pan Speed in Counts/second. More... | |
| int | PSMin |
| Min Pan Speed in Counts/second. More... | |
| int | TMax |
| Max Tilt in Counts. More... | |
| int | TMin |
| Min Tilt in Counts. More... | |
| int | TSMax |
| Max Tilt Speed in Counts/second. More... | |
| int | TSMin |
| Min Tilt Speed in Counts/second. More... | |
PTU46 Pan Tilt Unit Driver Copyright (C) 2009 Erik Karulf (erik@cse.wustl.edu)
Player - One Hell of a Robot Server Copyright (C) 2000 Brian Gerkey & Kasper Stoy gerkey@usc.edu kaspers@robotics.usc.edu
Author: Toby Collett (University of Auckland) Date: 2003-02-10
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Definition at line 58 of file ptu46_driver.h.
| PTU46::PTU46::PTU46 | ( | const char * | port, |
| int | rate | ||
| ) |
Constructor - opens port
| port | Filename where PTU is connected |
| rate | rate Baud rate to use |
Definition at line 64 of file ptu46_driver.cc.
| PTU46::PTU46::~PTU46 | ( | ) |
Definition at line 225 of file ptu46_driver.cc.
|
protected |
Cleanly disconnect
Definition at line 229 of file ptu46_driver.cc.
|
private |
Get limiting position/speed in counts or counts/second
| type | 'p' or 't' (pan or tilt) |
| LimType | {'n', 'x', 'l', 'u'} (min position, max position, min speed, max speed) |
Definition at line 282 of file ptu46_driver.cc.
|
inline |
| type | 'p' or 't' |
Definition at line 102 of file ptu46_driver.h.
|
inline |
| type | 'p' or 't' |
Definition at line 117 of file ptu46_driver.h.
|
inline |
| type | 'p' or 't' |
Definition at line 95 of file ptu46_driver.h.
|
inline |
| type | 'p' or 't' |
Definition at line 110 of file ptu46_driver.h.
| char PTU46::PTU46::GetMode | ( | ) |
Get the control mode, position or velocity
Definition at line 436 of file ptu46_driver.cc.
| float PTU46::PTU46::GetPosition | ( | char | type | ) |
| type | 'p' or 't' |
Definition at line 305 of file ptu46_driver.cc.
|
private |
Get radian/count resolution
| type | 'p' or 't' |
Definition at line 259 of file ptu46_driver.cc.
|
inline |
| type | 'p' or 't' |
Definition at line 87 of file ptu46_driver.h.
| float PTU46::PTU46::GetSpeed | ( | char | type | ) |
| type | 'p' or 't' |
Definition at line 362 of file ptu46_driver.cc.
|
inline |
Definition at line 67 of file ptu46_driver.h.
| bool PTU46::PTU46::SetMode | ( | char | type | ) |
Set the control mode, position or velocity
| type | 'v' for velocity, 'i' for position |
Definition at line 416 of file ptu46_driver.cc.
| bool PTU46::PTU46::SetPosition | ( | char | type, |
| float | pos, | ||
| bool | Block = false |
||
| ) |
Moves the PTU to the desired position. If Block is true, the call blocks until the desired position is reached
| type | 'p' or 't' |
| pos | desired position in radians |
| Block | block until ready |
Definition at line 329 of file ptu46_driver.cc.
| bool PTU46::PTU46::SetSpeed | ( | char | type, |
| float | speed | ||
| ) |
Sets the desired speed in radians/second
| type | 'p' or 't' |
| speed | desired speed in radians/second |
Definition at line 387 of file ptu46_driver.cc.
|
protected |
Write Data to PTU
| data | |
| length | number of chars (default=0) |
Definition at line 239 of file ptu46_driver.cc.
|
protected |
read buffer
Definition at line 190 of file ptu46_driver.h.
|
protected |
serial port descriptor
Definition at line 187 of file ptu46_driver.h.
|
protected |
old terminal settings
Definition at line 188 of file ptu46_driver.h.
|
private |
Max Pan in Counts.
Definition at line 175 of file ptu46_driver.h.
|
private |
Min Pan in Counts.
Definition at line 174 of file ptu46_driver.h.
|
protected |
pan resolution (rads/count)
Definition at line 185 of file ptu46_driver.h.
|
private |
Max Pan Speed in Counts/second.
Definition at line 181 of file ptu46_driver.h.
|
private |
Min Pan Speed in Counts/second.
Definition at line 180 of file ptu46_driver.h.
|
private |
Max Tilt in Counts.
Definition at line 173 of file ptu46_driver.h.
|
private |
Min Tilt in Counts.
Definition at line 172 of file ptu46_driver.h.
|
protected |
tilt resolution (rads/count)
Definition at line 184 of file ptu46_driver.h.
|
private |
Max Tilt Speed in Counts/second.
Definition at line 179 of file ptu46_driver.h.
|
private |
Min Tilt Speed in Counts/second.
Definition at line 178 of file ptu46_driver.h.