Go to Post Free hugs are excellent things. - Eugenia Gabrielov [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 17-01-2006, 21:56
Issues Issues is offline
Registered User
FRC #0525
 
Join Date: Nov 2005
Location: Iowa
Posts: 11
Issues is on a distinguished road
frc_camera not working but labview does

We can lock on and track the target with labview, but when we try to use kevin's code (frc_camera.zip)with the same configuration values it doesn't work properly. It continually searches for the target, and always returns a confidence value of 0. Here are the configuration values that we used.


#define AGC_DEFAULT 19 // Automatic Gain Control Register [0/0x00]
#define BLU_DEFAULT 128 // Blue Gain Control Register [128/0x80]
#define RED_DEFAULT 128 // Red Gain Control Register [128/0x80]
#define SAT_DEFAULT 128 // Saturation Control Register [128/0x80]
#define BRT_DEFAULT 2 // Brightness Control Register [128/0x80]
#define AEC_DEFAULT 3 // Automatic Exposure Control Register [127/0x7F]
#define COMA_DEFAULT 32 // Common Control A Register [36/0x24]
#define COMB_DEFAULT 32 // Common Control B Register [1/0x01]
#define COMI_DEFAULT 128 // Common Control I Register [0/0x00]
#define EHSH_DEFAULT 128 // Frame Rate Adjust Register 1 [0/0x00]
#define EHSL_DEFAULT 32 // Frame Rate Adjust Register 2 [0/0x00]
#define COMJ_DEFAULT 132

Any help would be appreciated.
  #2   Spotlight this post!  
Unread 18-01-2006, 12:42
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: frc_camera not working but labview does

Make sure the color spaces match. Kevin's code uses YCrCb. I don't know what LABView uses.
  #3   Spotlight this post!  
Unread 18-01-2006, 15:05
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,748
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: frc_camera not working but labview does

We had the exact same problem. Kevin's code DOES use the YCrCb colorspace. You can either recalibrate in that colorspace or change the camera's color space. In the frc_camera_s.zip program, the revelvant constant is in camera.h. Set COMA_DEFAULT to 40 to use RGB with no auto white balance.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #4   Spotlight this post!  
Unread 18-01-2006, 15:17
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: frc_camera not working but labview does

Quote:
Originally Posted by Issues
We can lock on and track the target with labview, but when we try to use kevin's code (frc_camera.zip)with the same configuration values it doesn't work properly. It continually searches for the target, and always returns a confidence value of 0.
We had a similar issue, and the culprit in our case was the servo motor speed

1. Camera would start the search sequence, looking for targer.
2. First pan sweep wouldn't see it. Camera swings back to the left to start second sweep.
3. While the camera is sweeping back, the camera sees the target, but since it is in the middle of sweeping back to start the next scan, it loses lock on it and has to restart scanning.

Making some minor tweaks to the target tracking code fixed this for us.

It also helps to make sure the camera is calibrated correctly.
  #5   Spotlight this post!  
Unread 18-01-2006, 18:31
Issues Issues is offline
Registered User
FRC #0525
 
Join Date: Nov 2005
Location: Iowa
Posts: 11
Issues is on a distinguished road
Re: frc_camera not working but labview does

We have it calibrated in the right colorspace, but after further thought we think it is the direction the server tries to adjust itself when it is tracking that is backwards. Right when the red tracking light goes on, it moves away from the target. We tried flipping the jumpers, but since it is being controlled from the code we have to do it there... I was wondering if doing something like this would work...

Code:
in tracking.c

Change 

pan_error = (int)T_Packet_Data.mx - (int)Tracking_Config_Data.Pan_Target_Pixel;

to

pan_error = (int)Tracking_Config_Data.Pan_Target_Pixel-(int)T_Packet_Data.mx ;
  #6   Spotlight this post!  
Unread 18-01-2006, 18:46
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,386
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: frc_camera not working but labview does

Quote:
Originally Posted by Issues
We have it calibrated in the right colorspace, but after further thought we think it is the direction the server tries to adjust itself when it is tracking that is backwards. Right when the red tracking light goes on, it moves away from the target. We tried flipping the jumpers, but since it is being controlled from the code we have to do it there... I was wondering if doing something like this would work...

Code:
in tracking.c

Change 

pan_error = (int)T_Packet_Data.mx - (int)Tracking_Config_Data.Pan_Target_Pixel;

to

pan_error = (int)Tracking_Config_Data.Pan_Target_Pixel-(int)T_Packet_Data.mx ;
Sounds like you have the servos connected to the RC on PWMs 1&2. Good!
Now open tracking.h and read the comments between lines 60 and 65. (This is for the Bells and Whistles version). The same configurations are available in the simple version as well.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #7   Spotlight this post!  
Unread 18-01-2006, 19:20
Alekat's Avatar
Alekat Alekat is offline
Registered User
AKA: Alex
None #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2003
Location: California
Posts: 234
Alekat has a spectacular aura aboutAlekat has a spectacular aura about
Send a message via AIM to Alekat
Re: frc_camera not working but labview does

Quote:
Originally Posted by kaszeta
We had a similar issue, and the culprit in our case was the servo motor speed

1. Camera would start the search sequence, looking for targer.
2. First pan sweep wouldn't see it. Camera swings back to the left to start second sweep.
3. While the camera is sweeping back, the camera sees the target, but since it is in the middle of sweeping back to start the next scan, it loses lock on it and has to restart scanning.

Making some minor tweaks to the target tracking code fixed this for us.

It also helps to make sure the camera is calibrated correctly.
I think this solves the problem we were having today. Thanks! Oh and as far as calibration, it's best just to use the default numbers that come on kevin's code, trust me.
  #8   Spotlight this post!  
Unread 18-01-2006, 19:23
iBheat's Avatar
iBheat iBheat is offline
Registered User
FRC #0418 (Lasa Robotics)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Austin, TX
Posts: 24
iBheat is on a distinguished road
Re: frc_camera not working but labview does

Code:
// If your camera suddenly moves away from the target once
// it finds it, you'll need to change the sign on one or
// both of these values. Start with the tilt first.
#define PAN_ROTATION_SIGN_DEFAULT -1
#define TILT_ROTATION_SIGN_DEFAULT 1
That is the code in tracking.h!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Labview problems and code problems ajsetter Programming 25 18-01-2006 17:07
National Instruments LabVIEW and Data Acquisition Forum Danny Diaz National Instruments LabVIEW and Data Acquisition 1 16-01-2006 13:20
COM port settings for CMUcam labview testing and programming pwilczynski Programming 1 15-01-2006 15:09
National Instruments LabVIEW & Data Aquisition Forums Brandon Martus Announcements 0 22-11-2005 21:12
I'm working :) Jack FIRST Scouting Network 2 03-01-2004 01:26


All times are GMT -5. The time now is 14:26.

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