![]() |
Help with Vision Algorithm
Hi,
I am attempting to make an auto line up algorithm with our vision stats. Right now, I am just using the X and Y coordinates to do line up the forward/ back and the side to side of the robot. The problem is that the robot overcompensates most of the time, even when I have a generous range of about 30 pixels(in a 320 x 240 image). I read a lot about how to set up the vision processing, but I really haven't seen much on actually using those values(probably because everyone's robot is different). The summary of the code looks like this: Code:
One of the possible solutions I thought we might try is using PID control, but I haven't ever used it. Can you use PID only sometimes like when the align function is called? Or do you have to then implement it in all areas where you call that motor? Also, I use GRIP if that changes anything. Thanks! |
Re: Help with Vision Algorithm
There's a bunch of ways to go about this, but the basic idea is to define some set of controls that allow you to 'tell the robot to point at a particular direction'. Once you have that, you can:
For an example of using PIDController + NavX in pyfrc simulation to 'go to a particular angle', see this example: https://github.com/robotpy/robotpy-w...otate_to_angle |
| All times are GMT -5. The time now is 00:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi