Got GPS publishing odometry! With a Tutorial!

1,533 views
Skip to first unread message

Alex McClung

unread,
Aug 12, 2013, 7:22:35 AM8/12/13
to sydne...@googlegroups.com
Hey Guys,

I got GPS publishing an odometry message using the "utm_odometry_node" from the "gps_common" package and the "nmea_gps_driver". 

I then created a transform using "robot_pose_ekf" which runs a Kalman filter on the GPS and IMU (and eventually wheel odometry when the encoders are fitted to my robot) it creates a transform between "odom_combined" and "base_footprint".

"odom_combined" is the odometry frame and "base_footprint" is meant to be a static transform below "base_link" at the point of contact with the ground.

There is a tutorial here on the "utm_odometry_node" but Its not very detailed.

It should work with any GPS receiver that outputs the standard NMEA 0183 messages: USB, TTL Serial with TTL - USB converter, RS-232, Possibly even bluetooth.

I have spent hours trying to sort this out, but with this launch file example it should be working in minutes for you guys, all you have to do is change the serial port and baud rate of the receiver. 

There is only 3 steps!

All you have to do is type the following command in terminal.
$ sudo apt-get update -y && sudo apt-get install ros-groovy-gps-umd -y && sudo apt-get install ros-groovy navigation -y && sudo apt-get install ros-groovy nmea-gps-driver -y



 Then create a file in text editor, called "gps.launch" with the following text. It shouldn't matter where you put the launch file, but if you know how to create a ROS package, put the file in there, Remember to change the Baud_rate and Serial_port of the reciever!
 <!-- Launch the GPS Driver, Remember to change Serial Port and Baud Rate! -->
 
<node pkg="nmea_gps_driver" name="nmea_gps_launch" type="nmea_gps_driver.py" respawn="true" args=" _port:=/dev/ttyUSB0 _baud:=9600"/> <!-- Leave respawn as is or it will crash often! -->

 
<!-- Launch the conversion from sensor_msgs/NavSatFix to nav_msgs/Odometry -->
 
<node name="gps_conv" pkg="gps_common" type="utm_odometry_node">
     
<remap from="odom" to="vo"/>
     
<param name="rot_covariance" value="99999" />
     
<param name="frame_id" value="base_link" />
 
</node>

 
<!-- Launch the Kalman filter, It requires at least two sensor inputs out of IMU/either GPS or Visual Odometry/Wheel Odometry  -->
 
<node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
     
<param name="output_frame" value="odom_combined"/>
     
<param name="freq" value="30.0"/> <!-- Run Kalman filter at 30hz, It worked fine at 50hz on my machine, but I was limited by my IMU which publishes at 50hz -->
     
<param name="sensor_timeout" value="1.0"/>  
     
<param name="odom_used" value="false"/> <!-- If using wheel odometry change to true, Wheel Odometry topic = /odom -->
     
<param name="imu_used" value="true"/>  <!-- IMU topic = /imu_data -->
     
<param name="vo_used" value="true"/>  <!-- GPS topic = /vo -->
 
</node>

   
<!-- Create a static transform between "base_link" and "base_footprint" -->
 <node pkg="tf" type="static_transform_publisher" name="base_footprint_base_link" args="0 0 0 0 0 0 base_footprint base_link 100"/>

Make sure "roscore" is running.

If you didn't put the launch file in a package: make sure you're in the directory of the launch file, then run "roslaunch gps.launch".

If you did put it inside a package: run "roslaunch <package name> gps.launch".


Cheers,
Alex

P.S Below is the tf tree and ROS graph of my Robot, it might help.

Adrian Apps

unread,
Apr 13, 2014, 9:49:01 PM4/13/14
to sydne...@googlegroups.com
How did I only just see this now? 

Great writeup Alex! I've got a USB GPS somewhere so will have to fish it out and give this a go!

Cheers,

Adrian.
Reply all
Reply to author
Forward
0 new messages