View Single Post
  #9   Spotlight this post!  
Unread 09-11-2010, 21:20
sithmonkey13's Avatar
sithmonkey13 sithmonkey13 is offline
Registered User
AKA: Nathan
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: St. Louis
Posts: 70
sithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to all
Re: How to rotate camera to target; motor to the angle of the camera

Quote:
Originally Posted by whcirobotics View Post
Is there a way to move the camera first .. make it look for the target. as soon as it finds it, turn the robot to the direction which the camera is lookiing,(which would be target)?

I don't know about in autonomous, but one of my first programming challenges I was given last year was to program the 2009 gimbal to take input from a joystick. Figuring out a way to have the camera move on the servo, and then have the robot read the servo position and rotate to that angle would be complex, but if I get time, (and my LabView stops crashing) I will look into some sample code.

For using a joystick in Teleop, just throw in a Joystick Get, use an unbundle by name, and attach it to the axes output. Run each axis to a mathematical equation box, which contains the formula (for the 2009 KoP joysticks) ((X+1)*85), then run the output to a servo set VI. IF that did not make sense, check out the picture included (Note: the example used is from a complex test code I wrote for a "super" bot, so there are lines of code all over, if you can understand it great, if not, PM me and I'll try and find a clearer pic)
Attached Thumbnails
Click image for larger version

Name:	Joystick to Servo VI.1.JPG
Views:	52
Size:	118.7 KB
ID:	9417  
Reply With Quote