Skip to content

📘 ROS/ROS2 driver for SwiftNav Duro Inertial GPS / GNSS receivers

License

Notifications You must be signed in to change notification settings

szenergy/duro_gps_driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duro Inertial GPS ROS/ROS2 Driver

Contents

Overview

This is a C++ ROS driver for Swiftnaw Duro Inertial (Piksi Multi Inertial) GPS / GNSS Receivers. The code is based on offical Swiftnav libswiftnav C example and Alex Hajnal's Apollo UTM converter code. Note that orientation data is produced by Duro Inertial but not produced by Piksi Multi or Duro.

Scope

The current version supports only (not tested elsewhere):

Install

1. step

Install libsbp (Swift binary protocol library) C client library from GitHub: https://github.com/swift-nav/libsbp It is detailed in github, but the main steps are:

sudo apt-get install build-essential pkg-config cmake doxygen check
cd ~; mkdir git; cd git     # eg create a git folder, the folder name can be different
git clone https://github.com/swift-nav/libsbp.git
cd libsbp
git checkout fe7b78992fb87eef5bd6d12b2daf70f4ac90bc39 # only for 18.04!
cd c
git submodule update --init --recursive
mkdir build; cd build
cmake ../
make
sudo make install

This will create some files in /usr/local/include/libsbp/ and in /usr/local/lib.

2. step

ROS install

Clone the duro_gps_driver package into your Catkin workspace. Navigate to the root of your Catkin workspace. Source your setup.bash file. Build the duro_ros package using Catkin:

git clone https://github.com/szenergy/duro_gps_driver -b ros1
catkin build duro_ros
source devel/setup.bash

ROS2 install

Navigate to the root of your Colcon workspace. Source your setup.bash file. Build the duro_ros package using Colcon:

cd ~/ros2_ws/src
git clone https://github.com/szenergy/duro_gps_driver -b ros2-humble
cd ..
colcon build --packages-select duro_gps_driver
source install/local_setup.bash && source install/setup.bash

Settings

Enable MSG ID 544 and 545 in swift console. Once again, orientation data not produced by Piksi Multi or Duro. These orientation messages are not enabled in default configuration. The MSG ID is defined in the headers, e.g. #define SBP_MSG_ORIENT_QUAT 0x0220 which is decimal 544. Also by defult the magnetometer publishes every 50th message. Change 2306/50 to 2306 in swift console (this message in hex is 0x0902).

Run

Make sure that roscore is running. The duro-gps driver can be run using the rosrun command. It is necessary to provide your device's IP address and port number. E.g:

ros2 run duro_ros duro_node --ros-args -p ip_address:="192.168.1.10" -p port:=55555
rosrun duro_ros duronode _ip_address:=192.168.1.10 _port:=55555

Alternatively you can use a launch file. E.g:

ros2 launch duro_gps_driver duro_example.launch.py
ros2 launch duro_gps_driver duro_example.launch.xml
roslaunch duro_ros duro_example.launch

Topics

duro_ros duronode publishes the following topics and [types]:

Topic Type
/gps/duro/current_pose [geometry_msgs/PoseStamped]
/gps/duro/fix [sensor_msgs/NavSatFix]
/gps/duro/imu [sensor_msgs/Imu]
/gps/duro/mag [sensor_msgs/MagneticField]
/gps/duro/odom [nav_msgs/Odometry]
/gps/duro/rollpitchyaw [geometry_msgs/Vector3]
/gps/duro/status_flag [std_msgs/UInt8]
/gps/duro/status_string [std_msgs/String]
/gps/duro/time_ref [sensor_msgs/TimeReference]

An important topic is /gps/duro/current_pose which is geometry_msgs/PoseStamped type in UTM (https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system) eg:

header: 
  seq: 5545
  stamp: 
    secs: 1580388036
    nsecs: 641742448
  frame_id: 'map'
pose: 
  position: 
    x: 697214.762607
    y: 5285721.97968
    z: 0.0
  orientation: 
    x: 0.00819693645462
    y: 0.00343747669831
    z: 0.692575566471
    w: 0.721290563233

Example rosbag

Download a sample rosbag, and also a small script to plot the data here or alteratively here.

Further reading