Spring break this week, but that didn't stop us from working :)
Grady was having some problems integrating the serial code into the main application. He debugged for hours and couldn't figure it out. Tyler and I met on Thursday, and he basically spent the whole time trying to figure out a linker error. We finally were able to get it working. What it was was a LPCTSTR error. The serial code, which is being used as a lib, uses a LPCTSTR type in some of its methods. However, when it gets compiled, it is converted to an unsigned (const?) char *. So when using the lib, the main app only references the header file, which contains the LPCTSTR type. When trying to use one of the methods with that type as a parameter, it causes a linker error for an unresolved external for the method signature. To fix this, we changed the LPCTSTR to the unsigned char in the serial code's header and cpp file and instead of using a __t() macro, we pass in a string directly when using the code in the main app. This fixed it (finally).
On another note, I continued trying to debug the scanning. I did fix a bug for when no red was found in an image. But I still haven't figured out what's causing the non-perpendicular traits of the planes. I have been converting to world coords and comparing to the origin of the back plane (which is the translation vector). It seemed that the camera-coord z-coord may have been off by 1 unit in one of the executions. I'll look into that more next week. Hopefully I can find something quickly!
Until next week!
It seems like the header file would also get compiled and therefore the LPCTSTR would get compiled to an unsigned char * as well. I'm still not convinced. haha.
ReplyDeleteSo if we accept this as the source of the problem then I guess the linker error may have come from the fact that the linker could not link the serial header to the serial library file. Also a seemingly ridiculous problem but perhaps I just didn't set up the VS additional dependencies for the linker correctly...I'll have to check into this later once I know all the serial additions are working properly. Veeeery interesting...
ReplyDelete