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

image_geometry PinholeCameraModel Python not importing properly when installed using debian package

asked 2015-05-26 18:19:05 -0500

basheersubei gravatar image

updated 2015-05-28 18:22:55 -0500

I'm running Indigo (with catkin) on Ubuntu 14, and I'm trying to use the image_geometry package in Python(without roslib). When I import the package and try to instantiate a PinholeCameraModel object, it errors out and says: AttributeError: 'module' object has no attribute 'PinholeCameraModel'. Here is the full error.

I have image_geometry installed from apt-get, and my package.xml has both build_depend and run_depend for the image_geometry package. My code is below:

#!/usr/bin/env python
import rospy
import image_geometry

if __name__ == '__main__':
    rospy.init_node('blabla_node')
    cam_model = image_geometry.PinholeCameraModel()

    rospy.spin()

My end goal is to run projectPixelTo3dRay() on image pixels and find their intersection with the ground plane.

I ran a Python shell session and tried dir(image_geometry) and it only displayed this: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']. I'm assuming this means it hasn't imported it properly.

Below is my PYTHONPATH in case it matters (I even added the path of image_geometry to it):

/opt/ros/indigo/lib/python2.7/dist-packages/image_geometry:/home/basheersubei/edt_ws/devel/lib/python2.7/dist-packages:/home/basheersubei/edt/new_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages

What am I doing wrong? Can someone provide an example on how to instantiate a PinholeCameraModel object? The only example I found here is where I got this from and it doesn't work.

EDIT I installed image_geometry from source and it worked just fine now... Even running dir(image_geometry) in Python shows the PinholeCameraModel correctly... I'm so baffled. Should I file a bug report? Does anyone else have this issue?

EDIT 2 I just tried this on another Ubuntu 14 machine (same setup) and it seems to work from the debian package... No idea what's going on...

edit retag flag offensive close merge delete

Comments

I have the same issue: https://github.com/ros-perception/vis...

How did you compile from source? Just image_geometry or the whole vision_opencv package?

SimonB gravatar image SimonB  ( 2017-07-12 11:23:04 -0500 )edit

This was ages ago, so I'm not sure but I think it was just image_geometry package. Good luck! :)

basheersubei gravatar image basheersubei  ( 2017-07-12 11:55:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-17 07:34:16 -0500

SimonB gravatar image

Compile the whole vision_opencv package from source and it works:

https://github.com/ros-perception/vis...

Presumably this will get fixed in the fullness of time.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-05-26 18:19:05 -0500

Seen: 1,510 times

Last updated: Jul 17 '17