ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How can i write a publisher for /GPSFix message from Velodyne Lidar?

asked 2013-07-28 03:05:36 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I am working with lidar and QGIS. i need to take /GPSFix meassage from velodyne lidar and mark its GPS position in QGIS map. In QGIS i have to write a plugin but for that i need to subscribe /GPSFix meassage from lidar.

Is it possible?

if so how to implement it? can anyone help? pls

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-05 18:51:08 -0500

Bindu gravatar image

I found. This is the code.

#include "ros/ros.h"
#include <gps_common/GPSFix.h>

void GPSCallback(const gps_common::GPSFix::ConstPtr& msg)
std::cout<<"Latitude: "<<msg->latitude<<"\t"<<"Longitude: "<<msg->longitude<<"\n";

int main(int argc, char **argv)

  ros::init(argc, argv, "listener");

  ros::NodeHandle n;

  ros::Subscriber sub = n.subscribe("/GPSFix", 1000, GPSCallback);


  return 0;
edit flag offensive delete link more


Can /GPSFix be published by gpsd_client from Garmin 18 LVC?

weiy1991 gravatar image weiy1991  ( 2015-09-07 08:42:39 -0500 )edit

Question Tools



Asked: 2013-07-28 03:05:36 -0500

Seen: 315 times

Last updated: Aug 05 '13