I try to visualize the GNSS data in RVIZ. And I realize that I can achieve this function by a plugin named rviz-satellite. There are few tutorials on the Internet so that I would like to write down my experience.
My system is Ubuntu 18.04 with ROS melodic.
1.View the data
DATA: https:// advdataset2019.wixsite.com /urbanloco
Thanks to MSC lab published this dataset. This is a public dataset for non-commercial but academic use. And in this article, I will use the first data named BayBride.
First, I viewed the data in this bag file.
rosbag info CA-20190828151211_blur_align.bag
The team recorded the GNSS messages with novatel_span_driver which format is novatel_msgs/INSPVAX. But rviz_satellite only support sensor_msgs/NavSatFix
Don’t worry, the wiki of novatel_span_driver told they will transform the data into sensor_msgs/NavSatFix and then republish them. In this case, We can use the /navsat/fix topic directly.
NovatelPublisher class, which subscribes to those NovAtel-specific messages, and republishes them as standard ROS messages like sensor_msgs/NavSatFix and nav_msgs/Odometry.
Next, I installed the plugin.
2.Install rviz_satellite
Download address:https:// github.com/gareth-cross /rviz_satellite
Then put it into the workspace of catkin.
cd ~/catkin_ws catkin_make
Then I used the demo to test whether I install it correctly.
roslaunch rviz_satellite demo.launch
Luckily, I installed it successfully.
3. Visualize the data in RVIZ
Then I played the data. Because the data file is too big, I choose to only play the GNSS topic.
Rosbag play CA-20190828151211_blur_align.bag --topic /navsat/fix
Add the plugin in RVIZ: Add AerialMapDisplay
Choose the Topic: /navsat/fix
We can choose the Object URL from below.
OpenStreetMap: https://tile.openstreetmap.org/{z}/{x}/{y}.png
TomTom:https://api.tomtom.com/map/1/tile/basic/main/{z}/{x}/{y}.png?tileSize=512&key=[TOKEN]
Mapbox: https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token=[TOKEN]
OK, The map was loaded in RVIZ successfully.
We can find the cross in the center of the window move with the time pass.
That’s cool. But the program runs very slowly on my computer. I think the reason is the network.
By the way, ROS has a package named mapviz which focus on 2D visualization. I will try it next.
Originally published at https://zhuanlan.zhihu.com.(I write it in Chinese first)