Go to Post FIRST has a 365 day season (366 on leap years)... - Adam Richards [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-01-2006, 23:27
ryan_f ryan_f is offline
Registered User
#1053
 
Join Date: Jan 2003
Location: ottawa
Posts: 71
ryan_f is an unknown quantity at this point
Servos controlling camera and purple screen

We are having two problems with our camera. We aren't exactly sure how to get the servo motors to move so the camera can track a target. Our camera is able to track targets fine with labview but there's just no movement in the servos. We connected them to pwm01 and pwm02 and used the default 2006 camera code.


Our other problem is when we load the settings for the camera to track the green lights. when we click "grab frame", the image comes out completely purple. If we load the default settings for the camera then the picture comes out fine.

Any ideas?
  #2   Spotlight this post!  
Unread 13-01-2006, 23:34
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Servos controlling camera and purple screen

Quote:
Originally Posted by ryan_f
We are having two problems with our camera. We aren't exactly sure how to get the servo motors to move so the camera can track a target. Our camera is able to track targets fine with labview but there's just no movement in the servos. We connected them to pwm01 and pwm02 and used the default 2006 camera code.

If you want LabView to be able to track the green light, you will need to use the servo outputs on the camera instead of sticking them into pwm01, and pwm02. There is however the question if this is legal with the rules, as currently that is unknown.
__________________
My Blog!
  #3   Spotlight this post!  
Unread 14-01-2006, 18:21
buss buss is offline
Registered User
AKA: Steven
FRC #0180 (S.P.A.M. Robotics)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Gainesville, FL
Posts: 50
buss has a spectacular aura aboutbuss has a spectacular aura about
Send a message via AIM to buss
Re: Servos controlling camera and purple screen

I found that the screen will be purple unless you calibrate in RGB mode, and then calibrate in YCrCb mode. That worked for us, anyway.
__________________
Steven Buss

"Far and away the best prize that life offers is the chance to work hard at work worth doing."
-- Teddy Roosevelt
  #4   Spotlight this post!  
Unread 16-01-2006, 20:43
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Servos controlling camera and purple screen

Using the supplied calibration and YCrCb mode, the camera view does seem completely purple, but bright fluorescent lights can be seen as a somewhat reddish purple, and the green target will actually appear as a faint bit of bluish purple.

That bluish purple is easily tracked by the camera against the less bluish purple background.
  #5   Spotlight this post!  
Unread 16-01-2006, 22:51
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: Servos controlling camera and purple screen

Quote:
Originally Posted by Alan Anderson
That bluish purple is easily tracked by the camera against the less bluish purple background.
We were trying to figure out what to do with the purple screen in LabVIEW today, until I clicked on a random part of a frame grab taken when pointing at the green target. The selection area showed up on the outside with an un-highlighted section where the green light box was. Clicking in this area reversed the selection highlighting. I could not even see the difference on the laptop screeen (with highlighting turned off), so you may not be able to notice a difference either. However, the camera can certainly detect the difference and now tracks perfectly.

Also, we still hade problems with slight detections of other lights. The noise filter was not working well enough, so I corrected this by modifying
Code:
if(T_Packet_Data.my != 0)
to 
if(T_Packet_Data.my != 0 && T_Packet_Data.pixels > 10)
in tracking.c
Just wanted to let others know how to easily correct this problem in the default code.
__________________
FRC Volunteer, FLL regional planning committee member for Colorado
Former Programmer, Web Designer, Communications Director of Alpine Robotics Team 159.
Add your team to the FIRST Teams Google Map
  #6   Spotlight this post!  
Unread 17-01-2006, 01:34
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Servos controlling camera and purple screen

Quote:
Originally Posted by Damian Manda
We were trying to figure out what to do with the purple screen in LabVIEW today, until I clicked on a random part of a frame grab taken when pointing at the green target. The selection area showed up on the outside with an un-highlighted section where the green light box was. Clicking in this area reversed the selection highlighting. I could not even see the difference on the laptop screeen (with highlighting turned off), so you may not be able to notice a difference either. However, the camera can certainly detect the difference and now tracks perfectly.

Also, we still hade problems with slight detections of other lights. The noise filter was not working well enough, so I corrected this by modifying
Code:
if(T_Packet_Data.my != 0)
to 
if(T_Packet_Data.my != 0 && T_Packet_Data.pixels > 10)
in tracking.c
Just wanted to let others know how to easily correct this problem in the default code.
The purple screen is due to a bug in the LabVIEW code for the camera which has the picture that is displayed interpret the YCrCb data as RGB data. The conversion ends up being "all purple" -> "all black". Fixed it up last weekend and will post it tomorrow when I get to work. It should be easier to see dark gray on black than purple on slightly darker purple. Besides, it's just ugly to look at.

Sorry for the delay on getting it posted. We are trying to get a site approved to host the VIs that everyone can get to. Some people have restrictions getting to FTP sites.

For you kids out there who are interested in what that problem is and how you can fix it, Google for "YUV RGB conversion" or "YCrCb RGB conversion". You'll find plenty of information about it. You can then try fixing it in the version you have by implementing the 3 equations. You can also download the fix tomorrow and see how I chose to implement it. Consider it a challenge. Play around with LabVIEW and you'll see just how powerful and easy to use it really is.

Best of luck!
-Joe
  #7   Spotlight this post!  
Unread 17-01-2006, 23:21
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Servos controlling camera and purple screen

OK... the new version is posted here. It supports a few new features and the purple bug fix. Read about it and enjoy.

Cheers!
-Joe

BTW, did anyone look at the problem to see if they could solve it?
Closed Thread


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 07:30.

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