Giter Club home page Giter Club logo

immersal-rest-map-constructor's Introduction

Immersalマップつくる君β

About

Immersalマップつくる君βです。
ARFoundationとImmersal REST APIを使ってImmersalのマップを作ることができます。

公式のMapperと比べて以下のようなメリットがあります。

  • オフラインでスキャンすることができる
    • 通信料を心配する必要がなく、そもそも電波が悪い場所でスキャンができない問題を解決する
  • スキャンデータを手元で確認することができる

個人利用で満足してしまっていて仕様が奇怪かもしれないので、 良い案があればdiscussionやissueで教えてもらえると嬉しいです。

Tested Environment

  • Windows10 Home
  • Google Pixel 4a 5G
  • Unity 2020.3.11f1
  • ARFoundation 4.1.7
  • UniTask 2.2.5

Usage

マップを作成するには2つの工程があります。

1. スキャン

Assets/ImmersalRestMapConstructor/Scenes/main.unityというシーンを開きます。 ImmersalCaptureComponentというコンポーネントのTask Forという値が Captureになっていることを確認し、モバイル向けにビルドします。

uGUIが雑なので端末によって調整が必要かもしれないです。

img

ビルドして実行するときに、 画面一番下のcaptureボタンを押して画像をキャプチャしていき、 一通りマップ用の画像を収集出来たらsaveボタンを押します。

2. マップ作成

1.の工程が終わったらスマホをPCに繋ぎ、 ストレージからキャプチャデータを回収します。 キャプチャデータはスマホのApplication.persistantDataPathに保存されています。 スマホからデータが回収出来たら、今度はそのデータをPCのApplication.persistantDataPath に保存します。

例として、Androidからデータを回収してWindowsに保存する場合は、

OS パスの場所
Android \内部共有ストレージ\Android\data\com.ninisan.immersalrestmapconstructer\files\
Windows C:\Users\(ユーザ名)\AppData\LocalLow\ninisan\immersal-rest-map-constructer\

にそれぞれあります。

PCの保存先でjsonファイルをimageData.jsonに名前変更します。

img

imageData.jsonを開いて、tokenにImmersalのトークンを、 nameをマップの名前に適切に変更します。

{
    "token": "<Immersalトークンをここに>",
    "name": "<マップの名前>",
    "focalLength": {
        "x": 1527.4532470703125,
        "y": 1524.97412109375
    },
    "principalOffset": {
        "x": 965.487060546875,
        "y": 538.1068725585938
    },
    "images": [
        {
            "pose": {
                "position": {
                    "x": -0.04361090809106827,
                    "y": 0.09609214961528778,
                    "z": -0.20024517178535462
                },
                "rotation": {
                    "x": 0.22968900203704835,
                    "y": 0.26603496074676516,
                    "z": -0.05303370580077171,
                    "w": 0.9346954822540283
                }
            },
            "run": 0,
            "anchor": false,
            "location": {
                "longitude": 140.1363983154297,
                "latitude": 35.98657989501953,
                "altitude": 65.52093505859375
            },
            "filename": "20211003-234035_0.png"
        },
        {
            "pose": {
                "position": {
                    "x": -0.00240354984998703,
                    "y": 0.09630519151687622,
                    "z": -0.23142094910144807
                },

UnityエディタでImmersalマップつくる君βのプロジェクトを開き、 ImmersalCaptureComponentのTask ForプロパティをMap Constructionに変更し、 実行すればImmersalでマップの作成が開始されます。

img

Contact

何かございましたら にー兄さんのtwitter まで ご連絡いただけると幸いです。

immersal-rest-map-constructor's People

Contributors

drumath2237 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

immersal-rest-map-constructor's Issues

キャプチャ時に固まる問題の分析

キャプチャ時に固まる。メインスレッドをどの処理科がブロックしているんだろう
重い処理は全部非同期で書いたつもりなんだけどなぁ......

  • XRCpuImage -> Texture2D -> png への変換
  • キャプチャ画像の保存

のどちらかでブロックしているんだと思う

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.