orbit quickcam control

rob shaw rob at haptek.com
Sat Apr 17 21:42:10 GMT 2004


Getting the orbit quickcam to move under program control with OS 9
was enough of a trial-and-error pain that i thought i'd post minimal
code in the (unlikely) case anyone else tries this.  Compile with
VDigProperty.c, available in the ioxperts resources section.

Unfortunately, the serial number supplied by ioxperts doesn't unlock
the 30 minute time limit, and it seems unlikely this bug will be addressed.
The motor functions still work after a half-hour, but the video is disabled.

I'd like to thank Daniel Heckenberg for hints as to how to use vdig calls
rather than sequence grabber calls.

If I find a way around the driver time limit i'll post it, and will put up
an ad hoc web site to post additional code.


//  test program for manipulating two orbit quickcams...
//  using ioxperts mac os9 driver USBWebcam1.1b30
//  delays are necessary after issuing commands to
//  the quickcam to allow the motions to complete.
//  pan and tilt values give relative displacements,
//  1000 units yields about a 15 degree displacement.
//  if you hit the stops, you will lose absolute positioning.
//  values are experimentally determined.
//  rob shaw  april 2004
#include	<stdio.h>
#include	"IOXVideoParams.h"
#include	"VDigProperty.h"

Component		C,C1,C2;
ComponentDescription	Cd;
ComponentInstance		Ci1,Ci2;

void main()
{
long rtn;
unsigned short		val1,val2;

printf("dual quickcam orbit test...\n");

Cd.componentType = 'vdig';
Cd.componentSubType = 0;
Cd.componentManufacturer = 'Ltec';
Cd.componentFlags = 0;
Cd.componentFlagsMask = 0;

C1 = FindNextComponent((Component) 0, &Cd);
C2 = FindNextComponent(C1, &Cd);
Ci1 = OpenComponent(C1);
Ci2 = OpenComponent(C2);

// home the two quickcams
val1 = val2 = 0;
rtn = VDSetVideoParamValue(Ci2, 'ptHm', &val1);
rtn = VDSetVideoParamValue(Ci1, 'ptHm', &val2);
Delay(120,nil);

val1 = val2 = 2000;		// pan right
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(30,nil);
val1 = val2 = -4000;	// pan left
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(40,nil);
val1 = val2 = 4000;		// pan right
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(40,nil);
val1 = val2 = -2000;	// back to center
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(30,nil);
val1 = val2 = 1500;		// tilt down
rtn = VDSetVideoParamValue(Ci2, 'TilD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'TilD', &val1);
Delay(30,nil);
val1 = val2 = -3000;	// tilt up
rtn = VDSetVideoParamValue(Ci2, 'TilD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'TilD', &val1);
Delay(30,nil);
val1 = val2 = 1500;		// back to center
rtn = VDSetVideoParamValue(Ci2, 'TilD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'TilD', &val1);
Delay(30,nil);
val2 = 2000;
val1 = -2000;			// cross eyes
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(30,nil);
val2 = -2000;
val1 = 2000;			// back to center
rtn = VDSetVideoParamValue(Ci2, 'PanD', &val2);
rtn = VDSetVideoParamValue(Ci1, 'PanD', &val1);
Delay(30,nil);

CloseComponent(Ci1);
CloseComponent(Ci2);
ExitToShell();
}




More information about the Video-Developers mailing list