gohome.cc

 1 const char *help = "\
 2 progname: gohome.cc\n\
 3 code2html: This program controls a Sony pan/tilt/zoom camera to send it at home position.\n\
 4 version: Torch3 vision2.0, 2003-2005\n\
 5 (c) Sebastien Marcel (marcel@idiap.ch)\n";
 6 
 7 #include "SonyEviD31.h"
 8 #include "SonyEviD100P.h"
 9 
10 using namespace Torch;
11 
12 int main()
13 {
14 	SonyEviD100P camera("/dev/ttyS", '0');
15 
16 	if(camera.connect() == false) return 0;
17 	      
18 	int powerStatus;
19 	
20 	print("Trying to get the power status of the camera.\n");
21 	powerStatus = camera.getPowerStatus();
22 
23 	switch(powerStatus)
24 	{
25 	case -1: 
26 	   	print("Error couldn't get the power status.\n");
27 		break;
28 	case 0: 
29 		print("The camera is OFF.\n");
30 		break;
31 	case 1: 
32 		print("The camera is ON.\n");
33 		camera.goHome();
34 		break;
35 	default: 
36 		print("Unexpected value.\n");
37 	}
38 	
39 	return 1;
40 }