Skip to content

Commit 6741e92

Browse files
authored
Merge pull request #59 from artoolkitx/phil-trackables-internal-rework
Phil trackables internal rework
2 parents 8c80e5e + 49f9898 commit 6741e92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+432
-183
lines changed

.gitignore

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ Source/Package/UserSettings
5555

5656
#### Plugin source packages and binaries
5757
Source/artoolkit[xX]-*.zip
58-
Source/artoolKitX.*.dmg
59-
Source/Package/Assets/Plugins/ARX.bundle
60-
Source/Package/Assets/Plugins/ARX.bundle.meta
61-
Source/Package/Assets/Plugins/Android/libs/arm64-v8a/*.so
62-
Source/Package/Assets/Plugins/Android/libs/armeabi-v7a/*.so
63-
Source/Package/Assets/Plugins/Android/libs/x86/*.so
64-
Source/Package/Assets/Plugins/Android/libs/x86_64/*.so
65-
Source/Package/Assets/Plugins/iOS/*.a
66-
Source/Package/Assets/Plugins/x86/*.dll
67-
Source/Package/Assets/Plugins/x86_64/*.dll
58+
Source/artoolkit[xX]*.dmg
59+
Source/Package/Assets/artoolkitX-Unity/Plugins/ARX.bundle
60+
Source/Package/Assets/artoolkitX-Unity/Plugins/ARX.bundle.meta
61+
Source/Package/Assets/artoolkitX-Unity/Plugins/Android/libs/arm64-v8a/*.so
62+
Source/Package/Assets/artoolkitX-Unity/Plugins/Android/libs/armeabi-v7a/*.so
63+
Source/Package/Assets/artoolkitX-Unity/Plugins/Android/libs/x86/*.so
64+
Source/Package/Assets/artoolkitX-Unity/Plugins/Android/libs/x86_64/*.so
65+
Source/Package/Assets/artoolkitX-Unity/Plugins/iOS/*.a
66+
Source/Package/Assets/artoolkitX-Unity/Plugins/x86/*.dll
67+
Source/Package/Assets/artoolkitX-Unity/Plugins/x86_64/*.dll
6868

6969
#### Other

Documentation/README (ARToolKit5-5.3-utils).txt

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Read me for artoolkitX utilities package.
2+
========================================
3+
4+
5+
Contents.
6+
---------
7+
8+
About this archive.
9+
Running the utilities.
10+
Usage information.
11+
12+
About this archive.
13+
-------------------
14+
15+
This archive contains the artoolkitX utilities.
16+
17+
artoolkitX utilities are made available to you under the GNU Lesser General Public License, version 3 (LGPLv3).
18+
19+
artoolkitX utilities package is designed to run on Windows and Macintosh OS X platforms.
20+
21+
22+
Running the utilities
23+
---------------------
24+
25+
artoolkitX includes a set of utilities to perform essential functions required by artoolkitX and/or arunityX. After installation, the executables for these utilities can be found in the SDK/bin directory inside your artoolkitX directory.
26+
27+
Windows:
28+
29+
Each utility can be opened by double-clicking its icon in the artoolkitX\SDK\bin directory. Alternately, you can run it from the command line:
30+
31+
* Open a command-line window (cmd.exe).
32+
* Navigate to your artoolkitX\SDK\bin directory.
33+
* Type (for example): artoolkitx_mk_patt.exe
34+
35+
Mac OS X:
36+
37+
The utilities should be launched from a Terminal window:
38+
39+
* Open a Terminal window (/Applications/Utilties/Terminal).
40+
* Navigate to your artoolkitX/SDK/bin directory.
41+
* Type (for example): ./artoolkitx_mk_patt
42+
43+
44+
Which utilities are included:
45+
-----------------------------
46+
47+
Camera calibration utilities:
48+
* artoolkitx_calib_camera
49+
* artoolkitx_calib_optical
50+
51+
Square marker utilities:
52+
* artoolkitx_mk_patt
53+
* artoolkitx_check_id
54+
* artoolkitx_genMarkerSet
55+
56+
2D texture trackable utilities:
57+
* artoolkitx_check_image_2d_tracking
58+
* artoolkitx_image_database2d
59+
60+
Legacy natural feature tracking (NFT) utilities:
61+
* artoolkitx_genTexData
62+
* artoolkitx_dispImageSet
63+
* artoolkitx_dispFeatureSet
64+
* artoolkitx_checkResolution
65+
66+
Required patterns for the utilities, which you can print out, are found in the folder "patterns" inside the "doc" folder. Images for sample 2D trackables and NFT markers are in the folder "Marker images" inside the "doc" folder.
67+
68+
69+
Usage information
70+
-----------------
71+
Documentation for the utilities is held in the artoolkitX documentation wiki: https://github.com/artoolkitx/artoolkitx/wiki
72+
73+
74+
--
75+
EOF
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[InternetShortcut]
2+
URL=https://au.gmented.com/app/marker/marker.php
3+
IDList=
4+
HotKey=0
5+
IconFile=C:\Users\phil\AppData\Local\Mozilla\Firefox\Profiles\xu4hvgla.dev-edition-default\shortcutCache\U0txz335RpHtDaQqUQoLtw==.ico
6+
IconIndex=0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>URL</key>
6+
<string>https://au.gmented.com/app/marker/marker.php</string>
7+
</dict>
8+
</plist>

Quick start.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@ As a quick start with Unity and artoolkitX you can use one of the example scenes
99

1010
- [Unity](https://store.unity.com/) - the free, Personal Edition, is sufficient for a start. Version 2021.3 was used at the time of this writing. The Unity Editor is supported on the desktop platforms of macOS and Windows.
1111

12-
### Build arunityX
13-
You need to run the build script before you can use this repository. The reason for this is, that arunityX does not ship with the artoolkitX libraries, but it downloads them when you run the build script. It is designed this way to assure arunityX always uses a stable and up to date release of artoolkitX libraries. The version in question is noted in the artoolkitx-version.txt in the root of this repository.
12+
### Build or fetch artoolkitX libraries
13+
14+
If using the artoolkitX for Unity package from source, please note that the source repository does not include the compiled artoolkitX native plugins, so it is necessary to fetch the artoolkitX libraries, or alternately build artoolkitX from source. The `build.sh` script controls this. Normally it downloads the version of artoolkitX as listed in the artoolkitx-version.txt in the root of this repository:
1415

1516
1. Open Terminal on macOS or Git Bash on Windows
16-
2. ```cd Source```
17-
3. Run ```./build.sh [Target platform]```. ```[Target platform]``` can be one or several of *macos, ios, android, windows*
17+
2. `cd Source`
18+
3. Run `./build.sh [Target platform(s)]`, where `[Target platform(s)]` is one or more of *macos, ios, android, windows*.
1819

1920
This will fetch all the dependencies and place them inside the ```Plugins``` directory.
2021

22+
Alernately, if you wish to build artoolkitX from source (e.g. if modifying the native plugin source, or doing native debugging), then you can get artoolkitX via the git submodule and build it as below:
23+
1. Open Terminal on macOS or Git Bash on Windows
24+
2. `cd Source`
25+
3. `git submodule init`
26+
4. `git submodule update`
27+
5. `./build.sh --dev [Target platform(s)]`, where `[Target platform(s)]` is one or more of *macos, ios, android, windows*. Note that you will only be able to build for mac OS or iOS on a mac OS host, for Windows on a Windows host, and Linux on a Linux host. Android can be built on any host platform.
28+
2129
### Bundle the arunityX.unitpackage
22-
To create a arunityX.unitypackage, which can be imported into other Unity3D projects, one needs to run ```./package.sh``` located inside the ```packaging``` directory.
30+
To create a arunityX.unitypackage, which can be imported into other Unity3D projects, one needs to run `./package.sh` located inside the `packaging` directory.
2331

2432

2533
### Import the arunityX.unitypackge Plugin
@@ -46,7 +54,3 @@ Navigate to:
4654
* Select the 'Play'-Button to run the scene inside the Unity3D Editor
4755
* Present on or multiple of the trackables to the camera. A cube should appear on the trackable.
4856

49-
### Building for iOS with XCode
50-
51-
You may get `Error: Undefined symbols for architecture arm64: "_vImageRotate90_ARGB8888"` which means you need to add the Accelerate.framework to your build:
52-
In the project settings editor, select the "Build Phases" tab, and click the small triangle next to "Link Binary With Libraries" to view all of the frameworks in your application. Click the "+" below the list of frameworks and add the `Accelerate.framework`

Release Notes.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# artoolkitX for Unity Release Notes
2+
------------------------------------
3+
4+
## Version 1.1.7
5+
### 2023-05-08
6+
7+
Changes:
8+
* The native plugins folder has been moved inside the artoolkitX-Unity subfolder of the Unity package.
9+
* Added support for runtime auto-detection of barcode (matrix code) markers. When enabled, a new
10+
callback in ARTrackable will auto-add a new ARTrackable for each matrix code trackable detected.
11+
* Improved support for GlobalID barcode markers.
12+
13+
## Version 1.1.6
14+
### 2023-04-21
15+
16+
Bug fixes:
17+
* Fix ARControllerEditor serialization; changes made to ARController in the Unity Editor should be saved now.
18+
* Correct origin on 2D trackable gizmos. Correct prototype for plugin function for pattern image retrieval. Unload when changing trackable properties.
19+
20+
## Version 1.1.5
21+
### 2023-04-12
22+
23+
Changes:
24+
* Refactored ARTrackable to add factory methods for creating new trackables at run time, plus one-shot config for different trackable types.
25+
* Change ARController to be findable by singleton instance.
26+
* Corrected 2D planar tracker orientation and scaling issues.
27+
* Clarified that "2D tracker scale factor" specifies image width, not height.
28+
* Overhauled ARPattern handling, including new support for 2D and NFT surfaces, plus barcodes.
29+
30+
## Version 1.1.4
31+
### 2023-03-30
32+
33+
Changes:
34+
* Corrected a long-standing Windows bug that affected 2D planar tracking with 32-bit video formats.
35+
* Updated the OpenCV build used by the 2D planar tracker on Windows and switched to static OpenCV libraries. This saves users from having to deploy the OpenCV DLLs alongside built apps.
36+
37+
## Version 1.1.3
38+
### 2023-03-23
39+
40+
Changes:
41+
* Added support for setting the number of 2D planar tracker markers that can be simultaneously tracked.
42+
43+
## Version 1.1.2
44+
### 2023-03-16
45+
46+
This is the first official artoolkitX for Unity release in some time. As the project is now using continuous integration and deployment (CI/CD) releases will be a lot more frequent.
47+
48+
Changes:
49+
* Added some extra tracking example images.
50+
* Video source input config is now automatically fetched and can be configured in the Unity Editor or at runtime using the new ARVideoConfig component. This component will automatically be added when first adding an ARController to a new scene.
51+
* A new native video input module (Camera2) on Android removes the requirement for pushing of video frames from Java code over JNI. Some video configuration options have changed. artoolkiX for Unity will automatically add "-native" to the video configuration string to use the new module.
52+
* Updated artoolkitX dependency. Now downloads release artoolkitX packages; special Unity-only packages are no longer required. Also better support for developer mode building of artoolkitX.
53+
* Only runs tracking update on new frames.
54+
* Added pinball image and 2D tracker scene.
55+
* Updated Unity download/install scripts.
56+
* 64-bit libs on Android are now in the Unity package.
57+
* Unity settings update for Unity 2021.3.
58+
* Android projects update to target API 33, minimum API 21 (Android 5.0), with Gradle 7.6, Android Gradle plugin 7.2.2.
59+
* On Android, the minimum supported OS is now Android 7.0 (API level 24).
60+
* On iOS, the minimum supported OS is now iOS v11.0.
61+
* On mac OS, full support for the ARM64 (Apple Silicon) CPU. The minimum supported OS is now mac OS 10.13.
62+
* On Windows, the default Visual Studio version is now VS 2019.
63+
* On Linux, the system OpenCV implementation is preferred.
64+
* Removed dependence on opencv imread(), and therefore highgui, imgcodecs, and various image libs.
65+
66+
--
67+
EOF

Source/Extras/artoolkitx

Submodule artoolkitx updated 35 files

Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public enum ARToolKitMatrixCodeType
246246
AR_MATRIX_CODE_5x5_BCH_22_12_5 = 0x05 | 0x400,
247247
AR_MATRIX_CODE_5x5_BCH_22_7_7 = 0x05 | 0x500,
248248
AR_MATRIX_CODE_6x6 = 0x06,
249-
// AR_MATRIX_CODE_GLOBAL_ID = 0x0e | 0xb00
249+
AR_MATRIX_CODE_GLOBAL_ID = 0x0e | 0xb00
250250
};
251251

252252
public enum ARToolKitImageProcMode
@@ -380,6 +380,10 @@ public struct ARVideoSourceInfoT
380380
private int currentTwoDMaxMarkersToTrack = 1;
381381
[SerializeField]
382382
private AR_LOG_LEVEL currentLogLevel = AR_LOG_LEVEL.AR_LOG_LEVEL_INFO;
383+
[SerializeField]
384+
private bool currentSquareMatrixModeAutocreateNewTrackables = false;
385+
[SerializeField]
386+
private float currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth = 0.08f;
383387

384388
private ARVideoConfig arvideoconfig = null;
385389

@@ -752,6 +756,8 @@ public bool StartAR()
752756
ImageProcMode = currentImageProcMode;
753757
NFTMultiMode = currentNFTMultiMode;
754758
TwoDMaxMarkersToTrack = currentTwoDMaxMarkersToTrack;
759+
SquareMatrixModeAutocreateNewTrackables = currentSquareMatrixModeAutocreateNewTrackables;
760+
SquareMatrixModeAutocreateNewTrackablesDefaultWidth = currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth;
755761

756762
// Prevent display sleep.
757763
Screen.sleepTimeout = SleepTimeout.NeverSleep;
@@ -1351,6 +1357,32 @@ public bool UseVideoBackground
13511357
}
13521358
}
13531359

1360+
public bool SquareMatrixModeAutocreateNewTrackables
1361+
{
1362+
get => currentSquareMatrixModeAutocreateNewTrackables;
1363+
set
1364+
{
1365+
currentSquareMatrixModeAutocreateNewTrackables = value;
1366+
if (_running)
1367+
{
1368+
PluginFunctions.arwSetSquareMatrixModeAutocreateNewTrackables(value, currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth, ARTrackable.OnTrackableEvent);
1369+
}
1370+
}
1371+
}
1372+
1373+
public float SquareMatrixModeAutocreateNewTrackablesDefaultWidth
1374+
{
1375+
get => currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth;
1376+
set
1377+
{
1378+
currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth = value;
1379+
if (_running)
1380+
{
1381+
PluginFunctions.arwSetSquareMatrixModeAutocreateNewTrackables(currentSquareMatrixModeAutocreateNewTrackables, value, ARTrackable.OnTrackableEvent);
1382+
}
1383+
}
1384+
}
1385+
13541386
//
13551387
// Internal methods.
13561388
//

0 commit comments

Comments
 (0)