DrawingProcess
λ“œν”„ DrawingProcess
DrawingProcess
전체 방문자
였늘
μ–΄μ œ
Β«   2025/05   Β»
일 μ›” ν™” 수 λͺ© 금 ν† 
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
  • λΆ„λ₯˜ 전체보기 (964)
    • Profile & Branding (22)
      • Career (15)
    • IT Trends (254)
      • Conference, Faire (Experien.. (31)
      • News (187)
      • Youtube (19)
      • TED (8)
      • Web Page (2)
      • IT: Etc... (6)
    • Contents (97)
      • Book (66)
      • Lecture (31)
    • Project Process (94)
      • Ideation (0)
      • Study Report (34)
      • Challenge & Award (22)
      • 1Day1Process (5)
      • Making (5)
      • KRC-FTC (Team TC(5031, 5048.. (10)
      • GCP (GlobalCitizenProject) (15)
    • Study: ComputerScience(CS) (72)
      • CS: Basic (9)
      • CS: Database(SQL) (5)
      • CS: Network (14)
      • CS: OperatingSystem (3)
      • CS: Linux (39)
      • CS: Etc... (2)
    • Study: Software(SW) (95)
      • SW: Language (29)
      • SW: Algorithms (1)
      • SW: DataStructure & DesignP.. (1)
      • SW: Opensource (15)
      • SW: Error Bug Fix (43)
      • SW: Etc... (6)
    • Study: Artificial Intellige.. (149)
      • AI: Research (1)
      • AI: 2D Vision(Det, Seg, Tra.. (35)
      • AI: 3D Vision (70)
      • AI: MultiModal (3)
      • AI: SLAM (0)
      • AI: Light Weight(LW) (3)
      • AI: Data Pipeline (7)
      • AI: Machine Learning(ML) (1)
    • Study: Robotics(Robot) (33)
      • Robot: ROS(Robot Operating .. (9)
      • Robot: Positioning (8)
      • Robot: Planning & Control (7)
    • Study: DeveloperTools(DevTo.. (83)
      • DevTool: Git (12)
      • DevTool: CMake (13)
      • DevTool: NoSQL(Elastic, Mon.. (25)
      • DevTool: Container (17)
      • DevTool: IDE (11)
      • DevTool: CloudComputing (4)
    • 인생을 μ‚΄λ©΄μ„œ (64)
      • λ‚˜μ˜ μ·¨λ―Έλ“€ (7)
      • λ‚˜μ˜ 생각듀 (42)
      • 여행을 λ– λ‚˜μž~ (10)
      • 뢄기별 회고 (5)

개발자 λͺ…μ–Έ

β€œ λ§€μ£Ό λͺ©μš”μΌλ§ˆλ‹€ 당신이 항상 ν•˜λ˜λŒ€λ‘œ μ‹ λ°œλˆμ„ 묢으면 μ‹ λ°œμ΄ ν­λ°œν•œλ‹€κ³  생각해보라.
컴퓨터λ₯Ό μ‚¬μš©ν•  λ•ŒλŠ” 이런 일이 항상 μΌμ–΄λ‚˜λŠ”λ°λ„ 아무도 λΆˆν‰ν•  생각을 μ•ˆ ν•œλ‹€. ”

- Jef Raskin

λ§₯의 아버지 - μ• ν”Œμ»΄ν“¨ν„°μ˜ λ§€ν‚¨ν† μ‹œ ν”„λ‘œμ νŠΈλ₯Ό 주도

인기 κΈ€

졜근 κΈ€

졜근 λŒ“κΈ€

ν‹°μŠ€ν† λ¦¬

hELLO Β· Designed By μ •μƒμš°.
DrawingProcess

λ“œν”„ DrawingProcess

Study: Robotics(Robot)/Robot: Positioning

[Positioning] ROS GPS(WGS84) to UTM μ’Œν‘œ λ³€ν™˜ν•˜κΈ°

2023. 9. 30. 18:40
λ°˜μ‘ν˜•
πŸ’‘ λ³Έ λ¬Έμ„œλŠ” 'ROS GPS(WGS84) to UTM μ’Œν‘œ λ³€ν™˜ν•˜κΈ°'에 λŒ€ν•΄ 정리해놓은 κΈ€μž…λ‹ˆλ‹€.
GPS(WGS84), UTM μ’Œν‘œκ³„ μžμ²΄μ— λŒ€ν•œ 이해뢀터 이λ₯Ό λ³€ν™˜ν•˜λŠ” 라이브러리 μ‚¬μš©λ°©λ²•κΉŒμ§€ μ •λ¦¬ν•˜μ˜€μœΌλ‹ˆ μ°Έκ³ ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

1. μ’Œν‘œκ³„ 이해

1) GPS(WGS84)

WGSλŠ” World Gedetic System coordinate의 약어이며, WGS84 μ’Œν‘œκ³„μ—μ„œ 84λŠ” 84년도에 μ œμ •λœ μ’Œν‘œκ³„μž…λ‹ˆλ‹€.

μ΄λŠ” 타원체 λͺ¨μ–‘μ˜ 지ꡬ상 μœ„μΉ˜λ₯Ό ν‘œν˜„ν•˜κΈ° μœ„ν•œ μ’Œν‘œκ³„λ‘œ, μ λ„와 λ³Έμ΄ˆμžμ˜€μ„ μ΄ κ΅μ°¨ν•˜λŠ” 점을 기쀀점(0.0º, 0.0º)으둜 ν•©λ‹ˆλ‹€.

λ”°λΌμ„œ ν‘œν˜„ μžμ²΄λŠ” μ •ν™•ν•˜λ‚˜, 타원체 μžμ²΄μ—μ„œμ˜ μœ„μΉ˜λ₯Ό ν‘œν˜„ν•˜κΈ°μ— 면적 거리λ₯Ό κ³„μ‚°ν•˜λŠ” 데 어렀움을 κ²ͺ을 수 μžˆμŠ΅λ‹ˆλ‹€.

2) UTM

UTM μ’Œν‘œκ³„λŠ” Universal Transverse Mercator Coordinate System의 μ•½μ–΄μž…λ‹ˆλ‹€.

μ΄λŠ” 도면 μœ„μ— 지ꡬλ₯Ό λ„“κ²Œ νŽ΄μ„œ ν‘œμ‹œν•œλ‹€κ³  μƒκ°ν•˜λ©΄ μ΄ν•΄ν•˜κΈ° μ‰¬μš°λ©°, μ •ν™•νžˆλŠ” 3도λ₯Ό κΈ°μ€€μœΌλ‘œ 지ꡬλ₯Ό 60쑰각으둜 λ‚˜λˆˆ ν›„ 각 단면 펼쳐 μ§μ‚¬κ°ν˜• ν˜•νƒœλ‘œ λ§Œλ“ λ‹€κ³  μƒκ°ν•˜λ©΄ λ©λ‹ˆλ‹€.

λ”°λΌμ„œ μ›ν˜•μ„ νŽ΄λŠ” 방식이닀 λ³΄λ‹ˆ μ™œκ³‘μ΄ μ‘΄μž¬ν•©λ‹ˆλ‹€λ§Œ, 면적 거리λ₯Ό κ³„μ‚°ν•˜λŠ” 데 μš©μ΄ν•©λ‹ˆλ‹€.

2. μ’Œν‘œ λ³€ν™˜ν•˜κΈ°(WGS84 <=> UTM)

1) Python (library: utm)

utm λΌμ΄λΈŒλŸ¬λ¦¬λŠ” 'Bidirectional UTM-WGS84 converter for python'이라 μ„€λͺ…λ˜μ–΄ 있으며, μ–‘λ°©ν–₯으둜 λ³€ν™˜ν•˜λŠ” 파이썬 λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€. λ‹€μŒκ³Ό 같이 μ„€μΉ˜ν•΄μ„œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

$ pip install utm

Usage

>>> import utm
Latitude/Longitude to UTM

Convert a (latitude, longitude) tuple into an UTM coordinate:

>>> utm.from_latlon(51.2, 7.5)
(395201.3103811303, 5673135.241182375, 32, 'U')
  • The syntax is utm.from_latlon(LATITUDE, LONGITUDE).
  • The return has the form (EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER).

You can also use NumPy arrays for LATITUDE and LONGITUDE. In the result EASTING and NORTHING will have the same shape. ZONE_NUMBER and ZONE_LETTER are scalars and will be calculated for the first point of the input. All other points will be set into the same UTM zone. Therefore it's a good idea to make sure all points are near each other.

>>> utm.from_latlon(np.array([51.2, 49.0]), np.array([7.5, 8.4]))
(array([395201.31038113, 456114.59586214]), array([5673135.24118237, 5427629.20426126]), 32, 'U')

UTM to Latitude/Longitude Convert an UTM coordinate into a (latitude, longitude) tuple:

>>> utm.to_latlon(340000, 5710000, 32, 'U')
(51.51852098408468, 6.693872395145327)
  • The syntax is utm.to_latlon(EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER).
  • The return has the form (LATITUDE, LONGITUDE).

You can also use NumPy arrays for EASTING and NORTHING. In the result LATITUDE and LONGITUDE will have the same shape. ZONE_NUMBER and ZONE_LETTER are scalars.

>>> utm.to_latlon(np.array([395200, 456100]), np.array([5673100, 5427600]), 32, 'U')
(array([51.19968297, 48.99973627]), array([7.49999141, 8.3998036 ]))

Since the zone letter is not strictly needed for the conversion you may also the northern parameter instead, which is a named parameter and can be set to either True or False. Have a look at the unit tests to see how it can be used.

2) C++ (library: GeographicLib)

1. 라이브러리 μ„€μΉ˜ 및 PATH 등둝

Installation using the autoconfigure tools. The method works on most Unix-like systems including Linux and Mac OS X. Here are the steps to compile and install GeographicLib:

Unpack the source, running

$ tar xfpz GeographicLib-1.44.tar.gz

then enter the directory created, Create a separate build directory and enter it.

cd GeographicLib-1.44
mkdir build
cd build
# Configure the software, specifying the path of the source directory, with
$ ../configure
# By default GeographicLib will be installed under /usr/local. You can change this with, for example
$ ../configure --prefix=/tmp/geographic

Compile and install the software with

make
make install

The headers, library, and utilities are installed in the include/GeographicLib, lib, and bin directories under prefix. For documentation, open share/doc/GeographicLib/html/index.html in a web browser.

2. CMakeLists 파일 μˆ˜μ •

find_package(GeographicLib REQUIRED)
target_link_libraries ${GeographicLib_LIBRARIES}

3. μ½”λ“œ μž‘μ„±

void WGS2UTM(double lat, double lon, double& easting, double& northing){
  int zone;
  bool northp;
  GeographicLib::UTMUPS::Forward(lat, lon, zone, northp, easting, northing);
  std::string zonestr = GeographicLib::UTMUPS::EncodeZone(zone, northp);
}

μ°Έκ³ 

  • [Github] utm: https://github.com/Turbo87/utm
  • [Official] geographiclib: https://geographiclib.sourceforge.io/
  • [Github] GeographicLib install: https://github.com/ObjSal/GeographicLib/blob/master/README.md
  • [Blog] QGIS κ³΅λΆ€ν•˜κΈ° - WGS84, UTM, DMS, DD μ’Œν‘œκ³„ μ΄ν•΄ν•˜κΈ°: https://grizzy-bear-blog.tistory.com/22
λ°˜μ‘ν˜•
μ €μž‘μžν‘œμ‹œ λΉ„μ˜λ¦¬ λ³€κ²½κΈˆμ§€

'Study: Robotics(Robot) > Robot: Positioning' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[Positioning] ROS mapviz μ‚¬μš©ν•˜κΈ° (feat. GPS topic μ’Œν‘œμ°κΈ°)  (0) 2023.07.19
[Positioning] UWB(Ultra Wide-Band) μΈ‘μœ„κΈ°μˆ μ„ μ•Œμ•„μ•Ό ν•˜λŠ” 이유  (0) 2023.07.15
[Positioning] GIS와 ν•œκ΅­ μ£Όμš” μ’Œν‘œκ³„ EPSGμ½”λ“œ  (0) 2023.06.29
[Positioning] μœ„μ„±ν•­λ²•μ‹œμŠ€ν…œ(GNSS) 정리(5): GPS μ˜μ‚¬κ±°λ¦¬ μΈ‘μ • - μ½”λ“œ 기반(μ‹œκ°„), μœ„μƒ 기반(μœ„μΉ˜)  (0) 2023.03.28
[Positioning] μœ„μ„±ν•­λ²•μ‹œμŠ€ν…œ(GNSS) 정리(4): μΈ‘μœ„ 기법 상세(GPS, DGPS, RTK λ“±)  (0) 2023.03.27
    'Study: Robotics(Robot)/Robot: Positioning' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€
    • [Positioning] ROS mapviz μ‚¬μš©ν•˜κΈ° (feat. GPS topic μ’Œν‘œμ°κΈ°)
    • [Positioning] UWB(Ultra Wide-Band) μΈ‘μœ„κΈ°μˆ μ„ μ•Œμ•„μ•Ό ν•˜λŠ” 이유
    • [Positioning] GIS와 ν•œκ΅­ μ£Όμš” μ’Œν‘œκ³„ EPSGμ½”λ“œ
    • [Positioning] μœ„μ„±ν•­λ²•μ‹œμŠ€ν…œ(GNSS) 정리(5): GPS μ˜μ‚¬κ±°λ¦¬ μΈ‘μ • - μ½”λ“œ 기반(μ‹œκ°„), μœ„μƒ 기반(μœ„μΉ˜)
    DrawingProcess
    DrawingProcess
    과정을 그리자!

    ν‹°μŠ€ν† λ¦¬νˆ΄λ°”