AR Indoor Navigation by hsh0321 - 1

AI

AR-Indoor-navigation for Unity

Unknown VersionUnknown LicenseUpdated 25 days agoCreated on August 25th, 2020
Go to source

Indoor-Navigation-ARCore

ꡬ글 ARcore SDKλ₯Ό μ΄μš©ν•˜μ—¬ μ•ˆλ“œλ‘œμ΄λ“œ λ‚΄λΉ„κ²Œμ΄μ…˜ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜μ„ κ΅¬ν˜„ν•˜μ˜€λ‹€.(Unity3D Project)

Project Info ❓ :

  • Engineγ€€γ€€γ€€γ€€ : Unity - 2018.3.4f
  • IDE γ€€γ€€γ€€γ€€γ€€ : Eclipse - 2020-03
  • Languageγ€€γ€€γ€€: C#, Java13, Python
  • SDK, Libraryγ€€ γ€€: ARcore v1.15.0, Tensorflow 1.15 for GPU

Features ❗ :

  • BLE Beacon을 μ΄μš©ν•œ μ‹€λ‚΄ μœ„μΉ˜ μΈ‘μœ„ μ‹œμŠ€ν…œ
  • ARcore Slam μ•Œκ³ λ¦¬μ¦˜μ„ μ΄μš©ν•œ μƒλŒ€μ  μœ„μΉ˜ μ—…λ°μ΄νŠΈ
  • Server(PC)μ—μ„œ Machine Learning model의 output을 λ‹¨λ§κΈ°λ‘œ 전솑
  • Unityμ—μ„œ λΈ”λ£¨νˆ¬μŠ€ μ‹ ν˜Έλ₯Ό μˆ˜μ‹ ν•˜κΈ° μœ„ν•˜μ—¬ Native μ•ˆλ“œλ‘œμ΄λ“œ κΈ°λŠ₯을 μ‚¬μš©ν•˜κΈ°μœ„ν•˜μ—¬ JAR파일둜 ν”ŒλŸ¬κ·ΈμΈ 생성

discussion ⚠ :

μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜μ„ μ œμž‘ν•˜λ©΄μ„œ 전체적인 UIλ‚˜ Logic등을 κ΅¬μ„±ν•˜λŠ” 것이 ν₯λ―Έλ‘œμ› λ˜ ν”„λ‘œμ νŠΈμ˜€λ‹€. 컴퓨터 κ·Έλž˜ν”½μŠ€ κ³Όλͺ©μ„ μˆ˜κ°•ν•˜μ—¬μ„œ κ·ΈλŸ°μ§€ Unityμ—μ„œ Script μž‘μ„±μ„ ν•  λ•Œ 크게 어렀움을 μ—†μ—ˆλ‹€. OpenGL 라이브러리λ₯Ό μ‚¬μš©ν•˜μ—¬ κ²Œμž„ μ œμž‘μ„ ν•œ κ²½ν—˜μ΄ μžˆλŠ”λ° κ·Έ λ•ŒλŠ” ν•˜λ“œμ½”λ”©μ„ ν•˜μ—¬ μ—„μ²­λ‚œ μ‹œκ°„ 투자λ₯Ό ν•˜μ˜€λŠ”λ° Unity νˆ΄μ—μ„œ μ§€μ›ν•˜λŠ” κΈ°λŠ₯ (카메라,였브젝트 생성) λ“± 맀우 κ°„νŽΈν•˜κ²Œ λ˜μ–΄ μžˆλ‹€λ³΄λ‹ˆ μ΄ν•΄ν•˜λŠ”λ° 어렡지 μ•Šμ•˜λ‹€. λ‹€λ§Œ Unity 자체의 LifeCycleκ³Ό ꡬ성 λ™μž‘μ— λŒ€ν•œ 이해가 μƒˆλ‘­λ‹€λ³΄λ‹ˆ κ°œλ°œμžλ…ΈνŠΈλ₯Ό μ—„μ²­λ‚˜κ²Œ μ°Έκ³ ν•œ κ²½ν—˜μ΄λ‹€. 이 ν”„λ‘œμ νŠΈλ₯Ό μ§„ν–‰ν•˜λ©΄μ„œ 어렀움을 κ²ͺμ—ˆλ˜ 것은 Unityλ₯Ό μ‚¬μš©ν•΄ κ²Œμž„μ„ λ§Œλ“€λ‹€ 보면 Android μ•Œλ¦Ό(둜컬 ν‘Έμ‹œ)을 μ‚¬μš©ν•˜κ±°λ‚˜ Unity Plugin으둜 μ§€μ›ν•˜μ§€ μ•ŠλŠ” SNS κΈ°λŠ₯을 μ‚¬μš©ν•΄μ•Ό ν•˜λŠ” 경우 λ„€μ΄ν‹°λΈŒλ‘œ κΈ°λŠ₯을 κ΅¬ν˜„ν•΄μ•Ό ν•˜λŠ” 상황이 μ’…μ’… λ°œμƒν•˜κ²Œ λ©λ‹ˆλ‹€. JAR ν”ŒλŸ¬κ·ΈμΈ 을 ν†΅ν•΄μ„œ C#μ—μ„œ Java λ©”μ†Œλ“œλ₯Ό ν˜ΈμΆœν•˜κ³  Javaμ—μ„œ C# λ©”μ†Œλ“œλ₯Ό ν˜ΈμΆœν•˜λŠ” 방법을 μ°Ύμ•„ 이 방법을 ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

Contribute πŸ˜€ :

λ³Έ μ—°κ΅¬μ—μ„œλŠ” 기쑴의 Beacon을 μ΄μš©ν•œ μ‹€λ‚΄ μœ„μΉ˜ μΈ‘μœ„μ˜ μ„±λŠ₯을 κ°œμ„ ν•˜κ³  μ¦κ°•ν˜„μ‹€ μ‘μš© μ†Œν”„νŠΈμ›¨μ–΄λ₯Ό κ΅¬ν˜„ν•˜μ˜€λ‹€. λ¨Έμ‹ λŸ¬λ‹μ„ μ‹œν‚€κΈ° μœ„ν•΄μ„œλŠ” λ§Žμ€ μ–‘μ˜ 데이터가 ν•„μš”ν•˜λ‹€. λ”°λΌμ„œ, μ‹€ν—˜ν•  ν™˜κ²½μ„ κ°–μΆ”κ³  μ•½ 3만개의 데이터λ₯Ό μˆ˜μ§‘ν•˜μ˜€λ‹€. Beacon의 νŠΉμ„±μƒ μ‹ ν˜Έκ°€ λΆˆμ•ˆμ •ν•˜κΈ° λ•Œλ¬Έμ—, 더 μ •ν™•ν•œ κ²°κ³Ό 값을 μœ„ν•΄μ„œ 각각의 μ‹ ν˜Έλ₯Ό 데이터 μ²˜λ¦¬κ³Όμ •μ„ ν†΅ν•˜μ—¬ μ•ˆμ •ν™” μ‹œν‚¨ ν›„ 쀑볡 데이터λ₯Ό μ œκ±°ν•œ ν›„μ˜ κ°œμˆ˜λŠ” μ•½ 1만개 μ •λ„λ‘œ κ°μ†Œν•˜μ˜€λ‹€.  더 μ •ν™•ν•œ μ‹€λ‚΄ μœ„μΉ˜λ₯Ό μΈ‘μ •ν•˜κΈ° μœ„ν•΄μ„œλŠ” λͺ‡ 가지 κ°œμ„ μ μ΄ ν•„μš”ν•˜λ‹€κ³  μƒκ°λœλ‹€. λ¨Όμ €, λ°μ΄ν„°μ˜ 양은 λ§Žμ„μˆ˜λ‘ 정확도가 μƒμŠΉν•œλ‹€. λ”°λΌμ„œ 데이터λ₯Ό μ²˜λ¦¬ν•˜μ˜€μ„ λ•Œ, 각 μ’Œν‘œλ§ˆλ‹€ μ•½ 500κ°œμ”©μ˜ 데이터가 μžˆλ„λ‘ 데이터λ₯Ό μˆ˜μ§‘ν–ˆμ–΄μ•Ό ν•œλ‹€. κ·Έλ ‡λ‹€λ©΄ μ§€κΈˆμ˜ 데이터에 λΉ„ν•΄ μ•½ 5배의 데이터λ₯Ό ν•™μŠ΅μ‹œν‚¬ 수 μžˆμœΌλ―€λ‘œ 더 μ •ν™•ν•œ κ²°κ³Ό 값이 λ‚˜μ˜¬ 것이닀. λ˜ν•œ 더 μ ν•©ν•œ 기계 ν•™μŠ΅ ꡬ쑰와 ν•„ν„°λ₯Ό μ‚¬μš©ν•œλ‹€λ©΄ μ‹€μƒν™œμ— μ μš©ν•˜λŠ” 것에도 큰 λ¬Έμ œκ°€ 없을 κ²ƒμœΌλ‘œ 보이며, μ΄λŸ¬ν•œ 뢀뢄듀을 κ°œμ„ ν•œλ‹€λ©΄ λΉ„μš©μ΄ μ €λ ΄ν•˜κ³  μ„€μΉ˜κ°€ μš©μ΄ν•œ Beacon을 μ΄μš©ν•˜μ—¬, λ‹€μ–‘ν•œ μ‹€λ‚΄ μœ„μΉ˜ μ„œλΉ„μŠ€λ₯Ό AR ν˜•μ‹μœΌλ‘œ μ œκ³΅ν•˜κΈ° λ•Œλ¬Έμ— μ‚¬μš©μžλ“€μ˜ νŽΈμ˜μ„±μ„ κ·ΉλŒ€ν™”ν•  수 μžˆμ„ 것이닀.

RSSI 값을 μ΄μš©ν•œ μœ„μΉ˜ μ΄ˆκΈ°ν™” code 일뢀뢄
if (rf.isOnClick == true) // Refresh λ²„νŠΌ onClick μ‹œ
{
        Debug.Log("Button is Onclick");
        rf.isOnClick = false;
        sX = rf.scanX; 
        sY = rf.scanY;
        // Native Androidμ—μ„œ μΈ‘μ •ν•œ RSSI Input으둜 λ‚˜μ˜¨ μ’Œν‘œ Output
        cameraTarget.transform.position = new Vector3(sX, 0.0f, sY);
        myCam.transform.position = new Vector3(sX,0.0f,sY);
        Debug.Log("Hwang : After Send" + sX.ToString() + " " + sY.ToString());
}
ARcore SDKλ₯Ό μ΄μš©ν•œ SLAM μ‘μš© (μƒλŒ€μ  μœ„μΉ˜ 좔적)
if (Session.Status != SessionStatus.Tracking)
{
    trackingStarted = false;
    camPoseText2.gameObject.SetActive(true);
    const int LOST_TRACKING_SLEEP_TIMEOUT = 15;
    Screen.sleepTimeout = LOST_TRACKING_SLEEP_TIMEOUT;
    return;
}
else
{
    camPoseText.text = "" + cameraTarget.transform.position;
    camPoseText2.gameObject.SetActive(false);
}

Screen.sleepTimeout = SleepTimeout.NeverSleep;

Vector3 currentARPosition = Frame.Pose.position;
if (!trackingStarted)
{
    trackingStarted = true;
    m_prevARPosePosition = Frame.Pose.position;
}

Vector3 deltaPosition = currentARPosition - m_prevARPosePosition; // μƒλŒ€ μœ„μΉ˜
m_prevARPosePosition = currentARPosition;
if (cameraTarget != null)
{
    cameraTarget.transform.Translate(deltaPosition.x, 0.0f, deltaPosition.z,Space.World);

    //myCam.GetComponent<FollowTarget>().targetRot = Frame.Pose.rotation;
    //cameraTarget.GetComponent<FollowTarget>().targetRot = Frame.Pose.rotation;  
}

γ€€γ€€

γ€€γ€€

Show all projects by hsh0321