Object Tracker / 3D Map Problems
1. SDK Version: 4.0.1
2. Development Environment: Unity
3. Tracker/Scanner:Object Tracker
4. License Type: Free/Evaluation
5. Target Device(Optional): Huawei MediaPad T3
To whom it may concern,
I am currently working on a project to visualise assembly and disassembly of industrial machines. I started with the ObjectTrackable sample scene in the Unity package. I replaced the .3dmap with one featuring a UK power outlet. When I built this project I was able to see my AR text objects appear onscreen when I pointed the camera at a standard UK socket. After adding some animations, I was then able to disassemble a virtual socket onscreen using key presses to cycle through animations. This worked perfectly. After a few days of doing unrelated animation work, I rebuilt the project only to see that it was not recognising the socket or displaying any AR content. I notice that when i click "play" in the editor, instead of unenabling my AR objects and waiting for Object recognition, It simply displays them in the viewport. Thinking this was a problem specific to 4.0.1, I tried a small sample project with 4.1.1. Using the Object Tracker sample scene again, I tried to drop my socket .3dmap file into the Object Trackable Behaviour script. This caused unity to crash. Repeating this procedure produced the same results. The attached images demonstate my scene from the 4.0.1 version. You can see from the second image, the virtual socket faceplate stays active during runtime and stays static in the middle of the screen. This is also true when displaying on device. The device shows a camera feed with the same static view of the AR socket, similar to the editor. If anyone could be of help, that would be fantastic as this has me dumbfounded.
Thanks for your time,
Matt
Hello matthew.quinn.
I think that the content is not normally placed on the mesh. View and follow linked tutorials.
https://www.youtube.com/watch?v=L-_F1fMu_kA&t=278s
And the 3d map generated using Map Manager is compatible with SDK versions below 4.1. If you try to use the 3d map generated using Map Manager in SDK 4.1 or later, there will be a conflict because the parameters do not match.
Thank you.
Leo
Maxst Support Team
Hi Leo,
Thanks for your quick reply. I eventually got this working again by recreating the scene from scratch. My only difference being that I forced Unity to use OpenGL on startup. Does that mean that 3D maps and Object Tracking will be phased out from 4.1.1 onwards?
Regards,
Matt
Hi matthew.quinn.
I reread the above answer and realized that my explanation was not enough. I'm sorry.
3dmap created using an app called Map Manager can be used in versions below 4.1.0, and in version 4.1.0 or later, 3dmap is created using an application called Visual Slam Tool. Depending on the SDK version, the configuration of 3dmap is slightly different, so the compatible maps are different.
Leo
Maxst Support Team
Hi Leo,
Thanks again for clearing that up. We have decided to upgrade our project to use version 4.1.1 as we need a more accurate way of capturing maps and the new Visual SLAM Tool seems to remove unwanted and excessive background feature points. To test 4.1.1, I have loaded the unitypackage in a new project. The attached picture is the results. There seems to be some kaleidoscope-type glitch where the camera feed is torn or folded over on itself. The scene I was testing was the VisualSLAM scene copied from 4.0.1 but every example scene that comes with the SDK shows this glitch. I cannot find any other mention on the internet of something like this happening, so it would be great to have an opinion of what the problem is. I'm also interested in whether or not 4.1.1 comes with any facilities for creating a custom map creation app or scene?
Kind Regards,
Matt
Update: This camera feed glitch happens when I build any project that uses the camera with Unity build 2019.1.7f1.
I have rolled back to build 2018.3.10f1 and this is no longer a problem.
The problem is that the Unity version is being upgraded to 2019, and the way it processes textures is different. The problem is that the screen is split in half and looks like a mirror. We support Unity 2019 officially in this bug fix. You can get the version and use it, or if you're busy, you can modify the code below.
private void CreateCameraTexture(int imageWidth, int imageHeight, ColorFormat imageFormat) { ... uvs[0].x = 0; uvs[0].y = 1; uvs[1].x = 1; uvs[1].y = 0; uvs[2].x = 1; uvs[2].y = 1; uvs[3].x = 0; uvs[3].y = 0; ... }
uvs[0].x = 0; uvs[0].y = 1;
uvs[1].x = 1; uvs[1].y = 1;
uvs[2].x = 0; uvs[2].y = 0;
uvs[3].x = 1; uvs[3].y = 0;
Please try to fix this.
Thank you.
Leo
Maxst Support Team