FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Tweeking posted program to make my bot wheels follow a gimble

Hey guys,

I just got the posted program two servo camera example to work.  I was messing around with it and i tried to replace the servo icons with the correct motor icons to get the entire bot to follow the gimble instead of just the camera. this however is much more difficult then just replacing icons.  If someone can help me make my bot turn left and right autonomously following the gimble and then once the gimble is in the middle of the frame, have the bot go forward until it is x distance from the gimble and then execute a program to score. please help.  It is perferable to be able to just build on the existing two servo camera example that was already posted. tyvm

0 Kudos
Message 1 of 4
(11,410 Views)

Hi maj1k,

I've modified the 2 servo camera example a bit to give you an idea of how to go about synching your robot wheels with your gimble camera mount. The attached code will compare the value from a gyro sensor to the value for the x-axis of the gimble mount, and try to correct the robots orientation to within 3 degrees of the x-axis value for the gimble. You may have to modify the constants connected to the motor Set Speed VIs to correspond to your physical setup. Also, this modified example is just meant to give you a starting point. It doesn't handle full 360 degree following well, and doesn't do anything once you are pointed in the same direction as the gimble.

Just replace the VI in your example project with the one below, and make sure all the motor references for the servos and the jaguars conform to your physical setup.

I hope it helps, and let me know if you have any questions.

Best Regards,

~Nate

NI FIRST Support.

0 Kudos
Message 2 of 4
(3,224 Views)

Have you looked at the following code? http://forums.usfirst.org/showthread.php?t=11298

It doesn't use a gimbal, but does move the robot.

0 Kudos
Message 3 of 4
(3,224 Views)

Okay,

I have looked at that project.  Do i copy the autonomous code and put it in the basic code.  I am kinda confused on what to do here.

0 Kudos
Message 4 of 4
(3,224 Views)