Announcement

Collapse
No announcement yet.

Augmented Reality for UE4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Thank you for your responses! I figured it out, turns out the OBB is extracted to another folder if you don't set all your project names (at packaging etc) to the exact same name.

    Comment


      Hi,
      How i can include ARToolkitComponent.h to my c++ files ?

      Compiler couldn't found the file, I tried this style but not wroking:
      #include "ARToolkitPlugin/Public/ARToolkitComponent.h"

      ERROR : Cannot open include file: 'ARToolkitPlugin/Public/ARToolkitComponent.h': No such file or directory

      Also i tried to add this code to build file but complier get another error:


      PrivateDependencyModuleNames.AddRange(new string[] {"ARToolkitPlugin" });


      [2016.06.20-22.16.59:374][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(59) : error C3646: 'matrix': unknown override specifier
      [2016.06.20-22.16.59:374][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(59) : error C2143: syntax error: missing ',' before '['
      [2016.06.20-22.16.59:374][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(59) : error C2143: syntax error: missing ')' before ';'
      [2016.06.20-22.16.59:374][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(59) : error C2238: unexpected token(s) preceding ';'
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(64) : error C2143: syntax error: missing ';' before '*'
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(64) : error C2238: unexpected token(s) preceding ';'
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(65) : error C3646: 'filterCutoffFrequency': unknown override specifier
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(66) : error C3646: 'filterSampleRate': unknown override specifier
      [2016.06.20-22.16.59:375][444]CompilerResultsLog:Error: Error c:\users\...\plugins\artoolkitplugin\source\artoolkitplugin\public\ARToolkitFunctionLibrary.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      Last edited by Vahid; 06-20-2016, 06:34 PM.
      ABC Augmented Reality by UE4
      GooglePlay

      ArchVis VR

      Comment


        So i've been messing with this for a bit now, and I noticed the actual object is being moved instead of the camera. Does this mean we won't be able to use lightmass on an object? Is there a way to make the object stationary and have the camera move around instead?

        Comment


          Originally posted by Tom H View Post
          I'm having trouble with running this on my Nexus 9. It works just fine some of the time, but other times it will run for a few seconds and then hard reset the tablet, rebooting it!
          It's weird because it works just fine on my much older Samsung Galaxy S4 and never crashes.
          Has anyone else experienced this?
          The adb logcat output isn't giving me much to go on, only that it occurs as below:

          LogInit: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
          04-02 14:08:29.083 2671 2686 D UE4 : [2016.04.02-13.08.29:083][ 0]LogInit: Object subsystem initialized
          04-02 14:08:29.083 2671 2686 D UE4 : [2016.04.02-13.08.29:083][ 0]LogAndroid: Requires 32BPP Encoding: no
          04-02 14:08:29.084 2671 2686 D UE4 : [2016.04.02-13.08.29:084][ 0]LogAndroid: Requires Mosaic: no
          04-02 14:08:29.084 2671 2686 D UE4 : [2016.04.02-13.08.29:084][ 0]LogAndroid: Setting Width=2048 and Height=1536 (requested scale = 0 = auto)
          <---- Crashes here, according to logcat. The following lines are from when it works. ---->
          04-02 14:08:29.084 2671 2686 D UE4 : [2016.04.02-13.08.29:084][ 0]LogAndroid: Checking 16 rules from DeviceProfile ini file.
          04-02 14:08:29.084 2671 2686 D UE4 : [2016.04.02-13.08.29:084][ 0]LogAndroid: Default profile: Android_Default
          04-02 14:08:29.084 2671 2686 D UE4 : [2016.04.02-13.08.29:084][ 0]LogAndroid: GpuFamily: NVIDIA Tegra
          04-02 14:08:29.085 2671 2686 D UE4 : [2016.04.02-13.08.29:085][ 0]LogAndroid: GlVersion: OpenGL ES 3.1 NVIDIA 343.00
          04-02 14:08:29.085 2671 2686 D UE4 : [2016.04.02-13.08.29:085][ 0]LogAndroid: AndroidVersion: 6.0.1
          04-02 14:08:29.085 2671 2686 D UE4 : [2016.04.02-13.08.29:085][ 0]LogAndroid: DeviceMake: htc
          04-02 14:08:29.085 2671 2686 D UE4 : [2016.04.02-13.08.29:085][ 0]LogAndroid: DeviceModel: Nexus 9
          04-02 14:08:29.085 2671 2686 D UE4 : [2016.04.02-13.08.29:085][ 0]LogAndroid: Selected Device Profile: [Android_TegraK1]


          Does anyone have any ideas?
          Is this a nexus 9 issue? My suspicion is that it's something to do with accessing the camera, perhaps buffer issues, memory usage or similar. But I don't have much to go on.
          Hey Tom,

          I'm having the same problem on my Nexus 9! Did you have any luck with it since?

          Comment


            Originally posted by envaal View Post
            So i've been messing with this for a bit now, and I noticed the actual object is being moved instead of the camera. Does this mean we won't be able to use lightmass on an object? Is there a way to make the object stationary and have the camera move around instead?

            If you want to move the camera not the subject you need to use the Camera Posiition / Camera Rotation outputs of the GetMarker node.
            http://www.unreal4ar.com/get-marker/

            Check out the motorbike example for reference.
            AR plugin for UE4
            AR Virtual Mirror plugin for UE4
            Red Alert 2 VR remake
            Armed Island VR RTS

            Comment


              Originally posted by AdamHorvath View Post
              If you want to move the camera not the subject you need to use the Camera Posiition / Camera Rotation outputs of the GetMarker node.
              http://www.unreal4ar.com/get-marker/

              Check out the motorbike example for reference.
              Man.. i really need to learn how to read

              Comment


                Hi!

                Apologies if this info is already out there, I couldn't find it searching through this thread.

                Anyway, just popping in to quickly share the fix that worked for me after hitting this error when building for android:
                Note: This is using Commercial Plugin V1.5R1
                LogPlayLevel: UnrealBuildTool: [1/2] clang++.exe Module.Launch.cpp [armv7-es2]
                LogPlayLevel: UnrealBuildTool: In file included from G:/Timecode/TEST/ARTest/Intermediate/Build/Android/ARTest/Development/Launch/Module.Launch.cpp:3:
                LogPlayLevel: UnrealBuildTool: G:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Android\AndroidJNI.cpp(873,2) : error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Werror,-Wmismatched-new-delete]
                LogPlayLevel: UnrealBuildTool: delete buf;
                LogPlayLevel: UnrealBuildTool: ^
                LogPlayLevel: UnrealBuildTool: []
                LogPlayLevel: UnrealBuildTool: G:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Android\AndroidJNI.cpp(868,21) : note: allocated with 'new[]' here
                LogPlayLevel: UnrealBuildTool: signed char* buf = new signed char[len];
                LogPlayLevel: UnrealBuildTool: ^
                LogPlayLevel: UnrealBuildTool: 1 error generated.
                LogPlayLevel: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: G:\Timecode\TEST\ARTest\Binaries\Android\ARTest-armv7-es2.so

                Basically you need to do exactly what the error message says

                Head on down to line 873 of Android JNI.cpp and change delete buf; to delete[] buf;
                There is no need to rebuild the engine as the file is linked only at packaging time as far as I can tell.

                Hopefully this helps someone out there.

                Many thanks to AdamHorvath for the awesome plugin!!

                Comment


                  Originally posted by TimecodePete View Post
                  Hi!

                  Apologies if this info is already out there, I couldn't find it searching through this thread.

                  Anyway, just popping in to quickly share the fix that worked for me after hitting this error when building for android:
                  Note: This is using Commercial Plugin V1.5R1
                  LogPlayLevel: UnrealBuildTool: [1/2] clang++.exe Module.Launch.cpp [armv7-es2]
                  LogPlayLevel: UnrealBuildTool: In file included from G:/Timecode/TEST/ARTest/Intermediate/Build/Android/ARTest/Development/Launch/Module.Launch.cpp:3:
                  LogPlayLevel: UnrealBuildTool: G:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Android\AndroidJNI.cpp(873,2) : error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Werror,-Wmismatched-new-delete]
                  LogPlayLevel: UnrealBuildTool: delete buf;
                  LogPlayLevel: UnrealBuildTool: ^
                  LogPlayLevel: UnrealBuildTool: []
                  LogPlayLevel: UnrealBuildTool: G:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Android\AndroidJNI.cpp(868,21) : note: allocated with 'new[]' here
                  LogPlayLevel: UnrealBuildTool: signed char* buf = new signed char[len];
                  LogPlayLevel: UnrealBuildTool: ^
                  LogPlayLevel: UnrealBuildTool: 1 error generated.
                  LogPlayLevel: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: G:\Timecode\TEST\ARTest\Binaries\Android\ARTest-armv7-es2.so

                  Basically you need to do exactly what the error message says

                  Head on down to line 873 of Android JNI.cpp and change delete buf; to delete[] buf;
                  There is no need to rebuild the engine as the file is linked only at packaging time as far as I can tell.

                  Hopefully this helps someone out there.

                  Many thanks to AdamHorvath for the awesome plugin!!
                  I had this problem a few days ago .

                  do you have any suggest for post #347 ?
                  ABC Augmented Reality by UE4
                  GooglePlay

                  ArchVis VR

                  Comment


                    Originally posted by jpmeouchi View Post
                    [ATTACH=CONFIG]96655[/ATTACH]

                    Does anyone knows why is my model broke? can it be because is too complex?
                    I have this same problem, did you guys figure this out?

                    Edit:
                    This also occurs with a binary installation of the UE4 editor. Seems more is going on...

                    Edit2:

                    There we go: https://answers.unrealengine.com/que...in-mobile.html
                    Last edited by envaal; 06-22-2016, 08:18 AM.

                    Comment


                      Originally posted by Vahid View Post
                      I had this problem a few days ago .

                      do you have any suggest for post #347 ?
                      Hi Vahid!

                      I'm a bit busy today so I didn't get to look into it much, but I did find that I could get it to compile as follows:

                      In MyGameMode.cpp
                      #include "ARToolkitComponent.h"

                      In MyGame.Build.cpp
                      PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ARToolkitPlugin", "ARToolkit" });

                      In Plugins/ARToolkit/ARToolkitFunctionLibrary.h, at the top of the file above #include "ARToolkitFunctionLibrary.generated.h"

                      #ifdef _WIN64
                      #include "AllowWindowsPlatformTypes.h"

                      #include <dshow.h>
                      #pragma comment(lib, "strmiids")
                      #endif

                      #if defined __APPLE__
                      #import <AVFoundation/AVFoundation.h>
                      #import <CoreVideo/CoreVideo.h>
                      #endif



                      #include <AR/video.h>
                      #include <AR/ar.h>
                      #include <AR/config.h>
                      #include <AR/param.h>

                      //NFT
                      #include <AR/arMulti.h>
                      #include <AR/arFilterTransMat.h>
                      #include <AR2/tracking.h>

                      #ifdef _WIN64
                      #include "HideWindowsPlatformTypes.h"
                      #endif

                      Which comes from the private precompiled headers for the plugin. I'm guessing ARFilterTransMatInfo & ARdouble types are defined somewhere in there and since they are in precompiled header, when another assembly tries to compile them it can't find them.

                      It's not much of a solution but hopefully it can provide a path for investigation

                      Comment


                        Originally posted by TimecodePete View Post
                        Hi Vahid!

                        I'm a bit busy today so I didn't get to look into it much, but I did find that I could get it to compile as follows:

                        In MyGameMode.cpp
                        #include "ARToolkitComponent.h"

                        In MyGame.Build.cpp
                        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ARToolkitPlugin", "ARToolkit" });

                        In Plugins/ARToolkit/ARToolkitFunctionLibrary.h, at the top of the file above #include "ARToolkitFunctionLibrary.generated.h"

                        #ifdef _WIN64
                        #include "AllowWindowsPlatformTypes.h"

                        #include <dshow.h>
                        #pragma comment(lib, "strmiids")
                        #endif

                        #if defined __APPLE__
                        #import <AVFoundation/AVFoundation.h>
                        #import <CoreVideo/CoreVideo.h>
                        #endif



                        #include <AR/video.h>
                        #include <AR/ar.h>
                        #include <AR/config.h>
                        #include <AR/param.h>

                        //NFT
                        #include <AR/arMulti.h>
                        #include <AR/arFilterTransMat.h>
                        #include <AR2/tracking.h>

                        #ifdef _WIN64
                        #include "HideWindowsPlatformTypes.h"
                        #endif

                        Which comes from the private precompiled headers for the plugin. I'm guessing ARFilterTransMatInfo & ARdouble types are defined somewhere in there and since they are in precompiled header, when another assembly tries to compile them it can't find them.

                        It's not much of a solution but hopefully it can provide a path for investigation
                        Thanks for your reply, It's ok and i could compile engine.
                        And when i trying to include in MyGameCamera.h
                        Code:
                        #include "ARToolkitComponent.h"
                        
                        UPROPERTY(VisibleDefaultsOnly, Category = "AR")	
                        UARToolkitComponent* ARTool;
                        and then in MyGameCamera.cpp

                        Code:
                        ARTool = CreateDefaultSubobject<UARToolkitComponent>(TEXT("ARTool"));
                        Compiler Error is :

                        Code:
                        CompilerResultsLog: Info    Creating library C:\Users\...\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyGame-2077.lib and object C:\Users\...\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyGame-2077.exp
                        CompilerResultsLog:Error: Error MyGameCamera.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UARToolkitComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UARToolkitComponent@@CAPEAVUClass@@PEB_W@Z) referenced in function "public: class UARToolkitComponent * __cdecl UObject::CreateDefaultSubo
                        bject<class UARToolkitComponent>(class FName,bool)" (??$CreateDefaultSubobject@VUARToolkitComponent@@@UObject@@QEAAPEAVUARToolkitComponent@@VFName@@_N@Z)
                        CompilerResultsLog: Info LINK : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
                        CompilerResultsLog: Info    Creating library C:\Users\...\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyGame-2077.lib and object C:\Users\...\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyGame-2077.exp
                        CompilerResultsLog:Error: Error MyGameCamera.cpp.obj : error LNK2001: unresolved external symbol "private: static class UClass * __cdecl UARToolkitComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UARToolkitComponent@@CAPEAVUClass@@PEB_W@Z)
                        CompilerResultsLog:Error: Error C:\Users\...\Binaries\Win64\UE4Editor-MyGame-2077.dll : fatal error LNK1120: 1 unresolved externals
                        CompilerResultsLog: Info ERROR: UBT ERROR: Failed to produce item: C:\Users\...\Binaries\Win64\UE4Editor-MyGame-2077.dll
                        Also I tried adding ELEMENTAL_API to UARToolkitComponent but i couldn't compile plugin

                        class ELEMENTAL_API UARToolkitComponent : public USceneComponent
                        Last edited by Vahid; 06-22-2016, 01:49 PM.
                        ABC Augmented Reality by UE4
                        GooglePlay

                        ArchVis VR

                        Comment


                          Hi Vahid!

                          I can't test it right away, but off the top of my head does your MyGame.Build.cpp contain the ARToolkitPlugin and ARToolkit in PublicDepencyModuleNames?

                          Also does your C++ project have a Plugins folder in the root (\MyGame\Plugins) containing the ARToolkitPlugin and ARToolkit folders from the Unreal4AR zip file (Path is \SampleProject\Plugins\ARToolkitPlugin & \SampleProject\Plugins\ARToolkitPlugin\Source\ThirdParty\ARToolkit respectively)?

                          Actually you might not need the ARToolkit at all, just ARToolkitPlugin.
                          I just did some quick & dirty copy pasting this morning, lol.

                          Comment


                            Originally posted by TimecodePete View Post
                            Hi Vahid!

                            I can't test it right away, but off the top of my head does your MyGame.Build.cpp contain the ARToolkitPlugin and ARToolkit in PublicDepencyModuleNames?

                            Also does your C++ project have a Plugins folder in the root (\MyGame\Plugins) containing the ARToolkitPlugin and ARToolkit folders from the Unreal4AR zip file (Path is \SampleProject\Plugins\ARToolkitPlugin & \SampleProject\Plugins\ARToolkitPlugin\Source\ThirdParty\ARToolkit respectively)?

                            Actually you might not need the ARToolkit at all, just ARToolkitPlugin.
                            I just did some quick & dirty copy pasting this morning, lol.
                            MyGame.Build.cpp :
                            PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ARToolkitPlugin", "ARToolkit" });

                            and Yes i have those folder

                            Also I tried adding ELEMENTAL_API to UARToolkitComponent but i couldn't compile plugin

                            class ELEMENTAL_API UARToolkitComponent : public USceneComponent
                            ABC Augmented Reality by UE4
                            GooglePlay

                            ArchVis VR

                            Comment


                              Is there a way to see how the model will be projected on the marker? ie. I have a marker with a city plan and I want to place houses on their respective lots. Now it's kind of guesswork to see where the model is going to end up relative to the marker.

                              Comment


                                Originally posted by envaal View Post
                                Is there a way to see how the model will be projected on the marker? ie. I have a marker with a city plan and I want to place houses on their respective lots. Now it's kind of guesswork to see where the model is going to end up relative to the marker.
                                No direct way for that, but you can add a plane with the texture of the marker to your scene and use it for reference.
                                AR plugin for UE4
                                AR Virtual Mirror plugin for UE4
                                Red Alert 2 VR remake
                                Armed Island VR RTS

                                Comment

                                Working...
                                X