
robolearner
New Zealand
Asked
— Edited

Hi this might sound like a dumb question...
I have a Pan/Tilt bracket with the Wireless Camera mounted to it. I want to have the ability to drive the robot to a location and park up and look around. I can achieve this effect using the horizontal and vertical servo control but would like to control this function either using the keyboard or a joystick.
When I've tried with the joystick control the servos always try to re-center.
Can someone please help me out with this ?
That it how it has been designed, the servos follow the joystick so if the joystick is returned to the home position the camera will return to the home position.
You could set the servos to N/A on joystick 2 and use the $JoystickX2 and $JoystickY2 variables to trigger moving the servos... You could have the joystick position based on the value of $JoystickX2 and $JoystickY2 or you could use the ServoUp and ServoDown command to move the servo up or down if the joystick is moved.
Another thing you could do is get a joystick with out a spring back to center or try to remove the spring that centers the stick from an old one you are ok with breaking
I've not checked this as I don't have a robot with a pan/tilt and joystick to test on at the moment so if it has problems please post and I'll relook at it. But something like this should sort it out.
Set the Joystick 2 servos to NA and tick the box to save the variable in the joystick config.
Add and run this script (adjust to suit).
Hi Rich Sorry its taken me so long to get back to you on this. Your solution worked perfectly
Thanks for your help