|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Axis Pan+Tilt Servo issue?
I looked under the example code. Seems the servo's have a 170 degree limit, whereas the joystick has a 360 degree range of motion. I guess that means a joystick is out as a controller. What else can I use to control the camera?
I could try putting Servo Set Angle with a numeric constant within a case structure and wiring it to a joystick button and seeing if that would work. |
|
#2
|
|||
|
|||
|
Re: Axis Pan+Tilt Servo issue?
Update - Here's what I threw together. I may edit the buttons once I get the joystick back in front of my face to see the button layout.
Currently, the code sets the servo's to their home or middle angle. From there, I can mount the camera and have 85 degrees of motion on both pan and tilt. Later on, I'll add more case structures mapped to more/different buttons which move the camera to predefined angles. Good idea, or too much to do during teleop? ![]() |
|
#3
|
||||||
|
||||||
|
Re: Axis Pan+Tilt Servo issue?
While you won't overload the cRIO doing that, it does take some time to program a whole bunch of cases.
|
|
#4
|
|||
|
|||
|
Re: Axis Pan+Tilt Servo issue?
True. I might just end up figuring out the equation and running from there.
|
|
#5
|
||||||
|
||||||
|
Re: Axis Pan+Tilt Servo issue?
I added the output values for the joystick to my previous post, because I realized the documentation wasn't clear at all.
You can use a joystick to control a servo, you just need to use a (simple) equation to scale the joystick value to the range the servo expects. |
|
#6
|
|||
|
|||
|
Re: Axis Pan+Tilt Servo issue?
Oh, I see! I'll try to get both methods working (joystick and case structures) and see which one our drivers prefer. Will post my results tomorrow.
Thanks! |
|
#7
|
||||
|
||||
|
Re: Axis Pan+Tilt Servo issue?
Quote:
The joysticks get function outputs a range of -1 to +1, floating point. So even though the joystick has a larger range of motion in degrees, it is scaled down by a factor of 127. It is then limited to within that range. (256 units) Therefore you have to scale your joysticks between this range of 2 to a range of 170. |
|
#8
|
|||
|
|||
|
Re: Axis Pan+Tilt Servo issue?
I've gotten it to work, thanks everyone for your help!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|