当前位置:网站首页>ROS package NMEA_ navsat_ Driver reads GPS and Beidou Positioning Information Notes

ROS package NMEA_ navsat_ Driver reads GPS and Beidou Positioning Information Notes

2022-04-23 17:53:00 ppipp1109

Hardware :ATGM332D + Serial debugging tools +  GPS The antenna

Software : ubunutu 18.04 + ros

1. A serial port Reading data  

sudo apt install cutecom
sudo cutecom // Set up   Baud rate 9600  You can see the feedback data 

2. nmea_navsat_driver Use of the bag

sudo apt-get install ros-melodic-nmea-navsat-driver libgps-dev

Be careful :nmea_navsat_driver Provide four nodes :nmea_topic_driver,
nmea_serial_driver,nmea_topic_serial_reader and nmea_socket_driver

nmea_topic_serial_reader node

This node reads... From the serial port GPS data , And then it's packaged as nmea_msgs/Sentence data format , Post topics nmea_sentence.

nmea_topic_driver node

This node subscribes to topic nmea_sentence, And then according to NMEA0184 Protocol analysis , And publish the parsed data , The release topic is : Longitude and latitude /fix, Speed /vel,gps Time /time_reference And heading angle /heading.

nmea_serial_driver node

This node reads data from the serial port , Directly analyze the published data , amount to nmea_topic_driver Nodes and nmea_topic_serial_reader A combination of nodes .

github Source code :https://github.com/ros-drivers/nmea_navsat_driver

3.  Open new Terminal The window opens ROS System ( relevant ROS The environment create 、ROS Package compilation and other basic knowledge must be checked on the Internet first ), Input

roscore


Open another new Terminal Window Publishing (Publish) Locate module information , Input

rosrun nmea_navsat_driver nmea_topic_serial_reader _port:=/dev/ttyUSB0 _baud:=9600


When publishing positioning module information , The window will not look like cutecom Keep displaying the latest positioning data as in , Will prompt SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'., Can be ignored . The ROS The packet passes the data through /nmea_sentence This Topic released , To verify that the location data is published successfully , Let's open a new Terminal Window read /nmea_sentence Information in , Input

rostopic echo /nmea_sentence

4. function nmea_serial_driver node ;

It is necessary to close the second 3 All terminals in this section ,

roscd nmea_navsat_driver/launch/
sudo vim nmea_serial_driver.launch 

The baud rate is modified as follows 9600

<launch>

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

  <arg name="port" default="/dev/ttyUSB0" />
  <arg name="baud" default="9600" />
  <arg name="frame_id" default="gps" />
  <arg name="use_GNSS_time" default="False" />
  <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="use_GNSS_time" value="$(arg use_GNSS_time)" />
    <param name="time_ref_source" value="$(arg time_ref_source)" />
    <param name="useRMC" value="$(arg useRMC)" />
  </node>

Open a terminal usb assignment , start-up launch file

sudo chmod 777 /dev/ttyUSB0
roslaunch nmea_navsat_driver nmea_serial_driver.launch

Open a new terminal , View the current gps Information

rostopic echo /fix

Reference link :

1. See you for the first time : adopt ROS package nmea_navsat_driver Read GPS、 Beidou positioning information (C/C++)_m0_37857300 The blog of -CSDN Blog

2. # Call sensor data _ROS Of sensors GPS practice _glietwx The blog of -CSDN Blog

3.(1)GNSS drive nmea_navsat_driver Use of feature packs _Qi Xiang Qi Xiang's blog -CSDN Blog

4. week50 nmea_navsat_driver Read GNSS Location information - Simple books

版权声明
本文为[ppipp1109]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230549075769.html