This ROS driver reads data from a UM982 GPS device via a serial port and publishes it as ROS messages. It parses NMEA sentences (GGA and THS) to extract GPS position and heading information.
- Reads GPS position (latitude, longitude, altitude) from
$GNGGAsentences. - Reads heading from
$GNTHSsentences. - Publishes data as:
NavSatFixmessages (/gps/fixtopic).Odometrymessages (/gps/utmpostopic).Float64messages (/gps/headingtopic).
- Configurable serial port and baud rate.
Clone this repository into your ROS workspace:
cd ~/catkin_ws/src
git clone https://github.com/JorandG/UM982ROS
cd ~/catkin_ws
catkin_make
source devel/setup.bashEnsure the provided Python script (um982ros.py) is located in the correct directory within your ROS workspace. For example:
~/catkin_ws/src/UM982ROS/um982ros.pyMake the script executable:
chmod +x ~/catkin_ws/src/UM982ROS/um982ros.pyThe driver parameters can be set via the command line:
- Port: Serial port to which the UM982 is connected (default:
/dev/ttyUM982). - Baud Rate: Baud rate for the serial connection (default:
115200).
Run the driver directly:
rosrun um982_driver um982_driver.py _port:=/dev/ttyUSB0 _baud:=115200Ensure your user has permission to access the serial port:
sudo usermod -a -G dialout $USERLog out and back in for the changes to take effect.
/gps/fix(sensor_msgs/NavSatFix): GPS position (latitude, longitude, altitude)./gps/utmpos(nav_msgs/Odometry): UTM coordinates with heading./gps/heading(std_msgs/Float64): Heading angle (in degrees).
$GNGGA:- Extracts latitude, longitude, and altitude.
- Converts coordinates to decimal degrees.
$GNTHS:- Extracts heading angle.
- Position and heading data are converted to ROS message formats and published on their respective topics.
- Reads data from the UM982 device via the serial port.
To achieve Real-Time Kinematic (RTK) corrections for improved GPS accuracy, use the str2str tool from the RTKLIB suite. Follow these steps:
Install RTKLIB on your Linux system:
sudo apt install rtklibUse the following str2str command to set up RTK corrections:
str2str -in ntrip://<username>:<password>@<ntrip_server>:<port>/<mountpoint> -out serial://<serial_port>:<baud_rate>:8:n:1<username>: Your NTRIP service username.<password>: Your NTRIP service password.<ntrip_server>: The URL of the NTRIP caster (e.g.,www.euref-ip.net).<port>: The port used by the NTRIP caster (e.g.,2101).<mountpoint>: The specific data stream mount point (e.g.,M0SE00ITA0).<serial_port>: The serial port connected to the UM982 (e.g.,/dev/ttyUSB0).<baud_rate>: The baud rate of the serial connection (e.g.,115200).
Replace placeholders with actual values, except credentials:
str2str -in ntrip://username:password@www.euref-ip.net:2101/M0SE00ITA0 -out serial://ttyUSB0:115200:8:n:1- Ensure the serial port name matches your device (e.g.,
/dev/ttyUSB0). - Verify the mount point and network credentials with your NTRIP provider.
- Verify the serial port and baud rate:
ls /dev/tty* - Check permissions for the serial port.
- The GPS may take some time to lock onto satellite data, especially after a reset or in poor signal conditions.
- Verify NMEA sentences output by the UM982.
- Check for potential interference or hardware issues.