This is an example for steering the PTU manually. Use w, s, a, d to steer camera, <space> or q to exit.
- Author
- MIP
#include <Base/Common/BIASpragma.hh>
#include <PanTilt/DPPanTiltControl.hh>
#ifdef WIN32
#include <conio.h>
#else // WIN32
#include <ncurses.h>
#endif // WIN32
#include <PanTilt/PanTiltControlInterface.hh>
#include <PanTilt/PanTiltManualControl.hh>
#include <PanTilt/PanTiltAutoControl.hh>
using namespace std;
using namespace BIAS;
int main (int argc, char *argv[]){
#ifndef WIN32
initscr();
keypad(stdscr, true);
noecho();
cbreak();
mvprintw(0,0,"PanTilt Manual Control");
mvprintw(2,0,"Use w, s, a, d to steer camera, <space> or q to exit.");
#endif // WIN32
string device;
#ifdef WIN32
device = "COM1";
#else
device = "/dev/ttyUSB0";
#endif
bool loop = true;
while (loop) {
char c = getch();
switch(c) {
case 'e':
break;
case 'r':
break;
case 'q':
loop = false;
break;
}
}
#ifndef WIN32
endwin();
#endif // WIN32
delete control;
return 0;
}