Go to Post Welcome to the world of pros and cons. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2010, 16:42
Dakabt's Avatar
Dakabt Dakabt is offline
Registered User
FRC #2526
 
Join Date: Jan 2010
Location: Minnesota
Posts: 1
Dakabt is an unknown quantity at this point
Controlling the camera with a joystick

Hello I was wondering how (if possible) I would be able to allow a joystick to be used to control the camera on the robot.
  #2   Spotlight this post!  
Unread 22-01-2010, 17:18
lscime lscime is offline
Registered User
AKA: Luke Scime
FRC #2614 (Mountaineer Area RoboticS (MARS))
Team Role: Alumni
 
Join Date: Jun 2008
Rookie Year: 2008
Location: Morgantown, WV
Posts: 73
lscime is a splendid one to beholdlscime is a splendid one to beholdlscime is a splendid one to beholdlscime is a splendid one to beholdlscime is a splendid one to beholdlscime is a splendid one to behold
Re: Controlling the camera with a joystick

Assuming you mean that you want to move the servos on the camera mount using a joystick, yes it is indeed possible.

We've been playing around with such control for about a week. Here is a one method in LabVIEW. Essentially you can tell the servo "goal" position to increment by 1 (or another value) every time the main loop loops if a certain condition is met (i.e. a joystick in a particular position). The servos will constantly goal seek on this new position. We accomplished this by storing the "goal" position in a shift register and incrementing/decrementing/not changing this value depending on a case statement triggered by a joystick.

Again this in LabVIEW but the same principle should apply in Java and C.

Hope this helps,
Student Programmer, Team #2614.
  #3   Spotlight this post!  
Unread 23-01-2010, 04:34
non847 non847 is offline
Registered User
FRC #3089
 
Join Date: Jan 2010
Location: Haifa, Israel
Posts: 3
non847 is an unknown quantity at this point
Re: Controlling the camera with a joystick

how about setting the angle of the servos proportionate to the axes of the joystick? works great!
  #4   Spotlight this post!  
Unread 24-01-2010, 14:24
EricWilliams EricWilliams is offline
Registered User
FRC #2039 (Rockford Robotics)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2001
Location: Rockford, IL
Posts: 102
EricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of light
Re: Controlling the camera with a joystick

Quote:
Originally Posted by non847 View Post
how about setting the angle of the servos proportionate to the axes of the joystick? works great!
This requires you to hold the joystick in a non-centered position if you want the camera to be anywhere but centered.
  #5   Spotlight this post!  
Unread 31-01-2010, 20:13
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: Controlling the camera with a joystick

Quote:
Originally Posted by lscime View Post
Essentially you can tell the servo "goal" position to increment by 1 (or another value) every time the main loop loops if a certain condition is met (i.e. a joystick in a particular position). The servos will constantly goal seek on this new position. We accomplished this by storing the "goal" position in a shift register and incrementing/decrementing/not changing this value depending on a case statement triggered by a joystick.
So, if I understand correctly, In order to run this code, it must be in a while loop INSIDE the initial teleop case structure? I tried doing this and every time, I would get a watchdog error. I know that I didn't have a shift register. Do I need one on each side of the loop?
__________________
In a time... When the greatest comeback occured... There was... MR. FEBRUARY!!!
  #6   Spotlight this post!  
Unread 31-01-2010, 20:38
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Controlling the camera with a joystick

No while loops inside while loops.
Use a shift register and put the code in the main loop.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #7   Spotlight this post!  
Unread 31-01-2010, 21:06
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Controlling the camera with a joystick

Quote:
Originally Posted by lscime View Post
We accomplished this by storing the "goal" position in a shift register and incrementing/decrementing/not changing this value depending on a case statement triggered by a joystick.
You can also do without the shift register. Since the FPGA knows what value you've set the servo to, you can use a Get Angle or Get Position vi to retrieve it, apply whatever modifications you wish to the value, and give it to a Set Angle or Set Position vi.

(If you're changing the value by extremely small amounts, you might need to watch out for rounding errors in the conversion between servo position and PWM value.)
  #8   Spotlight this post!  
Unread 31-01-2010, 23:20
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: Controlling the camera with a joystick

Quote:
Originally Posted by apalrd View Post
No while loops inside while loops.
Use a shift register and put the code in the main loop.
I'm not doing that. In the code this year, the teleop is all inside a case structure. Can I place a while loop inside a case structure?
__________________
In a time... When the greatest comeback occured... There was... MR. FEBRUARY!!!
  #9   Spotlight this post!  
Unread 31-01-2010, 23:26
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: Controlling the camera with a joystick

Quote:
Originally Posted by psychomonkey View Post
I'm not doing that. In the code this year, the teleop is all inside a case structure. Can I place a while loop inside a case structure?
You know what, I just realized that you were referring to the robot main.vi, not the teleop.vi. My apologies. So instead of using the while loop, I should just use comparison vi's on the joysticks to lead to increment vi's inside case structures?
__________________
In a time... When the greatest comeback occured... There was... MR. FEBRUARY!!!
  #10   Spotlight this post!  
Unread 01-02-2010, 21:51
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: Controlling the camera with a joystick

Got it, thanks.
__________________
In a time... When the greatest comeback occured... There was... MR. FEBRUARY!!!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera servo control off of the Joystick axes m3rc1l3ss NI LabVIEW 5 13-03-2009 20:00
Moving Camera Servos With Joystick Button DWirth NI LabVIEW 7 26-02-2009 21:35
Problem with the joystick Asmos NI LabVIEW 5 23-01-2009 09:40
Servos controlling camera and purple screen ryan_f Programming 6 17-01-2006 23:21
controlling with the radio Lord Nerdlinger Programming 2 17-02-2004 22:40


All times are GMT -5. The time now is 10:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi