Undefined reference with tf and rospy
Hi All,
I am having a problem with an undefined reference when attempting to use tf
with rospy
.
The error message is:
[imu_cmp_sync_stick-16] process has died [pid 8677, exit code 1, cmd /home/mech801/catkin_ws/src/ros_opto22/src/imu_cmp.py imu1:=/imu_sync/stick_imu __name:=imu_cmp_sync_stick __log:=/home/mech801/.ros/log/6aec55c6-f1d8-11e3-a955-0002b333179f/imu_cmp_sync_stick-16.log].
log file: /home/mech801/.ros/log/6aec55c6-f1d8-11e3-a955-0002b333179f/imu_cmp_sync_stick-16*.log
Traceback (most recent call last):
File "/home/mech801/catkin_ws/src/ros_opto22/src/imu_cmp.py", line 46, in <module>
import tf
File "/home/mech801/catkin_ws/devel/lib/python2.7/dist-packages/tf/__init__.py", line 34, in <module>
exec(__fh.read())
File "<string>", line 28, in <module>
ImportError: /home/mech801/catkin_ws/devel/lib/python2.7/dist-packages/tf/_tf.so: undefined symbol: _ZN3ros7console13g_initializedE
Clearly there is a problem with the linking of the function ros::console::g_initialized()
. However, I am not sure how to fix it, as this is a Python program and I am getting a C++ linker error.
catkin_make
works fine, even on a 100% clean catkin_ws
directory (i.e. devel
and build
directories deleted before running catkin_make
again).
The python code segment that causes the error is an import tf
directive. This can be proved by running python
and attempting to import tf
at the command prompt.
>>> import tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mech801/catkin_ws/src/geometry/tf/src/tf/__init__.py", line 28, in <module>
from _tf import *
ImportError: No module named _tf
Note that the tf
package has been installed and its directory tree exists as /opt/ros/groovy/lib/python2.7/dist-packages/tf
. I am not sure why it's trying to read it form my local catkin_ws
directory tree.
Thanks, Bart