View Single Post
  #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)