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

Using navsat_transform_node to Transform Target GPS Coordinate?

asked 2020-10-05 15:07:37 -0500

jin031214 gravatar image

Hi,

If I had a GPS module attached my robot and a GPS coordinate for a navigation goal for the robot to reach, how would I transform that goal into the odom frame? It's an easy question for the base frame which has an odometer and an imu attached, but how would I do it for the goal GPS coordinate? Is there a built in function or should I write my own node for this purpose? Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-10-06 01:05:54 -0500

Humpelstilzchen gravatar image

updated 2020-10-06 01:06:45 -0500

You havn't provided your setup, e.g. what nodes you are using, so I will just say what I'm using: navsat_transform_node and python.

With python I first use geodesy to convert the latitude and longitude from degrees to UTM coordinates:

point = utm.fromLatLong(lat, lon)

navsat_transform_node provides the transform world_frame->utm, so we can now just provide the goal point in UTM coordinates:

goal = MoveBaseGoal()
goal.target_pose.header.frame_id = "utm"
goal.target_pose.pose.position.x = point.easting
goal.target_pose.pose.position.y = point.northing
(...)
move_base.send_goal(goal)

The full script I'm using is here

edit flag offensive delete link more

Comments

My apologies,

The actual robot is equipped with Jetson TX2 that runs ROS Kinetic, but it's in repair so I'm running a husky simulation on a laptop running melodic.

husky_empty_world.launch from husky_gazebo package, gmapping.launch from husky_navigation package, move_base.launch from husky_navigation package, navsat_transform_template.launch from robot_localization package

Python is the preferred language.

jin031214 gravatar image jin031214  ( 2020-10-06 09:05:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-05 15:07:37 -0500

Seen: 377 times

Last updated: Oct 06 '20