-
Notifications
You must be signed in to change notification settings - Fork 108
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
How to integrate vuforia 4-2-3 #60
Comments
I tried this but it did not work. Is there any plan to update this library to support v4 and v5 ? |
can you share the code pin point 3d object on an object? :) |
Is there any idea to update vuforia to 5? |
Yupp. Got it working (4,5 etc). Requires some tweaking in build scripts, native files and java files. Will not post commit here just yet, because each Vuforia version requires special rebuild, but if anyone is interested, I can create instructions and post them here or send personally over the e-mail. |
@mmihhailov how do you make it work I'm interested in the instructions, thanks |
With newest Rajawali, my port is not valid anymore. The video background is flipped 180 degrees on Z axis. Working on the workaround. |
@mmihhailov please I need the instructions |
OK. Actually i did port the whole thing to Java as end result, but here are the instructions in general to use original C++ code. First:
Next: Next: Next: add
and
Now you have buildNative task under 'other' menu in gradle scripts. When you run that, it should compile the native part of RajawaliVuforia. Or maybe not :) Worked for me, I sure hope I remember all the steps. ... Or if you ask nicely, I can send you the Java files, where I have ported the whole thing to Java and it seems to be working just nice :). Needs a bit tweaking, but it works. And it's all java, no tricky Java -> native -> back to Java magic. This tweaking part is the reasoning not pushing the code back to github. A bit raw for sharing with wider audience. |
@mmihhailov : how to do it in osx 10.9.5? |
No idea. Never worked with osx. I guess you have to follow Google instructions, how to include and compile NDK stuff under osx with Android Studio. In essence, you need to compile newest .cpp with newest libVuforia.so:
Mainly reading the compiler error output nad fixing :) |
@mmihhailov : thank you but i've encountered this error: no method with name='registerHalCamera' signature='(IIILjava/lang/String;[I[I)I' in class Lcom/qualcomm/ar/pl/CameraPreview; JNI WARNING: JNI function FindClass called with exception pending in Ljava/lang/Runtime;.nativeLoad:(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/String; (FindClass) |
did you update vuforia.jar also in ./app/libs folder to match your libVuforia.so ? |
yes I've updated it in rajawalivuforia/libs and all the libVuforia.so files |
seems that you still have .jar and .so mismatch here. What happens here is that it tries to load 'registerHalCamera' from .so with the wrong signature via .jar. You need to verify the paths: |
yes i already changed that and also the .so files in these paths: ./rajawalivuforia/src/main/libs/armeabi-v7a |
Sorry that you have to go through all this trouble to update to the latest Vuforia! I'll have a look at this myself when I find the time. Its been a while since the Vuforia version was updated. |
okay, Im currently using sdk vuforia 5-0-10 |
Well, in this case it would be feasible to port it all to Java. Did it for test purposes and seems to work just fine. Took the 'hammer' approach: Created class RajawaliVuforiaManager and ported all native code to Java to this class and then used this static class from RajawaliVuforiaRenderer and RajawaliVuforiaActivity. Haven't found the time to get rid of the RajawaliVuforiaActivity yet :) But this is next in my task list. |
@mmihhailov hello again! thank you a lot for your help. Error:(152, 21) error: method setInitParameters in class QCAR cannot be applied to given types; And there is no buildNative task under 'other' menu in gradle scripts actually there is no other menu in gradle scripts. can you please help me in that ? And I will be so grateful if you send me the java files! Thank you again. |
@mmihhailov thank you again. I would like to look at your java files also. I will be grateful if you could send me those. thank you! |
Will take a look, change few things. Currently performance is quite poor on weaker devices, like Samsung GT-I9100. Skips at least 3rd of frames. I suspect it has something to do with the fact that both, Vuforia and Rajawali try to use OpenGL at the same time and there is some kind of race condition. Also I suspect that the surface (video coming from camera) is rendered twice: first by Vuforia and then again by Rajawali, using each frame as texture on ScreenQuad. |
@mmihhailov what about the error I had ? Do you know any solution for that ? |
@RandAmro There are few things that you need to do also in Java code. Vuforia API has changed a lot since 3.. For example, all QCAR. has changed to Vuforia.*. If you take a look at the Java reference at developer.vuforia.com, you see that setInitParameters() signature has changed. Now it also requires the vuforia license key to be given as parameter. You can retrieve this when you register at developer.vuforia.com and ask in the License Manager section for a new key. C'mon guys, you can figure out those simple things yourselves ;) |
@mmihhailov : how to handle this issue? java.lang.UnsatisfiedLinkError: Native method not found: com.qualcomm.ar.pl.CameraPreview.newFrameAvailable:(IIII[BJ)V |
Hi @mmihhailov thank you for the brief explanation. But I don't quiet understand where to put this script: task buildNative(type:Exec, description: 'Compile JNI with NDK'){ task cleanNative(type:Exec, description: 'Compile JNI with NDK'){ under 'other' menu in gradle scripts? in the build.gradle for rajawalivuforia module? Sorry for the dummy question. Thank you |
Has anyone fully succeeded in the integration? I think I have done what @mmihhailov was telling to do by my own, anyway I had some problems with background rendering, now it is okay but the model is floating around the target. It is not situated in the center but when I move the device, the model also moves more than it should. Are there any changes needed in calculating projectionMatrix or something else? |
@mmihhailov thanks for instructions. Can you please send the java file, having a problem with native methods |
@mmihhailov thanks for you help, use latest Vuforia SDK generate libRajawaliVuforia.so file . but when i run rajawalivuforiaexample get error log as below: |
Now, the latest version of vuforia is 4-2-3.
Can I upgrade project by override Vuforia.jar and libVufoia.so in libs and src/main/libs folder
The text was updated successfully, but these errors were encountered: