Go to Post EVERYTHING in life is politics. - Amanda Morrison [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-02-2015, 09:39
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
PID Subsystem -- Align With Tote

Hello,

I've been working on creating a command to align myself with a tote in autonomous. I'm finding the tote find but I'm looking into making my code more efficient and was thinking a PID subsystem (or command?) might help.

At the moment, here's basically what I'm doing: I'm isolating the tote and getting the pixel offset from the center. In the execute of my command (not PID command -- just a regular command) I'm checking to see the value of that number. If it's less than 25 pixels off it drives forward, if not, it turns the appropriate direction to make the center of the image be aligned with the centroid of the tote.

In my isFinished, I'm returning this:


Code:
// returning if we are less than 20 inches and within 20 pixels, in either direction, of the centroid of the tote
return Math.abs(distanceToCenter) < 20 && Robot._driveTrain.getDistanceIn() <= 20;
Would a PID subsystem be better suited for this? How would I go about a speed-based approach? At the moment it is pausing and turning and I feel it would be way more efficient to simply vary the speed to the motors proportionally but am unsure where to star.

Thanks guys.
Reply With Quote
 


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 12:41.

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