SyntaxHighlighter

Friday 28 June 2013

Day 15: Rebuilding the AR program for VS 2010 and XNA 4.0

Troubleshooting notes

As per installation guide, install both VS C++ and C# Express 2010, install XNAGS40, OpenCV, ALVAR.

Open "GoblinXNAv4.1/wrappers/ALVARWrapper2.0/ALVARWrapper2.0.sln" with VS C++ Express 2010.

right click solution, change configuration from debug to release, build

ERROR: cannot include MarkerTracker.h
SOLUTION: 
  1. enable expert settings (tools, settings, expert settings)
  2. right click solution, properties
  3. Fix path to "(ALVAR install)/include" under C/C++ -> "Additional Include Directories" 
  4. Fix path to "(ALVAR install)/bin" under Linker -> General -> "Additional Library Directories"
now it builds

Copy generated ALVARWrapper.dll to GoblinXNAv4.1/dlls/unmanaged/

Follow rest of instructions in installation guide

Complete extra step with opencv 2.1 for VS 2008. Copy dlls.

Don't forget to build GoblinXNA4.1/src and the tutorials

Build skinnedmodelprocessor and pipeline and all that stuff too.

ERROR: SkinnedModelPipeline not found
SOLUTION: must download new skinned sample compatible with XNA 4 from here: http://xbox.create.msdn.com/en-US/education/catalog/sample/skinned_model

Change config to release if possible, build all of them in turn, SkinnedModel, SkinnedModelWindows, and SkinnedModelPipeline

Delete existing reference to SkinnedModelPipeline, and add a new reference, go to GoblinXNAv4.1/bin/x86/SkinnedModelPipeline.dll and re-add it. Same for GoblinXNA reference and any reference it can't find.

various other errors inbetween are self explanatory to fix

ERROR: unable to load ALVARWrapper.dll the specified module cannot be found
SOLUTION:
open  \src\device\vision\alvardllbridge.cs and change ALVARWrapper.dll to full file path
then rebuild GoblinXNA


Current state:

It builds, window appears, blue screen. No graphics on window at all.
Still debugging

Conclusion of the day

I found the original Goblin XNA tutorial and reinstalled everything with the new software. Then I began porting all of the AR code to the new software, rewriting methods that didn't work any more and copying examples of new methods from the new version 4.0 tutorial example files.

I had imagined it would be a quick job but XNA is an extremely quirky application with ALVAR and Goblin and OpenCV and all sorts of references flying about it has taken around 3 days. On the plus side all of this troubleshooting has really helped my understanding of how the code actually works, and exactly how ALVAR, ALVAR wrappers, Visual Studio and Goblin XNA all work together and where each of them fits in. This will definitely help any future code modifications and porting.

Progress has been good slow but steady, almost got it working. All build errors have been fixed, some models had to be temporarily deactivated because they weren't supported (we lost the orchid and the funny green minecraft creature may not be working properly) but I can have a look at fixing those later. Currently the project builds and runs without errors at all, but it does not display any video on the screen. I'm sure it's because I haven't completed some extra step that version 4.0 requires over 3.1, like initializing the camera or something.

Confirmed that the program grabs the webcam.

On Monday will finally finish this and finish our investigations into 123D Catch, and get back to preparing for Animation 13 in earnest.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.