Hi,

I'm trying to port ARToolkit in a Vuo node. Quite challenging, I think. Anyway, I studied the video introduction here on Vuo about creating nodes and succeeded in compiling the examples. Then, I downloaded ARToolkit SDK and placed in my home path, under /SDKs. There also there's Vuo SDK. I created a new node cloning an example, so my structure is: ~/SDKs/ARToolKit5-bin-5.3.2r1-OSX ~/SDKs/vuo-1.0.1-sdk

and I'm trying to build the node placed in ~/SDKs/vuo-1.0.1-sdk/example/node/detect

I open the .pro file in QT Creator, choose "Desktop" kit, and add

include <AR/config.h>

to detect.c file.

Building, i get "<AR/config.h> file not found" error.

I tried adding several INCLUDEPATH directive in .pro file, without success, like INCLUDEPATH += ~/SDKs/ARToolKit5-bin-5.3.2r1-OSX/include

using brackets, absolute paths, using HEADER directive and so on, but I can't make it include the header.

So, what's am I doing wrong?

Comments

I'm trying to port ARToolkit

jstrecker's picture
Submitted by

I'm trying to port ARToolkit in a Vuo node.

!!! That would be awesome! If you can get past the obstacle of including and linking in the ARToolkit SDK, will you continue working on it?

I tried adding several INCLUDEPATH directive in .pro file

INCLUDEPATH refers to the include paths that Qt would pass to the regular C compiler (clang). Instead, here you need to pass them to the Vuo compiler (vuo-compile).

Starting from the stateless node example from the Vuo SDK, you would add this line...

ARTOOLKIT_PATH = ~/SDKs/ARToolKit5-bin-5.3.2r1-OSX

... and add --header-search-path to the vuo-compile command like so...

node.commands = $${VUO_FRAMEWORK_PATH}/vuo-compile --header-search-path $${ARTOOLKIT_PATH}/include --output ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} \

You'll also need to help vuo-link find the ARToolkit libraries when it links a composition. This means listing the libraries in the dependencies section of your module metadata and either placing them in the Modules folder or passing --library-search-path arguments. See http://api.vuo.org/1.2.5/group__ManagingDependencies.html for instructions.

Oh, and if ARToolkit links to dynamic libraries (which from skimming the documentation I think it does), and if you plan to distribute the node instead of just using it on your own computer, then there's an extra step just because dylibs like to be annoying ;) You have to run a command called install-name-tool on them (which, in the Vuo source code, is done in the file framework.pro). If you need help with that, let me know.

Hi;

cremaschi's picture
Submitted by

Hi; I succeeded in importing ARToolkit libraries in a Vuo node skeleton, following your suggestion. But, my skills are not enough to get the goal. Shouldn't be impossibile; on ARToolkit website there's a well documented example that could be used as a reference: https://artoolkit.org/documentation/doku.php?id=7_Examples:example_simpl...

So, what I did is creating a github project, uploading my humble start, open to all contributors here from Vuo community wishing to give some help. It's online at https://github.com/micrem73/VuoARToolkit I'll keep it updated of any eventual step forward I'd get.

regards Michele

Hi Jaymie,

cremaschi's picture
Submitted by

Hi Jaymie, actually I got the code compile with success. When I try to run a composition in the vuo editor that uses that node, I get this error:

Node outdated or broken — One or more nodes in this composition can't be used by this version of Vuo. Make sure you're using the latest version of all the extra Vuo nodes you've installed:

I think i missed the step you mentioned:

You'll also need to help vuo-link find the ARToolkit libraries when it links a composition. This means listing the libraries in the dependencies section of your module metadata and either placing them in the Modules folder or passing --library-search-path arguments. See http://api.vuo.org/1.2.5/group__ManagingDependencies.html for instructions.

I read the link provided but I can't sort it out. Please, what's the way to instruct linker with --library-search-path directive?

Thanks,

michele

Also: in console i found this

cremaschi's picture
Submitted by

Also: in console i found this:

24/02/17 10:13:37,602 vuo-compile[1341]: VuoCompilerModule.cc:103  parseMetadata()  Error: Couldn't parse VuoModuleMetadata as JSON: { "title" : "detect markers", "description" : "Keeps track of how many times this node has been executed, and outputs that count.", "keywords" : [ ], "version" : "1.0.0", "dependencies" : [ AR ], "node": { "isInterface" : false } }

As you can see, I added "AR" dependence, but something is wrong.

"dependencies" : [ AR ] needs

jstrecker's picture
Submitted by

"dependencies" : [ AR ] needs some quotes. It should be "dependencies" : [ "AR" ] .

The --library-search-path option is only available when compiling and linking compositions with the command-line tools (found in the Vuo SDK). For example:

./vuo-compile ~/Desktop/SomeComposition.vuo
./vuo-link --library-search-path ~/SDKs/ARToolKit5/lib ~/Desktop/SomeComposition.bc

If running the composition with Vuo Editor instead of the command-line tools, there isn't currently a way to add a library search path. Instead, you should place the ARToolKit library in the User Modules or System Modules folder.

Dear,

cremaschi's picture
Submitted by

Dear,

I put quotes as:

             "dependencies" : [ "AR" ],

following documentation that reads:

Notice that the static and dynamic library names leave off the "lib" prefix, and the file extension is optional; libassimp.a becomes assimp or assimp.a, and libicuuc.dylib becomes icuuc or icuuc.dylib. 

When i run vuo-link (with --library-search-path ~/SDKs/ARToolKit5-bin-5.3.2r1-OSX/lib option ) i get in console:

01/03/17 08:55:56,558 vuo-link[1107]: VuoCompiler.cc:2077  getLinkerInputs()  Warning: Could not locate dependency 'AR'.

If instead i put

             "dependencies" : [ "AR.a" ],

this seems to solve the error.

Just to know if I'm doing something wrong, or if the documentation saying that file extension is optional is a mistake.

ciao michele