Go to Post One time I had to write a report on "What is Gracious Professionalism?" I wrote down "Andy Baker" and got an A . - Swan217 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2009, 18:06
Tanner's Avatar
Tanner Tanner is offline
Registered User
FRC #1261 (Roblions)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Suwanee, GA
Posts: 311
Tanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to behold
Camera Tracking

Hi all,

We're trying to get the robot to track the trailer using a PID loop. We've got the targeting of the colors on the trailer down. Though for some reason, we believe that the PID loop is not getting data as fast as the Image Processing.vi gives it to us. It is as though we're watching a movie, but only seeing frames at a low frame rate, not what it's playing at.

We're not exactly sure what to do next. The code seems so simple, that it can't be our code that is slowing it down (unless we're missing something big). I'll post a copy of our code in a bit after I find my externel HDD.

Any ideas?

Thanks
-Tanner
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2009, 18:38
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Camera Tracking

You don't mention which dev environment, but some of my comment will be similar either way.

If using LV, beware that open panels add overhead. Great for debugging, but that is the price you pay.

Probe the output from the camera, and within the PID area where you are consuming that data and acting on it, probe again.

The better type of probe would be a chart so that you have history and can see how much of a lag is there or if you are indeed skipping values.

If you can't get them probed, just add indicators here and there.

If not using LV, trace values in C by dumping to an array of printing to a file.

Again, what you are looking for is the way the values interleave, and whether they lag.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2009, 19:03
Tanner's Avatar
Tanner Tanner is offline
Registered User
FRC #1261 (Roblions)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Suwanee, GA
Posts: 311
Tanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to behold
Re: Camera Tracking

Quote:
Originally Posted by Greg McKaskle View Post
You don't mention which dev environment, but some of my comment will be similar either way.

If using LV, beware that open panels add overhead. Great for debugging, but that is the price you pay.

Probe the output from the camera, and within the PID area where you are consuming that data and acting on it, probe again.

The better type of probe would be a chart so that you have history and can see how much of a lag is there or if you are indeed skipping values.

If you can't get them probed, just add indicators here and there.

If not using LV, trace values in C by dumping to an array of printing to a file.

Again, what you are looking for is the way the values interleave, and whether they lag.

Greg McKaskle
Thought posting in the Labview forum would be a hint towards what I was using.

Er, I must be lost or confused. Probe / indicate what? I've got a graph on my Track Trailer.vi (with the PID loop) that displays my set point (0.5 the width of the image) and the process variable (x value from Image Processing.vi). When it runs, the graph clearly shows the process variable as a "square wave" - all square, not smooth like a Sine wave. The "smooth-ness" of the wave can be affected by the frame rate and other things from the image processing, but not by much.

So, I'm not sure what else there is to probe...

Thanks
-Tanner
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2009, 23:50
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Camera Tracking

Sorry about that. Answer enough and you don't know where you are.

If you are getting a slow framerate due to displays or other things, and you are moving the target moderately fast, it seems reasonable to get pretty big and sudden jumps in the setpoint. Are you sure the rest isn't just tuning? If you are using the outputs wired to drive, it takes -1 to 1 range, right? So are your outputs in a range like that?

If I'm still not getting close, maybe you should copy the graph and paste it in the next post.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2009, 09:38
Tanner's Avatar
Tanner Tanner is offline
Registered User
FRC #1261 (Roblions)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Suwanee, GA
Posts: 311
Tanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to behold
Re: Camera Tracking

Quote:
Originally Posted by Greg McKaskle View Post
Sorry about that. Answer enough and you don't know where you are.

If you are getting a slow framerate due to displays or other things, and you are moving the target moderately fast, it seems reasonable to get pretty big and sudden jumps in the setpoint. Are you sure the rest isn't just tuning? If you are using the outputs wired to drive, it takes -1 to 1 range, right? So are your outputs in a range like that?

If I'm still not getting close, maybe you should copy the graph and paste it in the next post.

Greg McKaskle
Hehe, no problemo.

Eh, this situation is so confusing. We move the target around in a slow walk to a walk and the graph shows up in lots of jumps (not a nice "smooth" square wave we could expect with Image Processing.vi running so fast). I need to record some of the data and get the latest project on my HDD so I can show what exactly is happening.

On our PID loop, we've got the output limits at 50 and -50 and a divisor at 200 or 100, I can't remember which. We use a divisor and such high limits so that we can use integral, but with my limited use of a PID loop, I'm probably getting ahead of myself and should stay with just -1 and 1 outputs?

Thanks
-Tanner
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2009, 11:28
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Camera Tracking

I didn't get to my main point in my previous posts, but if you see LV data onscreen, in a probe, graph, or array, you can right click and copy data. Then open a new VI and paste. You now have the binary data captured for further analysis. Make the current value default, save it, or change it to a control and write a quick program to do what you want to the data set. If you paste into Word or other apps, the thing on the clipboard is an image, but within LV it is a graph or other control with the data.

The point is, it is not necessary to rewrite the program to use file I/O if you want quick data. File I/O is still good of you want to be systematic about gathering data for driving runs.

If you start doing this, there are a few odd things in LV. For arrays, you will want to Select All in the right click first, otherwise it copies just the selected data, which is hard to control and normally nothing is selected. Also charts display history, not just their data, so copy data on a chart is odd too.

Anyway, the picture will probably allow control guys to help out much more than just your description.

Greg McKaskle
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera locked in "tracking", but not tracking geeknerd99 Programming 1 18-02-2007 22:47
camera tracking geekofband007 Programming 15 15-02-2007 23:50
Camera Tracking Target Jade Programming 3 20-01-2007 01:41
Camera tracking problem Windward Programming 2 15-01-2007 17:59
CMU Camera Tracking auditt241 Programming 0 03-02-2005 16:33


All times are GMT -5. The time now is 08:21.

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