Laser line tracking

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

Postby Guest » Mon Jul 11, 2005 7:48 pm

I have everything compiling now, but I'm having an issue with the code. I'm trying to create a new command "EB" for Enable Bright Tracking.
Here are notes on what is happening:

this works;
UIMgr_convertTokenToCmd decodes a "EB" as enableBrightTracking
receivedCmd = enableBrightTrackingCmd;

this works;
UIMgr_executeCmd Sees receivedCmd == enableBrightTrackingCmd
PUBLISH_EVENT(EV_ENABLE_BRIGHT_TRACKING);

this does not happen;
FrameMgr_dispatchEvent case EV_ENABLE_BRIGHT_TRACKING: //does not execute

Is there something I'm missing? I know that "publish event" is happening, but dispatchevent is not executing or seeing my event. Did I miss a step?
Is there somplace I can upload my code in case you want to look at it?
Thanks Ringo
Guest
 

Postby Guest » Tue Jul 12, 2005 7:03 am

Hi Ringo,
Have you updated executive.c to include the the actual dispatching of the event to the appropriate module? And I assume you have added the new event to events.h, right?
Guest
 

Postby Ringo » Tue Jul 12, 2005 7:05 pm

It was the code in executive.c that I missed, thanks.
Now It enters my code in FrameMgr_processLine. Here is what I'm doing:
else if (currentState ==ST_FrameMgr_TrackingBrightFrame)
{
// UIMgr_txBuffer("BRIGHT",6);
// UIMgr_txBuffer("\n\r",2);
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE)
{
if( currentLineBuffer[pixelCount] > Brightest_Row_Value[pixelCount])
{
Brightest_Row_Location[pixelCount]=trackedLineCount;
Brightest_Row_Value[pixelCount] = currentLineBuffer[pixelCount];
}
pixelCount++;
}

trackedLineCount++;
if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME)
{
/* an entire frame of tracking data has been acquired, so
publish an event letting the system know this fact */
PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE);
/* disable the PCLK counting overflow interrupt */
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK;
trackedLineCount = 0;
}

else
{
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE);
}

}


and in FrameMgr_processFrame I have:

#else
/* we only send tracking packets if there are tracked objects */
unsigned char pixelCount = 0;
unsigned char column[5];
unsigned char Location[5];

if (currentState ==ST_FrameMgr_TrackingBrightFrame)
{
UIMgr_txBuffer("Ringo2",6);
UIMgr_txBuffer("\n\r",2);
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE)
{
itoa(pixelCount,column,10);
itoa(Brightest_Row_Location[pixelCount],Location,10);

UIMgr_txBuffer(column,3);
UIMgr_txBuffer(" ",1);
UIMgr_txBuffer(Location,1);
UIMgr_txBuffer("\n\r",2);
pixelCount++;
}

}
else
if (numCurrTrackedObjects > 0)

but it never spits out the Ringo2. Did I miss something I need to do in the processline?
Thanks
Ringo
Ringo
 
Posts: 19
Joined: Thu Jun 23, 2005 9:48 am

Postby Ringo » Tue Jul 12, 2005 7:19 pm

Here is a clue to what is happening, but I don't know what it means. I added some comments to see when it finishes a line and when it finishes a frame. It finishes the line then sits there until I hit a key on hyperterminal, then it does another line. If I hit enough keys then all the lines go and I get a frame. any idea what would cause this? Here is my code with the debug stuff in it. Could my use of the uart be causing this stuff?
Thanks,
Ringo
else if (currentState ==ST_FrameMgr_TrackingBrightFrame)
{
unsigned char column[5];
// UIMgr_txBuffer("BRIGHT",6);
// UIMgr_txBuffer("\n\r",2);
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE)
{
// itoa(pixelCount,column,10);
// UIMgr_txBuffer(column,3); //COUNTS TO 175

if( currentLineBuffer[pixelCount] > Brightest_Row_Value[pixelCount])
{
Brightest_Row_Location[pixelCount]=trackedLineCount;
Brightest_Row_Value[pixelCount] = currentLineBuffer[pixelCount];
}
pixelCount++;
}

trackedLineCount++;
if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME)
{
/* an entire frame of tracking data has been acquired, so
publish an event letting the system know this fact */
PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE);
/* disable the PCLK counting overflow interrupt */
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK;
trackedLineCount = 0;
UIMgr_txBuffer("fRAME.",6);

}

else
{
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE);
UIMgr_txBuffer("lINE..",6);
}

}
Ringo
 
Posts: 19
Joined: Thu Jun 23, 2005 9:48 am

Postby Ringo » Thu Jul 14, 2005 8:15 pm

Could hyperterminal be causing the camera to wait between lines somehow?
Ringo
 
Posts: 19
Joined: Thu Jun 23, 2005 9:48 am

hello i am also getting same error

Postby chaps555 » Sat Apr 01, 2006 2:07 am

Hello evry one,
I tried to convertatmeags 8 code to 128 i have done all register changes , but at the end i am getting this error
********************************************************************
F:\ProgramFiles\winavr\bin\..\lib\gcc\avr\3.4.5\..\..\..\..\avr\bin\ld.exe: section .bss [00800110 -> 00800383] overlaps section .noinit [00800300 -> 0080032f]
make.exe: *** [AVRcam.elf] Error 1
***********************************************************************

I dont know wht the error is all about and how to remove this.

hope some body helps.
waiting for reply eagerly.

Regards

chaps
chaps555
 
Posts: 15
Joined: Tue Mar 28, 2006 12:51 am

Postby Ringo » Mon Jul 03, 2006 9:16 am

John, Do you think you will be able to take a look at my code and see if you can tell what I'm screwing up? I still can't get the Cam to process more than 1 line at a time in my new code.
Thanks
Ringo
Ringo
 
Posts: 19
Joined: Thu Jun 23, 2005 9:48 am

Postby Ringo » Mon Jul 03, 2006 10:50 am

YEAHHHHHHH, I finally found the missing line of code. So now my code is actually running. It is not working, but it is running. I want to look at the pixle data so I can keep track of the ones with the highest value.

In my code right in framemgr_processline() I'm doing (as debug)

while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE)
{
itoa(pixelCount,column,10);
UIMgr_txBuffer(column,3); //COUNTS TO 175
itoa(currentLineBuffer[pixelCount],VALUE,10);
UIMgr_txBuffer(VALUE,3); //COUNTS TO 175
}

but that seems to always return a 05

I don't remember where I got the idea that CurrentLineBuffer was the current pixel values but now I'm assuming they are not. how do I access the current values?

I'm looking at your code in in the #ifdef DEBUG_Tracked_line section but I have some questions.
You say the color is the first byte, ok so lets assume it is green, then the next 3 bytes are are the value? so what is the "run-length"?
Thanks
Ringo
Ringo
 
Posts: 19
Joined: Thu Jun 23, 2005 9:48 am

Previous

Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 17 guests

cron