ROS的GPS驱动包

转载自:https://blog.csdn.net/qq_43176116/article/details/88972519

ROSGPS驱动包

qq_43176116 2019-04-02 18:16:48 2043 收藏 15

分类专栏: ROS 文章标签: GPS ROS

版权

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 of ~frame_id>)

~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: <the value of ~frame_id>)

~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 来查看安装驱动的信息,如下图

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

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

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

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

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

<?xml version = "1.0"?>
<launch>

  <!-- A simple launch file for the nmea_serial_driver node. -->

  <arg name="port" default="/dev/ttyACM0" />
  <arg name="baud" default="9600" />
  <arg name="frame_id" default="gps" />
  <arg name="time_ref_source" default="gps" />
  <arg name="useRMC" default="False" />

  <node name="nmea_serial_driver_node" pkg="nmea_navsat_driver" type="nmea_serial_driver" output="screen">
    <param name="port" value="$(arg port)"/>
    <param name="baud" value="$(arg baud)" />
    <param name="frame_id" value="$(arg frame_id)" />
    <param name="time_ref_source" value="$(arg time_ref_source)" />
    <param name="useRMC" value="$(arg useRMC)" />
  </node>

</launch>

然后启动,生成的topic有

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

 

  • 1
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值