Go to Post Brandon Martus, making CD readers' lives easier since May 2001/Fall 98 - Beth Sweet [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 26-01-2012, 19:20
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Vision Assistant C code generation

So, our team has setup a script in the NI Vision Assistant to process our images, we go through the whole process and get a binary image, and then have a particle analysis on it. However, once we generate code, I see that the public interface "IVA_ProcessImage" only passes back the success and the modified image, and in the C file, I can see that it computes particle data in the ivaData variable, then simply discards it before returning...

Is there a simple step we missed in the script to cause it to generate the return of this data? It is simple enough to modify the code to return the ivaData as well, but having to do it every time we tweak our script is less than ideal.
  #2   Spotlight this post!  
Unread 26-01-2012, 20:59
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Vision Assistant C code generation

As a follow up (more to document issues I encountered with this for newer programmers)...
After I put the generated code into my robot project, and attempted to compile, I received literally hundreds of errors, primarily they were this:

C:/WindRiver/vxworks-6.3/target/h/WPILib/nivision.h:1401: error: syntax error before '/' token

After slamming my head against the desk for about an hour, I realized that this was due to the generated code being a c file, and not a cpp file, the c compiler doesn't seem to be configured right. To fix this, just change the file extension to .cpp, and windrivers makefile generator will start using the c++ compiler on it.

After I changed this, there were a number of errors regarding incompatible types in function calls. All of these were solved by casting the offending variables to the expected type:
functionTakingExpectedType(a,b,c,(ExpectedType)wrongTypedVariable);

The bolded bit, including parenthesis is the syntax for casting a variable to another type, a technique that can be quite dangerous to use, but is appropriate to use here.

Hopefully this can help some people out. Apparantly the generated code is not ready to go out of the box.
(I am still looking for an answer to my OP, but I figured this would be useful info for people who are having issues with the code gen)
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 18:48.

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