|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Controlling the camera with a joystick
This requires you to hold the joystick in a non-centered position if you want the camera to be anywhere but centered.
|
|
#5
|
|||
|
|||
|
Re: Controlling the camera with a joystick
Quote:
![]() |
|
#6
|
|||||
|
|||||
|
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. |
|
#7
|
|||||
|
|||||
|
Re: Controlling the camera with a joystick
Quote:
(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
|
|||
|
|||
|
Re: Controlling the camera with a joystick
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?
|
|
#9
|
|||
|
|||
|
Re: Controlling the camera with a joystick
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?
|
|
#10
|
|||
|
|||
|
Re: Controlling the camera with a joystick
Got it, thanks.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |