Gazebo | Ignition | Community
Ask Your Question
0

Import error while spawning a robot model in gazebo 8 and ros kinetic

asked 2018-08-10 12:50:35 -0500

niranjan_187 gravatar image

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/gazebo_ros/spawn_model", line 32, in <module> import tf.transformations as tft File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module> from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module> from tf2_py import * File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module> from ._tf2 import * ImportError: dynamic module does not define module export function (PyInit__tf2) [spawn_urdf-7] process has died [pid 31281, exit code 1, cmd /opt/ros/kinetic/lib/gazebo_ros/spawn_model -param robot_description -urdf -x 3 -y -12 -z 0.5 -model prius __name:=spawn_urdf __log:=/home/niranjan/.ros/log/28fa1a56-9cc2-11e8-b69d-d89ef32ba530/spawn_urdf-7.log]. log file: /home/niranjan/.ros/log/28fa1a56-9cc2-11e8-b69d-d89ef32ba530/spawn_urdf-7*.log".

Any idea what am I missing here?

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-11-24 21:51:55 -0500

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-10 12:50:35 -0500

Seen: 1,197 times

Last updated: Aug 10 '18