Go to Post This exercise in thanking the hand that teaches you brought to you by the Unsung FIRST Heroes Award. Have you thanked your mentor lately? - Amanda Morrison [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-02-2006, 18:04
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
CMUCam, Easy C, and Labview

I can't seem to get the camera to track the target through the code. It works fine in Labview, so I get the best image I can and save the config for Easy C. Than in easy C I initialize the camera, start the camera, and than just try to gather feedback to see if its working properly. I was able to get it working once, but now I can't seem to duplicate it. If anyone could give me any insight on something I may be overlooking, I would greatly appreciate it. Or if someone could possible give me a config that they got to work I could try that.
  #2   Spotlight this post!  
Unread 13-02-2006, 19:21
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 591
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by JJMax7
I can't seem to get the camera to track the target through the code. It works fine in Labview, so I get the best image I can and save the config for Easy C. Than in easy C I initialize the camera, start the camera, and than just try to gather feedback to see if its working properly. I was able to get it working once, but now I can't seem to duplicate it. If anyone could give me any insight on something I may be overlooking, I would greatly appreciate it. Or if someone could possible give me a config that they got to work I could try that.
The default configuration in EasyC should be pretty close. That is any of the "slots" in the table where you don't set values should get you tracking the target.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 14-02-2006, 00:19
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by JJMax7
I can't seem to get the camera to track the target through the code. It works fine in Labview, so I get the best image I can and save the config for Easy C. Than in easy C I initialize the camera, start the camera, and than just try to gather feedback to see if its working properly. I was able to get it working once, but now I can't seem to duplicate it. If anyone could give me any insight on something I may be overlooking, I would greatly appreciate it. Or if someone could possible give me a config that they got to work I could try that.

First thing I would do is make sure you can grab a frame, then track the color in the tracking window with Labview. If that looks good, then save your ECC file to EasyC.

Stop Labview, unconnect your RS-232 from your camera, and plug your TTL port back into RC. Make sure you have a FULLY CHARGED backup battery. Not a ¾ charged battery…FULLY CHARGED, 7.2 volts. Not 7.0 volts, not even 7.1 volts…. .lol….

Next, we need to know if your tracking with your ONBOARD camera PWM ports, or if you are planning on connecting your pan and tilt servos to the robot controller PWMs?

If you are using the onboard tracking. Make sure you read the CMU2Manual, place the lens in the upright position, so when you do a frame grab, the image is correct. (Right side up)

Plug the tilt and pan servo directly onto the CMU2 camera board. Refer to the documentation on where they connect. Your tracking might be backwards. If it is, there is a jumper you need to install to reverse the tilt or pan tracking on the camera board. We had to install the TILT jumper. We use an old hard drive MASTER/SLAVE jumper to reverse the direction of the TILT seek function.

Next is initializing your camera, load the ECC file from lab view with this. Then you need to START your camera. Then you need to capture data from your camera. Finally you need to Set Camera to "Tracking" and put a 1 in pan and a 1 in tilt. This will enable the onboard tracking feature.

You'll need to update your capture data with variables to populate and away you go.

We wasn't happy with the onboard tracking, so we borrowed Kevin's camera code to track the color by connecting the pan and tilt servos to the robot controller, rather than using the on-board servo PWMs. This way the update and servo "tracking" is 100% handled by the robot controller, and it's not so jerky, smooth and fast.....If you do this, then make sure you DISABLE the Set Camera tracking from 1 to 0 for both pan and tilt. This will disable or turn of onboard tracking.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #4   Spotlight this post!  
Unread 14-02-2006, 15:05
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: CMUCam, Easy C, and Labview

Did you convert Kevin's code into Easy C?

If I run the servos for the camera off the RC will the back up battery still need to be fully charged?

I was planning on running the servos off for ease of programming, since I don't have much time to test, but I can try to do it. I don't think I've been running the camera off a full back-up, I'll try that. I had thought that since it worked fine in Labview, and I had given the robot power via the RC and the back-up. I don't have any problem keeping a full back-up battery since we have a few, as well as chargers.

We set-up the camera properly. I made sure of that. I had it running once, so it could be the power problem. But thanks for all the help.
  #5   Spotlight this post!  
Unread 14-02-2006, 23:09
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by JJMax7
Did you convert Kevin's code into Easy C?

Yes, we did convert the "simple" one to EasyC. It works great.
http://www.kevin.org/frc/frc_camera_s.zip




-
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #6   Spotlight this post!  
Unread 15-02-2006, 15:37
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: CMUCam, Easy C, and Labview

I got it tracking so the power was the problem. Now ALL I have to do is integrate it into the code. And get it mounted.
  #7   Spotlight this post!  
Unread 28-02-2006, 21:23
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by chakorules
Yes, we did convert the "simple" one to EasyC. It works great.
http://www.kevin.org/frc/frc_camera_s.zip
That seems a daunting and very time-consuming task. Congrats on getting it to work.
Would you by chance be willing to share?
Pretty please?
  #8   Spotlight this post!  
Unread 11-01-2007, 16:17
Team 562 Team 562 is offline
Registered User
FRC #0562
 
Join Date: Jan 2006
Location: Massachusetts
Posts: 6
Team 562 is an unknown quantity at this point
Re: CMUCam, Easy C, and Labview

I am having problems trying to get kevins mp lab code transfered into easy c. If you could be kind enough could you please post how to transfer the code.
  #9   Spotlight this post!  
Unread 11-01-2007, 16:35
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: CMUCam, Easy C, and Labview

1.)In easyC PRO Click on the project tab.
2.) Right Click on "C Source Files"
3.) Select Existing .c files
4.) Find the .c file you are looking for
5.) Right Click on "Header Files"
6.) Select Existing .h files
7.) Find the .h file you are looking for
8.) Start calling functions in user code blocks.

In the camera code if you want to drive the servos you may have to
convert pwm01=Value; to SetPWM(1,Value);
Where 1 is the port number and Value is the variable of what the angle should be.

In the Initialize Function call: InitCamera ( 1 ) ; and StartCamera ( ) ;
Any place that polls the camera you need to call CaptureTrackingData ();
You can drag the blocks right into the C code.

Have you tried the 07 demo code we posted that tracks very well.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 11-01-2007 at 16:42.
  #10   Spotlight this post!  
Unread 13-01-2007, 14:51
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: CMUCam, Easy C, and Labview

can you include a link to the 07 code?
  #11   Spotlight this post!  
Unread 13-01-2007, 19:15
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: CMUCam, Easy C, and Labview

http://www.intelitekdownloads.com/ea..._2007_demo.zip
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #12   Spotlight this post!  
Unread 14-01-2007, 12:14
itsme itsme is offline
Registered User
FRC #2217 (FOMH)
Team Role: Programmer
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Israel
Posts: 86
itsme is an unknown quantity at this point
Re: CMUCam, Easy C, and Labview

What is the difference between connecting the servos onboard the camera to connecting the servos to the RC?
And how is it possible to connect onboard?
  #13   Spotlight this post!  
Unread 14-01-2007, 16:53
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by itsme View Post
What is the difference between connecting the servos onboard the camera to connecting the servos to the RC?
And how is it possible to connect onboard?
You cannot, not this year atleast. FIRST had onboard pins last year for the camera. This year, the switched boards. You cannot use last years board as it would be considered illegal - it was custom made for FIRST.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #14   Spotlight this post!  
Unread 16-01-2007, 17:24
hal hal is offline
Registered User
FRC #2212
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 3
hal is an unknown quantity at this point
Re: CMUCam, Easy C, and Labview

Quote:
You cannot, not this year atleast. FIRST had onboard pins last year for the camera. This year, the switched boards. You cannot use last years board as it would be considered illegal - it was custom made for FIRST.
Does that mean that the EasyC CMUCam code cannot control the camera servo motors when they are connected to the RC? If so, does that mean one must import the MPLAB camera code so that the camera can track the light source?
  #15   Spotlight this post!  
Unread 16-01-2007, 18:01
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: CMUCam, Easy C, and Labview

Quote:
Originally Posted by hal View Post
Does that mean that the EasyC CMUCam code cannot control the camera servo motors when they are connected to the RC? If so, does that mean one must import the MPLAB camera code so that the camera can track the light source?
Right, as far as I can tell the easyC code depends on having the servos controlled via the camera board and not the RC. However, the 2007 kickoff demo could be a good starting point, as it does have tracking code that controls the servos via the RC.

Since my team has opted to use easyC, we ended up porting Kevin's streamlined tracking code rather than basing from the aforementioned demo code, however. It still needs to be tweaked a bit, but it seems to work fine.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
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 CMUcam demo problem Windward LabView and Data Acquisition 19 11-08-2007 02:33
Problems with CMUcam & LABView Daniel_H LabView and Data Acquisition 1 30-01-2006 12:07
Major CMUcam issues - LabView app won't work, very low-quality picture scottmso Programming 5 19-01-2006 17:51
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


All times are GMT -5. The time now is 19:34.

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