gps_dumper.cpp
Go to the documentation of this file.
1 #include <ros/ros.h>
2 #include <nav_msgs/Odometry.h>
3 #include <stdio.h>
4 
5 void gpsCallback(const nav_msgs::Odometry::ConstPtr& msg)
6 {
7 // printf("Got msg!\n");
8  printf("%lf,%lf,0\n",msg->pose.pose.position.y,msg->pose.pose.position.x,msg->pose.pose.position.z);
9  //printf(" VEL:[%lf] ANG:[%lf]\n",msg->linear.x,msg->angular.z);
10 }
11 
12 int main(int argc, char ** argv)
13 {
14  ros::init(argc, argv, "gps_dumper");
16  ros::Subscriber sub = n.subscribe("gps_odom", 1, gpsCallback);
17  ros::spin();
18  return 0;
19 }
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void gpsCallback(const nav_msgs::Odometry::ConstPtr &msg)
Definition: gps_dumper.cpp:5
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char **argv)
Definition: gps_dumper.cpp:12


gpsd_client
Author(s): Ken Tossell , Rob Thomson
autogenerated on Thu May 28 2020 03:13:34