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

carla-ros-bridge error due to Python?

asked 2020-04-09 19:27:39 -0500

JoloGermanAg gravatar image

updated 2020-04-10 12:03:36 -0500

Howdy, following error when running

$ roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle
Traceback (most recent call last):
  File "/opt/carla-ros-bridge/melodic/lib/carla_ros_bridge/bridge.py", line 25, in <module>
    from carla_ros_bridge.actor import Actor
  File "/opt/carla-ros-bridge/melodic/lib/python2.7/dist-packages/carla_ros_bridge/actor.py", line 19, in <module>
    import carla_ros_bridge.transforms as trans
  File "/opt/carla-ros-bridge/melodic/lib/python2.7/dist-packages/carla_ros_bridge/transforms.py", line 16, in <module>
    import tf
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/__init__.py", line 30, in <module>
    from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/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)

From what little info i found it seems to be an incompatibility between python2 and python3 but I am not sure how to fix this. Also, it's not saving the log file so that's why i didnt attach that

Installation was done following the instructions on gitlab!

edit retag flag offensive close merge delete

Comments

Hi @JoloGermanAg

I am trying to set up Carla as well. Can you please provide the link to the instructions you have followed to set up Carla simulator to work with Autoware?

Thank you!

omkard gravatar image omkard  ( 2020-04-11 18:34:51 -0500 )edit

Here it is: https://gitlab.com/autowarefoundation...

Just make sure that you are have downloaded and installed the Master branch for Autoware as these specific instructions are a recent addition/upgrade as far as I understand.

JoloGermanAg gravatar image JoloGermanAg  ( 2020-04-11 20:43:23 -0500 )edit

Thank you very much !! @JoloGermanAg

omkard gravatar image omkard  ( 2020-04-12 16:32:30 -0500 )edit

Hi @JoloGermanAg,

I am getting the following error. Please advise.

image description

omkard gravatar image omkard  ( 2020-04-13 11:43:27 -0500 )edit

did you follow the instructions and install carla? The first one suggests that you may be using an older version of autoware that does not include the autoware bridge yet. go to (PathToAutoware)/install/carla_autoware_bridge. If it;s not there you need to reinstall autoware from the newest (master/bleeding edge) branch. The second one is missing the .launch at the end

JoloGermanAg gravatar image JoloGermanAg  ( 2020-04-13 14:01:43 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-07-29 08:03:13 -0500

jester gravatar image

updated 2020-07-29 08:06:57 -0500

I think that you installed the wrong python .egg file...

There are 2 ways:

  1. Expand your .bashrc with the Pythonpath:

    export CARLA_ROOT=~/CARLA_0.9.8
    export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.8-py2.7-linux-x86_64.egg:${CARLA_ROOT}/PythonAPI/carla/agents:${CARLA_ROOT}/PythonAPI/carla
    
  2. Install the right .egg file

    pip uninstall carla or pip3 uninstall carla

    python easy_install -m carla-0.9.8-py2.7-linux-x86_64.egg
    

    or

    python easy_install -m carla-0.9.8-py3.6-linux-x86_64.egg
    
edit flag offensive delete link more
1

answered 2020-04-11 18:07:55 -0500

JoloGermanAg gravatar image

Fixed it, for some reason the default was changed to python 3.6 instead of 2.7.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-04-09 19:27:39 -0500

Seen: 1,824 times

Last updated: Jul 29 '20