-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New ARToolKitNFT class in the C++ Emscripten code #301
Conversation
- see issue #292
- removing decorate() for instantitating methods - static properties exposed explictly - all methods declared inside ARToolkitNFT class
- removing some not necessary properties in ARControllerNFT_improved
- webpack and typescript
I think i have implemented all the planned features, i'll make a last check to be sure that it is ready to be merged. |
Sometimes testing the new lib, i get this error:
When i recevive this error, after it's impossible to continue to detect and track. It looks strange, at first sight i was thinking that the reason was some bad bug in the typescript code ( a void function instead of function returning a number) but seems a silent issue instead in WASM (??) I think i nedd to debug adding some flags in |
Added some flags to have more info about this issue, running the
Note deleteHandle is: jsartoolkitNFT/emscripten/ARToolKitNFT_js.cpp Lines 184 to 198 in d3e95ad
icpDeleteHandle is invoked by jsartoolkitNFT/emscripten/ARToolKitNFT_js.cpp Line 191 in d3e95ad
in our implementation
AR3DHandle *ar3DHandle to NULL this issue is avoided.In general i think it's better to init the parameter in the constructor, i think i will opt to this code design. |
I solved the issue above initializing the private fields in the .cpp file, now i got another error (while testing jsartoolkitNFT/emscripten/ARToolKitNFT_js.cpp Lines 38 to 49 in 176cece
I receive an analog error with the basic.html, but without the additional infos because i added the |
this should be better: // ARToolKitNFT_js.cpp
// inside passVideoData()
// instead of memcpy() stuff...
this->videoFrame = vf.data();
this->videoLuma = vl.data();
// ARToolKitJS.cpp
// inside passVideoData()
// instead of memcpy() stuff...
arc->videoFrame = vf.data();
arc->videoLuma = vl.data(); This works but i need to add Why i used memcpy? i can not remember the reason... |
- avoid memcpy in passVideoData
Without the debug flags i don't need to add the |
Debugging ES6 examples in Android i get this error:
I got this in the past but i need to understand if it is caused by new changes. |
adding an
|
if i enlarge the stack |
- fix for issue #97 and webarkit/ARnft#212
last commit should fix issue |
I will rewrite the C++ code, following this structure:
Create an ARToolKitNFT class and export it thanks to Emscripten bindings to WASM, instead of the function export in an extern C as was before.
Consequently change the Typescript, code i will add these functions/changes:
markerType
declared withARToolkitNFT.NFT_MARKER
;and IntListproperties (EMregister_vector
's) to ARToolkitNFT classRuntimeError: Aborted(RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance)
issue error with WebAssembly, failing to load example #97 and Memory issue on multiple markers ARnft#212