직관적인느낌

UTM좌표계 변환 - U-blox, RTK - GPS 사용 (with ROS) 본문

공학/시스템 설치 및 설정

UTM좌표계 변환 - U-blox, RTK - GPS 사용 (with ROS)

범슐랭 2023. 3. 23. 11:55
728x90

LLA to UTM패키지 설치

1. 패키지 설치

2. 소스 파일 수정

3. coordinate_convertion.launch 파일 수정
4. geographiclib 설치

5. 빌드 

6. 실행


1. 패키지 설치

cd ~/catkin_ws/src/ublox_f9p/
git clone <https://github.com/arpg/ROS-UTM-LLA.git>

2. 소스 파일 수정


💡 ~/catkin_ws/src/ublox_f9p/ROS-UTM-LLA/src에 위치한 
convert_ndt2lla.cpp 의 41 line 을 수정해주자.


# ros::Subscriber  sub2 = n.subscribe("/gps/fix",1000,&ULConverter::GPSCallback, &con); //수정 전
ros::Subscriber  sub2 = n.subscribe("/ublox_gps/fix",1000,&ULConverter::GPSCallback, &con); //수정 후

 

3. coordinate_convertion.launch 파일 수정

<launch>
    <!-- The following is denver UTM zone. check your UTM zone at  https://mangomap.com/robertyoung/maps/69585/what-utm-zone-am-i-in-# -->
    <param name="utm_zone" type="int" value="52" />
    <param name="hemisphere" type="string" value="North" />
    <node type="utm_lla_converter" pkg="utm_lla" name="utm_lla_converter" output="screen"/>
</launch>

💡첫번째 파라미터인 utm_zone 을 설정해주는 것 이외에 다른 설정은 건들 필요가 없다.

대한민국의 UTM-zone 은 52 에 속한다.



4. geographiclib 설치

cd ~/catkin_ws/src/ublox_f9p/ROS-UTM-LLA
git clone git://git.code.sourceforge.net/p/geographiclib/code ./geographiclib
cd geographiclib
mkdir build && cd build

cmake .. && make
sudo make install

5. 빌드 

cd catkin_ws
catkin_make

6. 실행

roslaunch utm_lla coordinate_convertion.launch
# If u want check
rostopic echo /utm

 

+) Sample

  • LLA
header: 
  seq: 1445
  stamp: 
    secs: 1661908378
    nsecs: 399699133
  frame_id: "gps"
status: 
  status: 0
  service: 0
latitude: 36.3652316
longitude: 127.3478772
altitude: 100.523
position_covariance: [43.4281, 0.0, 0.0, 0.0, 43.4281, 0.0, 0.0, 0.0, 59.582961000000005]
position_covariance_type: 2
  • UTM
[ INFO] [1661908377.609811972]: Get data lagitude from GPS: [36.365234]
[ INFO] [1661908377.609886730]: Get data longitude from GPS: [127.347873]
[ INFO] [1661908377.609925002]: Get data altitude from GPS: [99.798000]
[ INFO] [1661908377.610017447]: Convert to x: [351781.234645]
[ INFO] [1661908377.610092360]: Convert to y: [4025726.766988]
[ INFO] [1661908377.610165143]: Convert to z: [99.798000]

 

 

 

출처 :

https://velog.io/@swooeun/ROS-Ublox-ZED-F9P-RTK-UTM

 

728x90
반응형