0
$\begingroup$

Rosanswers logo

Hi,

I am using the jackal in simulation. I have C++ code which has a subscriber to the "navsat/fix" topic. My program has the jackal travelling to a distance of 10m in the "x direction" before it stops. I am trying to collect data from different sensors one of them being the gps. I have latitude, longitude and altitude values. How do I use the values to calculate the distance travelled between two points?

the first value is : lat = 49.9; long = 8.9; alt = 0.0634842; The value at the end of 10m is: lat = 49.9001; long = 8.9; alt = 0.0634803;

Please help.

Regards, rsmitha.


Originally posted by rsmitha on ROS Answers with karma: 43 on 2017-05-28

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Have a look at the robot_localization package, and its documentation here. It sounds like you could be trying to perform the job that it does already. It includes a node called navsat_transform_node which performs accurate GPS -> map conversions, to fuse with imu and odometry data to position your robot more accurately.

If you don't want to use the node itself, have a look at the navsat_conversions.h file in its include directory. This provides a lat/long -> UTM conversion. UTM is measured in meters, so you can easily find the positions in the UTM grid and use this to get your distance travelled in meters.


Originally posted by ufr3c_tjc with karma: 885 on 2017-05-28

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by rsmitha on 2017-05-28:
Thanks for the help and the documentation, @ufr3c_tjc. If the navsat_transform_node is already present, when we do "rostopic list" shouldn't the odometry/gps topic be listed?

Comment by ufr3c_tjc on 2017-05-28:
Have you set up navsat_transform_node correctly? Please read through the documentation fully. It's not a trivial exercise and may take you a while to make sure the node is working correctly. Once it is all working, yes, it will publish the data on the odometry/gps topic.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.