Go to Post (Don't you hate it...) "when... no more buttons can fit onto your clothing at competitions?" - mcb [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 18-09-2013, 22:33
wildaburk3160 wildaburk3160 is offline
Registered User
FRC #3160
 
Join Date: Sep 2013
Location: Grove, OK
Posts: 50
wildaburk3160 is an unknown quantity at this point
Camera Tracking

Hi guys, I'm head programmer on 3160 this year and we've decided that some sort of camera tracking is essential for next season. After doing some research on these forums I've been directed to the Rectangular Target-2013 example in FRC examples. I open it up and none of the code is comprehensible. Would it be possible for any one to direct me to some source that can offer some explanation to what is going on in the code? I've seen some white papers about different aspects of vision in LabVIEW, but they weren't very helpful as far as explaining any code. If someone could help a LabVIEW vision rookie out, it would be much appreciated.


Links to the white papers here:
https://decibel.ni.com/content/docs/DOC-14557
http://www.ni.com/white-paper/2723/en
Reply With Quote
  #2   Spotlight this post!  
Unread 19-09-2013, 09:28
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Camera Tracking

Here is the white paper that describes the 2013 vision code. http://wpilib.screenstepslive.com/s/3120/m/8731
Reply With Quote
  #3   Spotlight this post!  
Unread 19-09-2013, 17:50
wildaburk3160 wildaburk3160 is offline
Registered User
FRC #3160
 
Join Date: Sep 2013
Location: Grove, OK
Posts: 50
wildaburk3160 is an unknown quantity at this point
Re: Camera Tracking

Thanks Joe, that is extremely helpful.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-09-2013, 20:36
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,752
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

And here is the earlier pdf of the 2012 code. https://decibel.ni.com/content/docs/DOC-20173

If you have other questions, please ask more explicit questions here.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 30-09-2013, 19:36
wildaburk3160 wildaburk3160 is offline
Registered User
FRC #3160
 
Join Date: Sep 2013
Location: Grove, OK
Posts: 50
wildaburk3160 is an unknown quantity at this point
Re: Camera Tracking

If I want specific motors to be controlled based on the feedback given in the vision processing VI, do I put program the motor response in the vision processing VI, or do I need to make a global variable of some sort, and put it in the teleop VI? I have no experience with global variables.
Reply With Quote
  #6   Spotlight this post!  
Unread 30-09-2013, 19:51
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,752
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

If the motors are exclusively controlled by camera, unlikely and potentially unwise, then you could put the code in the vision loop. But more likely, you'll have a manual mode and/or only use the vision for specific tasks. This makes it much more common for the camera loop to update globals indicating the quality and state of its image processing. Then a parallel loop -- can be teleop, but more often periodic tasks -- will read the globals and update the motors.

Globals are actually quite easy to use correctly, but also quite easy to use incorrectly. The key is to limit the number of writers to the global. Ideally, only one piece of code would ever write to the global. It is quite common to have an initialization phase that breaks the rule but happens only at startup.

If you want to trigger something, you can also use events, notifiers, or even queues, but globals are quite capable for FRC robots.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 30-09-2013, 20:49
wildaburk3160 wildaburk3160 is offline
Registered User
FRC #3160
 
Join Date: Sep 2013
Location: Grove, OK
Posts: 50
wildaburk3160 is an unknown quantity at this point
Re: Camera Tracking

Oh, I wasn't planning to have the camera explicitly control the motors, I didn't mean to imply that. I just wanted to have, like you said, a manual mode in teleop and when the camera is in range of the retro-reflective target, or at a button press, have the camera take over to align the bot properly. I will try out the global variables and I will likely have more questions down the road.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-10-2013, 17:47
wildaburk3160 wildaburk3160 is offline
Registered User
FRC #3160
 
Join Date: Sep 2013
Location: Grove, OK
Posts: 50
wildaburk3160 is an unknown quantity at this point
Re: Camera Tracking

After finding and doing the labview tutorial on integrating vision code into a robot project, and duplicating the vision code hierarchy, an error occurs where there is a bad wire connecting the "Get Mode" VI to the Robot Main global variable that is connected to the adjacent case structure, claiming that I am connecting two different data types. I've checked another project and this problem does not occur there.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-10-2013, 18:51
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,752
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

Can you post a picture of the broken diagram? It sounds like something was copied from the vision example into the Robot Main that confused data types.

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


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

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