ROS的GPS驱动包

ROS WiKi地址:http://wiki.ros.org/nmea_gps_driver

ROS功能包:nmea_gps_driver

Package to parse NMEA strings and publish a very simple GPS message. Does not require or use the GPSD deamon

1.节点

nmea_topic_driver

订阅的话题

nmea_sentence (nmea_msgs/Sentence)

  • NMEA sentences, 1 per message. The header.stamp should correspond to the time that the message was read from the device for accurate time_reference output. The header.frame_id on the messages on this topic will be used when setting frame_id on the output messages. These sentences do not have to be checksummed or otherwise validated before reaching the driver.

发布的话题

fix (sensor_msgs/NavSatFix)

  • GPS位置,一直发布即使GPS接受不到信号,发出的数据为无效(nan)

vel (geometry_msgs/TwistStamped)

  • GPS速度,仅当有速度时输出.

time_reference (sensor_msgs/TimeReference)

  • GPS输出的时间戳,作为参考时间戳.

参数

~port (string, default: /dev/ttyUSB0)

  • 设备端口(本实验我将改为 /dev/ttyACM0)

~baud (int, default: 4800)

  • 设备的波特率.

~frame_id (string, default: gps)

  • tf的固定frame.

~time_ref_source (string, default: )

  • The value to use as the source in the sensor_msgs/TimeReference.

~useRMC (bool, default: False)

  • Whether to generate position fixes from GGA sentences or a combination of RMC and GSA. If True, fixes will be generated from RMC and GSA. If False, fixes will be generated based on the GGA sentences. Using GGA sentences allows for covariance output while RMC+GSA provides velocity information.

nmea_serial_driver

        ------NMEA GPS Serial driver node. Replaces nmea_gps_driver.py to reduce naming conflicts and use new common parsing+driver backend.

订阅的话题

fix (sensor_msgs/NavSatFix),同上

vel (geometry_msgs/TwistStamped),同上

time_reference (sensor_msgs/TimeReference),同上

参数

~port (string, default: /dev/ttyUSB0)

~baud (int, default: 4800)

~frame_id (string, default: gps)

~time_ref_source (string, default: )

~useRMC (bool, default: False)

nmea_topic_serial_reader

          --------Reads NMEA sentences from the specified serial port and publishes them to a ROS topic. This is a simple front-end for use with nmea_topic_driver.py

发布的话题

nmea_sentence (nmea_msgs/Sentence)

  • A single time-stamped NMEA sentence captured from the serial device

参数

~port (string, default: /dev/ttyUSB0)

~baud (int, default: 4800)

~frame_id (string, default: gps)

2.ubuntu串口的安装和使用(usb转串口)

我使用的GPS接收机是某宝上的买的几十块的NEO-6M,直接用一根安卓数据线就能与电脑相连。

 

    首先,将我的USB数据线与PC机连接,这时候咱们的linux系统自动安转了驱动程序,可以使用命令:dmesg 来查看安装驱动的信息,如下图

ROS的GPS驱动包_第1张图片

  从上图的serialNumber=0可以看出咱们的串口设备是串口0,并且设备号为/dev/ttyACM0

  你也可以使用命令: ls -l /dev/ttyACM0来查看相关的信息,如下图

 一定要增加可执行权限(sudo chmod 666 /dev/ttyACM0)

3.从github下载源码编译与运行

找到此功能包下的nmea_serial_driver.launch文件,修改为




  

  
  
  
  
  

  
    
    
    
    
    
  

然后启动,生成的topic有

ROS的GPS驱动包_第2张图片

/fix话题包含定位信息,/heading /time_reference发布的GPS时间,和北京时间相差8小时;/vel包含速度信息

 

你可能感兴趣的:(ROS,GPS,ROS)