Go to Post I'm thinking they subscribe to the thought that "the best offense is a good defense". They are from New England, after all. - Travis Hoffman [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 20-02-2009, 23:27
KHall KHall is offline
KHall - 2171 Crown Point IN
FRC #2171 (RoboDogs)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Crown Point IN
Posts: 67
KHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud of
cmucam2 MPLAB on VEX controller ??

Congratulations on surviving another build season!!

During this build season I came across a cmucam2 revA which I believe to be from the 2007 season. Now that build season is over I thought it would be an interesting home project to see if we can get it working on a little VEX controller so we can use it to teach the basics of cameras to our younger students.

That was about a week ago... I've collected a lot of information and software since then including several example programs for Brad Miller's WPILIB and Kevin Watson's cmucam code.

I know the camera works just fine since using the Java applet CMUcamGUI2_fe I can track colors reliably. Further I know that both Brad & Kevin's code sucessfully initializes and starts the camera tracking (from LEDs and Brad's easy to use SetCameraDebugMode(1) function).

But after that the results are completely consistant. The T-type packets appear to be sent but when you do printfs for the tracking variables you always get zeros.

Its interesting that with Kevin's code (at startup) the first output is 'no camera data'. It always happens once at startup, and from then on it just outputs 'Searching...". If you unplug the serial connection, Kevin's code just streams 'no camera data'. That makes me think that the camera is sending the data, but the VEX has something just a little different that causes the data to be 'lost'. ( And I double checked my pointer logic many times. The variables are really empty. )

So after reading and trying everything that I can think of, and must admit I'm stumped. I've been using MPLAB and WPILIB for programming these little VEX machines for quite a while now and it is, generally speaking, rock-solid.

So if you have any suggestions, or know something about the how the VEX CPU might be different, please pass it along. It would sure be nice to make use of this camera with the younger students -- rather than just have this equipment and code sitting on a shelf collecting dust.

Thank-you,
KHall, Mentor
Team 2171
Crown Point RoboDogs

Last edited by KHall : 20-02-2009 at 23:35.
  #2   Spotlight this post!  
Unread 22-02-2009, 07:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: cmucam2 MPLAB on VEX controller ??

There's no real difference from the software perspective that prevents the CMUCAM from working on the Vex. We used the Vex platforms for FRC training for several years, including following objects with the CMUCAM.

"Searching..." should mean that packets are being received from the CMUCAM successfully, but just that no target has been identified. So I'd imagine you just have issues with the color space you are searching or another setup characteristic.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 01-03-2009, 17:51
KHall KHall is offline
KHall - 2171 Crown Point IN
FRC #2171 (RoboDogs)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Crown Point IN
Posts: 67
KHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud of
Re: cmucam2 MPLAB on VEX controller ??

Thank-you for the reply Mark,

I finally ended up using the WPILIB just to set up the camera and then read the data as ASCII directly from the serial port. That works fine. Although to make it easier on myself I set the camera to polling mode and used a mask to limit the Tpacket to only four of its eight data points.

Just curious now, but do you happen to recall which version of MPLAB you were using? I'm using MPLAB 8.10. And I found something in Kevin's code that specifies using an earlier version. That is something that I have not tried.

I can say this much, with the Ver 7 VEX code and MPLAB 8.1 both Keven's code and the WPILIB do not recieve data. And I have several controllers so its not specific to one piece of hardware.

Sure would be nice to know what is causing this. But in the meantime, I have a squarebot that now faithfully follows a green plastic bag with a flashlight behind it.

Thanks,
KHall
2171.
  #4   Spotlight this post!  
Unread 01-03-2009, 21:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: cmucam2 MPLAB on VEX controller ??

The MPLAB version should not matter at all. MPLAB itself is just an editing tool. I've run with older and newer versions.
What would matter is the mcc18 toolset version that MPLAB is running for us. That should be version 2.4 in any case.

Kevin originally developed his CMUCAM code on an EDU, a precurser to Vex, so it will work. You're having some sort of conversion problem, but it sounds like you worked around it.

You can checkout our workshop Vex code if it helps any. Probably look about halfway down the page.
We didn't use the Vex version 7 code as a starting point though.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #5   Spotlight this post!  
Unread 01-03-2009, 23:25
KHall KHall is offline
KHall - 2171 Crown Point IN
FRC #2171 (RoboDogs)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Crown Point IN
Posts: 67
KHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud ofKHall has much to be proud of
Re: cmucam2 MPLAB on VEX controller ??

Thanks Mark,

When I clicked on the link to your website I immediately recognized it. Found it once before using Google. Tried your code and got the same results. And I just double checked the mcc18 that is on this machine, it is ver 2.4.

So it must be the lastest VEX code. I can go see if they have an older version still posted on VEX and see if that works.

Thanks, this is all very helpful.

Keith
  #6   Spotlight this post!  
Unread 02-03-2009, 10:22
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: cmucam2 MPLAB on VEX controller ??

I took a look and version 7 of the Master code doesn't affect the CMUCAM code.

I suspect there might be a setting in the code being missed. For instance, the code may be connecting to the wrong serial port. There are three serial ports on the CMUCAM and two on the Vex controller. If the code is listening to the wrong one it won't get any messages.

Here's a description of how our camera gets connected: http://team358.org/files/programming...%20CMUcam2.doc
See if you are doing anything different. You can use different ports, but the code has to be told which one to use.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 02-03-2009 at 10:36.
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
Programming Vex w/ MPLab dababyjebus FIRST Tech Challenge 27 25-04-2008 09:11
Question abut CMUCam2 Camera with VEX yara92 Programming 7 22-09-2007 08:19
CMUCAM2 on a Vex Controler Kingofl337 Programming 0 23-01-2007 16:09
Interupts on Vex in MPLab Andrew Schreiber FIRST Tech Challenge 1 24-05-2006 08:32
Vex Easyc vs Mplab Joohoo Programming 17 27-01-2006 08:22


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

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