반응형

해당 글은 아래 posting으로 이전함

https://m.blog.naver.com/younjung1996/223364514538

 

[BLE 실내 측위 프로젝트] Indoor Positioning System 포스팅 리스트

BLE 실내 측위 프로젝트 1. Flutter_blue 설정 (feat.안드로이드12 권한 이슈) : https://m.blog.naver...

blog.naver.com

BLE 실내 측위 프로젝트

1. Flutter_blue 설정 (feat.안드로이드12 권한 이슈) : https://m.blog.naver.com/younjung1996/223334840714

2. Bluetooth Low Energy(BLE) 통신 스케줄, 안드로이드 함께 이해하기 : https://m.blog.naver.com/younjung1996/223357207874

3. Flutter BLE Scan Demo Program, RSSI monitoring : https://m.blog.naver.com/younjung1996/223357242785

4. BLE advertising packet 기본 구성 : https://m.blog.naver.com/younjung1996/223363785615

5. BLE Beacon의 RSSI 값에서 거리를 계산하는 방법 (feat.log distance path loss model) : https://m.blog.naver.com/younjung1996/223363790198

6. RSSI 변동을 해결하기 위한 이동 평균 필터 : https://m.blog.naver.com/younjung1996/223363794361

7. NRF51822 비콘 테스트 및 초기 설정 : https://m.blog.naver.com/younjung1996/223363798262

8. Flutter 좌표 그리기 (데카르트 좌표계) : https://m.blog.naver.com/younjung1996/223363801930

9. Flutter 좌표에 실시간으로 원 그리기 : https://m.blog.naver.com/younjung1996/223363804574

10. 삼변측량 정리 및 구현 : https://m.blog.naver.com/younjung1996/223363808851

11. Flutter BLE indoor position(실내 위치 추적) system demo, 실내 네비게이션 : https://m.blog.naver.com/younjung1996/223364500752

 

관련 이슈 & 디버깅

1. [Debug] Dart matrix2d Transpose debuging, "'double' is not a subtype of type 'int'" : https://m.blog.naver.com/younjung1996/223367275545

728x90
반응형
반응형

안녕하세요. 

 

빠르게 Estimote의 Beacon 세 개를 이용해 안드로이드 폰으로 삼변측량을 구현하기 위해 AltBeacon Library를 사용했습니다. (Beacon 구현)

 

간단하기 때문에 쉽게 구현할 수 있습니다. 중요한 부분만 집어 이야기 하겠습니다.

 

altbeacon.github.io/android-beacon-library/index.html

 

Android Beacon Library

The leading library for detecting beacons on Android. What Does This Library Do? It allows Android devices to use beacons much like iOS devices do. An app can request to get notifications when one or more beacons appear or disappear. An app can also reques

altbeacon.github.io

 

1. Configure (build.gradle)

최신 버전

 

2. Permissions (AndroidManifest.xml)

안드로이드 버전 별 이슈는 위 사이트 참고

 

 

3. Implements (MainActivity.java)

altbeacon.github.io/android-beacon-library/samples.html

 

Android Beacon Library

Reference Application A minimalist reference application for the Open Source Library is available on GitHub that demonstrates basic ranging and monitoring. It is based on the examples below. Requesting Permission IMPORTANT: Your app must request permission

altbeacon.github.io

 

Ranging Example Code를 사용하여 Distance를 구할 수 있다. ( getDistance() 메소드 사용 )

 

하지만 getDistance 메소드 대신 아래 메소드를 추천합니다. ( 실제 실험 환경의 곡선을 가진 방정식 )

protected static double calculateDistance(int measuredPower, double rssi) {
  if (rssi == 0) {
    return -1.0; // if we cannot determine distance, return -1.
  }
  double ratio = rssi*1.0/measuredPower;
  if (ratio < 1.0) {
    return Math.pow(ratio,10);
  }
  else {
    double distance =  (0.89976)*Math.pow(ratio,7.7095) + 0.111;
    return distance;
  }
}

 

4. Error (AltBeacon 종속성 추가)

오류

Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.localbroadcastmanager.content.LocalBroadcastManager"

 

해결 (build.gradle에 추가)

 implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

 

 

5. 응용 (Beacon Parser)

Beacon은 대표적으로 Estimote(Apple)와 EddyStone(Google)이 있으므로, Beacon Scan 하기 위한 Beacon을 parsing 해야 한다. 

 

 

위 오픈소스 설명이 굉장히 잘 돼있기 때문에 자세한 설명은 하지 않고, 큰 틀로 이야기를 진행했습니다.

 

iBeacon이 Eddystone보다 약 2년 정도 일찍 출시되어, Beacon 하면 iBeacon을 많이 이야기합니다. 

 

후속작인 Eddystone은 URL을 Broadcasting 하여 주변 기기에게 전송할 수 있고, TLM을 통해 비콘의 상태를 확인할 수 있습니다. 

www.youtube.com/watch?v=HRP1tfXHiVg&t=67s

passkit.com/blog/what-is-eddystone-and-is-it-the-future-of-beacon-tech/

 

What Is Eddystone and Is It The Future Of Beacon Tech?

Back in July, Google released Eddystone, an open source beacon format that is changing the way we use beacons. Here's what you need to know.

passkit.com

 

 

cf) 삼변측량 Library

github.com/lemmingapex/trilateration

 

lemmingapex/trilateration

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer - lemmingapex/trilateration

github.com

 

728x90
반응형
반응형

안녕하세요.

 

Bluetooth Low Energy를 이용해 실내 측위에 대해 알아보겠습니다. 

 

실내에 iBeacon 4개가 설치되어 있습니다. 

iBeacon는 Advertise의 Payload가 30bytes입니다. (일반 ble는 31bytes)

 

Payload에는 Tx Power(송신 세기 : dBm), RSSI(수신 세기 : dBm)이 있습니다.

 

Tx Power와 RSSI가 있으면 Advertise와 Scanner 사이의 Distance를 구할 수 있습니다. 

 

Distance[m] = 10 ^ ( (Tx Power – RSSI) / (10 * N) )

(N = 보정 상수)

 

 

최소 세 개 정도의 Distance를 구할 수 있다면, 실내 좌표를 구할 수 있다는 것이 Trilateration(삼변 측량)입니다. 

 

distance

 

위 식을 정리하여, 선형대수로 아래처럼 정리할 수 있습니다. 

 

Least Square Solution
A, b
Scanner 좌표

x, y 좌표는 고정 값이며, distance는 ble의 신호 세기를 통해 distance를 구했기 때문에 ϵ를 구할 수 있습니다. 

 

하지만 Height에 대해 고려하지 않았고, 무선 신호 세기가 불안전하기 때문에 오차 범위가 큽니다. 

 

이에 해당하여 Weight를 주는 방식도 있지만, 정확한 위치를 구하기 위해선 공부가 더 필요합니다. 


2022년 7월 업데이트 내용하였으니 참고바람.

https://coding-yoon.tistory.com/201

 

[BLE 실내 측위 프로젝트] 10. 삼변측량 정리 및 구현

목차 1. flutter_blue_plus 설치 및 설정 : ​https://coding-yoon.tistory.com/191 2. BLE 통신 스케줄 및 안드로이드 동작 : https://coding-yoon.tistory.com/192 3. ​ Flutter BLE Scan Demo Program : h..

coding-yoon.tistory.com

 

 

728x90
반응형

+ Recent posts