No module name geonav_transform.geonav_conversions

Hello
When I try to use geonav_transform.geonav_conversions to convert latitude & longitude.
I’m getting a ImportError: no module name geonav_transform.geonav_conversions.

Hello @HrithikVerma ,

Is this from a specific exercise of the course? Could you please point out which one? Thanks in advance.

@albertoezquerro Fuse Sensor Data to Improve Localization Course
It is related exercise where we transfer between utm & lat long

Please indicate in which exercise are you having this problem. Please post your code and any other details required to understand in which situation are you having the problem.
We need more details in order to identify where your problem is.

1 Like

In Fuse Sensor Data to Improve Localization Course, Unit 4

gps_to_xyz.py

#!/usr/bin/env python 

# Import geonav tranformation module
import geonav_transform.geonav_conversions as gc
reload(gc)
# Import AlvinXY transformation module
import alvinxy.alvinxy as axy
reload(axy)
import rospy
import tf
from nav_msgs.msg import Odometry


def get_xy_based_on_lat_long(lat,lon, name):
    # Define a local orgin, latitude and longitude in decimal degrees
    # GPS Origin
    olat = 49.9
    olon = 8.9
    
    xg2, yg2 = gc.ll2xy(lat,lon,olat,olon)
    utmy, utmx, utmzone = gc.LLtoUTM(lat,lon)
    xa,ya = axy.ll2xy(lat,lon,olat,olon)

    rospy.loginfo("#########  "+name+"  ###########")  
    rospy.loginfo("LAT COORDINATES ==>"+str(lat)+","+str(lon))  
    rospy.loginfo("COORDINATES XYZ ==>"+str(xg2)+","+str(yg2))
    rospy.loginfo("COORDINATES AXY==>"+str(xa)+","+str(ya))
    rospy.loginfo("COORDINATES UTM==>"+str(utmx)+","+str(utmy))

    return xg2, yg2

if __name__ == '__main__':
    rospy.init_node('gps_to_xyz_node')
    xg2, yg2 = get_xy_based_on_lat_long(lat=49.9,lon=8.9, name="MAP")
    xg2, yg2 = get_xy_based_on_lat_long(lat=50.9,lon=8.9, name="MAP")

Error:
import geonav_transform.geonav_conversions as gc
ImportError: No module named geonav_transform.geonav_conversions

I think this error is there because geonav_transform package for python is not installed. I have seen this error in my local system as well so I used another python package name utm.

It looks like the package geonav_transform is not installed in the system (it should be).
We are going to correct this error in the next days.

In the mean time, you can install the package in your area yourself and keep learning. For that, do the following steps:

cd /home/user/catkin_ws/src
git clone https://github.com/bsb808/geonav_transform.git
cd /home/user/catkin_ws/
catkin_make
source devel/setup.bash; rospack profile

You only need to do this once. Once you have done it, you should be able to import the module.

1 Like