The Robotic Operating System (ROS) is a set of software libraries and tools that help you build robot applications. ROS uses a publish/subscribe model for data exchange. By installing a compatible driver, Swift Navigation devices can be used within ROS to obtain sensor data such as position or time. Multiple ROS drivers for Swift Navigation devices can be found on the web. One of the most comprehensive driver is published by ETH Zurich. This article will walk a user through installing ROS, installing the driver, connecting to a device over serial, and validating the GNSS receiver connection from within ROS.
Another ROS / ROS2 driver (written in C++) is available from: https://github.com/szenergy/duro_gps_driver
Note: For the ROS drivers questions and support please contact their authors/developers directly.
Robotic Operating System
ROS provides a set of software libraries and tools aimed towards simplifying the task of robotics development. The fundamentals of using ROS are not within the scope of this document. If you have no previous experience with ROS, the official tutorials (http://wiki.ros.org/ROS/Tutorials) provide an excellent introduction to the system.
Installing ROS
Guides for installing ROS are available via the ROS website (http://www.ros.org/install/).
Driver for Swift Navigation Devices
ETH Zurich driver can be found here: https://github.com/ethz-asl/ethz_piksi_ros.
Prerequisite Installation
The instructions below install the prerequisites needed by the piksi_multi_rtk_ros driver on Ubuntu Linux.
sudo apt-get install python-pip
sudo apt-get install python-tox
sudo apt-get install pandoc
Create Catkin Workspace
The instructions below create a new catkin workspace into which the driver can be installed. To add the driver to an existing project, skip to Driver Installation.
mkdir -p ~/Documents/swift_ros_ws/src
cd ~/Documents/swift_ros_ws/
catkin_make
Driver Installation
The instructions below reference the catkin workspace created by the previous step. To install the driver in an existing workspace, you will need to use the appropriate paths.
#### Navigate to the workspace src directory
cd ~/Documents/swift_ros_ws/src/
#### Clone driver from git repo
git clone https://github.com/ethz-asl/ethz_piksi_ros
#### Navigate to the install directory for the driver
cd ethz_piksi_ros/piksi_multi_rtk_ros/install
#### Run the install script
./install_piksi_multi.sh
#### Logout and back in, to ensure current user is properly added to dialout group
#### Navigate to the workspace directory
cd ~/Documents/swift_ros_ws/
#### Source the environment for this workspace
source devel/setup.bash
#### Build the messages
catkin_make --pkg piksi_rtk_msgs
#### Build the entire driver
catkin_make
Driver Configuration
Configuration of the ROS driver is handled by a YAML configuration file. This file, piksi_multi_driver_settings.yaml, is located in piksi_multi_rtk_ros/cfg - if using the environment created in the example above, the full path to the configuration file would be ~/Documents/swift_ros_ws/src/ethz_piksi_ros/piksi_multi_rtk_ros/cfg.
The serial port used by the driver to connect to a receiver is defined by the serial_port line. By default this port is set to /dev/ttyUSB0. If your device resides on a different serial port, change this line to reference the port used by your device.
The baud rate used by the driver to connect to a receiver is defined by the baud_rate line. By default it is set to 115200. If your device is configured for a different baud rate, change this line to the value used by your device.
Driver Installation Verification
After the workspace is setup, driver is installed, and configuration file is prepared - the driver process can be started. This is done with a launch file.
#### Launch the driver, configured for base station
roslaunch piksi_multi_rtk_ros piksi_multi_base_station.launch
If the environment and driver are configured properly, the driver should start without error. If you are presented with an error message - such as Piksi not found on serial port ‘/dev/ttyUSB0’ - please double check your configuration file.
ROS Topics
Within ROS, data is exchanged via rostopics. A rostopic can be thought of as a named, bidirectional, data-stream. ROS processes can publish data to, or subscribe to data from, a rostopic. Each rostopic utilizes a single ROS message type. The definition of the ROS message type describes the fields and units within a given message. The messages used by the ROS driver are defined in ethz_piksi_ros/riksi_rtk/msgs/msg.
After launching the driver, as described in the previous section - open a new terminal and run the following commands.
#### Navigate to the workspace directory
cd ~/Documents/swift_ros_ws/
#### Source the environment for this workspace
source devel/setup.bash
#### List available rostopics
rostopic list
The rostopic list command will list the rostopics available on the current system. For example:
/piksi/age_of_corrections
/piksi/baseline_heading
/piksi/baseline_ned
/piksi/debug/imu_aux
/piksi/debug/receiver_state
/piksi/debug/uart_state
/piksi/enu_point_fix
/piksi/enu_point_spp
/piksi/enu_pose_best_fix
/piksi/enu_pose_fix
/piksi/enu_pose_spp
/piksi/enu_transform_fix
/piksi/enu_transform_spp
/piksi/gps_time
/piksi/heartbeat
/piksi/imu_raw
/piksi/log
/piksi/navsatfix_best_fix
/piksi/navsatfix_rtk_fix
/piksi/navsatfix_spp
/piksi/tracking_state
/piksi/utc_time
/piksi/vel_ned
/rosout
/rosout_agg
The topics starting with /piksi/ are published by the ROS driver and represent data that is available from the currently connected device. For more information regarding the status of a given topic - you may use the rostopic info command.
#### Get information about the /piksi/baseline_ned topic
rostopic info /piksi/baseline_ned
The rostopic info command will give you some basic information about the rostopic - including the message type. For example:
Type: piksi_rtk_msgs/BaselineNed
Publishers:
* /piksi (http://swift-lubuntu:34597/)
Subscribers: None
The /piksi/baseline_ned topic uses the message type piksi_rtk_msgs/BaselineNed.
You can also see information about the traffic on any rostopic, by using the rostopic echo command.
#### Echo traffic from the /piksi/heartbeat topic
rostopic echo /piksi/heartbeat
The output displays the fields and values of each message, as they are published to the topic. For example:
header:
seq: 1
stamp:
secs: 1512359393
nsecs: 392447948
frame_id: ''
system_error: 0
io_error: 0
swift_nap_error: 0
sbp_minor_version: 2
sbp_major_version: 2
external_antenna_present: 0