7 #ifndef _PTU46_DRIVER_H_
8 #define _PTU46_DRIVER_H_
13 #define PTU46_DEFAULT_BAUD 9600
14 #define PTU46_BUFFER_LEN 255
15 #define PTU46_DEFAULT_PORT "/dev/ttyUSB1"
16 #define PTU46_DEFAULT_HZ 10
20 #define PTU46_TILT 't'
23 #define PTU46_MIN_SPEED 'l'
24 #define PTU46_MAX_SPEED 'u'
25 #define PTU46_VELOCITY 'v'
26 #define PTU46_POSITION 'i'
63 PTU46(
const char* port,
int rate);
75 float GetPosition (
char type);
81 float GetSpeed (
char type);
96 return GetResolution(type)*(type ==
PTU46_TILT ? TMin : PMin);
103 return GetResolution(type)*(type ==
PTU46_TILT ? TMax : PMax);
111 return GetResolution(type)*(type ==
PTU46_TILT ? TSMin : PSMin);
118 return GetResolution(type)*(type ==
PTU46_TILT ? TSMax : PSMax);
131 bool SetPosition (
char type,
float pos,
bool Block =
false);
139 bool SetSpeed (
char type,
float speed);
146 bool SetMode (
char type);
159 float GetRes (
char type);
167 int GetLimit (
char type,
char LimType);
188 struct termios oldtio;
198 int Write(
const char * data,
int length = 0);
float GetMaxSpeed(char type)
int TMax
Max Tilt in Counts.
PTU46 Pan Tilt Unit Driver Copyright (C) 2009 Erik Karulf (erik@cse.wustl.edu)
float GetMinSpeed(char type)
float tr
tilt resolution (rads/count)
int PSMin
Min Pan Speed in Counts/second.
int TMin
Min Tilt in Counts.
float GetResolution(char type)
float pr
pan resolution (rads/count)
int PSMax
Max Pan Speed in Counts/second.
int PMin
Min Pan in Counts.
int fd
serial port descriptor
int TSMin
Min Tilt Speed in Counts/second.
int TSMax
Max Tilt Speed in Counts/second.
int PMax
Max Pan in Counts.