Go to Post I fear sometimes as time increases between the present and when someone started, some sight of just how hard it can be to field a functioning robot for a young team is lost. - xForceDee [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 08-03-2016, 18:51
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 229
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
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:
visionXvalues = NetworkTables.getArray('centerX', self.centerX)
visionYvalues = NetworkTables.getArray('centerY', self.centerY)

if visionXvalues > 180:
     TURN
elif visionXvalues < 120:
     TURN
else:
     DO NOTHING

if visionYvalues > 110:
     GO FORWARD
elif visionYvalues < 80:
     GO BACK
else:
     DO NOTHING
For the turning and such it is merely just me doing "self.motor.set(.25)". My question is, is there a good way of quickly being able to line yourself up? I feel like the string of "if" statements are very clunky. Our robot shoots from the same relative area each time so I don't need to mess with Trig stuff.

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!
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi