< >
Home » ROS与传感器教程 » ROS与传感器教程-单个Ublox RTK GPS使用

ROS与传感器教程-单个Ublox RTK GPS使用

**ROS与传感器教程-单个Ublox RTK GPS使用 **

说明:

步骤:

  • 参考连线,现成产品RTK GPS的uart1口为ttyUSB1,uart2口为ttyUSB0
  • 安装驱动:
  • 重用现有工作空间,或新建工作空间:
mkdir -p ~/catkin_ws
cd ~/catkin_ws/src/
git clone -b f9p https://github.com/ncnynl/ublox
cd ..
catkin_make 
  • 建立别名
cd ~/catkin_ws/src/ublox/ublox_gps/script
./gps.sh
  • 重新拨插USB线,检查是否成功
$ ls /dev/gpsrtk
/dev/gpsrtk

单独rtkgps测试

  • 启动GPS
roslaunch ublox_gps ublox_gps.launch 
  • 启动后打印的消息
[ INFO] [1641961049.058896192]: U-Blox: Opened serial port /dev/gpsrtk
[DEBUG] [1641961049.559347047]: U-Blox: Set ASIO baudrate to 9600
[DEBUG] [1641961050.059903623]: U-Blox: Set ASIO baudrate to 19200
[DEBUG] [1641961050.560491852]: U-Blox: Set ASIO baudrate to 38400
[DEBUG] [1641961050.627652975]: EXT CORE 1.00 (61b2dd), HW VER: 00190000
[DEBUG] [1641961050.627758194]: ROM BASE 0x118B2060
[DEBUG] [1641961050.627810483]: FWVER=HPG 1.12
[DEBUG] [1641961050.627849964]: PROTVER=27.11
[DEBUG] [1641961050.627889253]: MOD=ZED-F9P
[DEBUG] [1641961050.627929791]: GPS;GLO;GAL;BDS
[DEBUG] [1641961050.627961107]: QZSS
[ INFO] [1641961050.628054767]: U-Blox Firmware Version: 9
[ INFO] [1641961050.652649155]: U-Blox configured successfully.
[DEBUG] [1641961050.652716975]: Subscribing to U-Blox messages
[ERROR] [1641961050.715899307]: U-blox: received NACK: 0x06 / 0x01
[ERROR] [1641961050.727373657]: U-blox: received NACK: 0x06 / 0x01
[ERROR] [1641961050.739238080]: U-blox: received NACK: 0x06 / 0x01
[DEBUG] [1641961050.799262785]: Configuring INF messages
  • 查看话题
$ rostopic list
/diagnostics
/gps/fix
/gps/fix_velocity
/rosout
/rosout_agg
  • 查看话题/gps/fix内容
$ rostopic echo /gps/fix
header: 
  seq: 1357
  stamp: 
    secs: 1574329668
    nsecs:  67617409
  frame_id: "gps"
status: 
  status: 0
  service: 3
latitude: 23.0648413
longitude: 113.0547081
altitude: -38.78
position_covariance: [27.185796000000003, 0.0, 0.0, 0.0, 27.185796000000003, 0.0, 0.0, 0.0, 44.408896]
position_covariance_type: 2

latitude:纬度,北纬为正数,南纬为负数
longitude:经度,东经为正数,西经为负数
altitude:海拔高度,单位是米

经纬度查询链接

  • 注意:使用百度或谷歌地图直接查询的经纬度,获取的地图定位因为是经过特殊处理,所以是不准确。
  • 请使用Google Earth来验证定位。

使用Google Earth验证位置

  • 使用网页版Google Earth,点击进入https://earth.google.com/web/
  • 点击页面左边的搜索,写入 “latitude纬度 longitude经度” 以你实际的维度和经度为准
  • 点击确认回车进行定位

参考:

  • https://github.com/KumarRobotics/ublox
  • http://wiki.ros.org/ublox

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros与传感器教程