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.
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)