Using utm_odometry_node to convert GPS mesurement to obtain x y coordinates
I'm Jurica, student at Faculty of Electrical Engineering and Computing (FER). I use ROS CTurtle (instaled in VirtualBox) and I wish to use utm_odometry_node(in gps_common package) to convert GPS latitude and longitude in (x y) coordinates.
I need convert these measurement because I will use them with odometry in EKF for robot localization in outdoor environment.
Except latitude and longitude (which i want to convert) I would use Direction(from north) and HDOP factor.(i use old msgs:gps_common/GPSStatus and gps_common/GPSFix)
So i read problem in gpsd_client tutorials(http://answers.ros.org/question/82/problem-in-gpsd_client-tutorials)and I was modified code explained there:
#include"ros/ros.h"
#include<iostream>
#include<gps_common/GPSFix.h>
#include<gps_common/GPSStatus.h>
using namespace gps_common; // in original ansewr namespace is missing so code don't work
void callback(const gps_common::GPSFix::ConstPtr &msg){ // instead &msg there can be &fix
// if(msg->status.status == GPSStatus::STATUS_NO_FIX){
// std::cout <<"Unable to get a fix on the location." << std::endl;
// return;
// }
std::cout << "Current Latutide:" << msg->latitude << std::endl;
std::cout << "Current Longitude:" << msg->longitude << std::endl;
std::cout << "Current Altitude:" << msg->altitude << std::endl;
std::cout << "Direction(from north):" << msg->track << std::endl;
std::cout << "HDOP:" << msg->hdop << std::endl;
//std::cout << "Status:" << msg->status.status << std::endl;
//std::cout << "Service:" << msg->status.service << std::endl;
}
int main(int argc, char **argv) {
ros::init(argc,argv,"gps_subscriber");
ros::NodeHandle nh;
ros::Subscriber gps_sub=nh.subscribe("fix",1,callback);
ros::spin();
return 0;
}
So i ask if i can change utm_odometry_node somehow to use instead sensor_msgs/NavSatStatus and sensor_msgs/NavSatFix old msg tpye: gps_common/GPSStatus and gps_common/GPSFix. Old msg type have HDOP and Direction information and new don't have. (I use LS20030(USB interface) MTK Smart Antenna GPS reciever(http://www.locosystech.com/product.php?zln=en&id=20)). Well if someone have some useful information i would be greatfull.