Import error while spawning a robot model in gazebo 8 and ros kinetic
Hello all,
I have been trying to run gazebo 8 with ros-kinetic. Everything works fine until I try to spawn a robot in the world. It gives me the following error:
"Traceback (most recent call last):
File "/opt/ros/kinetic/lib/gazeboros/spawnmodel", line 32, in
import tf.transformations as tft
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/init.py", line 28, in
from tf2ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2ros/init.py", line 38, in
from tf2py import *
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2py/init.py", line 38, in
from .tf2 import *
ImportError: dynamic module does not define module export function (PyInittf2)
[spawnurdf-7] process has died [pid 31281, exit code 1, cmd /opt/ros/kinetic/lib/gazeboros/spawnmodel -param robotdescription -urdf -x 3 -y -12 -z 0.5 -model prius _name:=spawnurdf _log:=/home/niranjan/.ros/log/28fa1a56-9cc2-11e8-b69d-d89ef32ba530/spawnurdf-7.log].
log file: /home/niranjan/.ros/log/28fa1a56-9cc2-11e8-b69d-d89ef32ba530/spawnurdf-7*.log".
Any idea what am I missing here?
Thank you.
Answers
Errors like this are caused by python version problem. Your tf package can only be used by python2, so just change the first line of your spawn_model script: from #! /usr/bin/env python to #! /usr/bin/env python2.7.
Asked by Coder110 on 2019-11-24 22:51:55 UTC
Comments