Giter Site home page Giter Site logo

Comments (18)

fabianoboril avatar fabianoboril commented on July 19, 2024 1

@TixiaoShan : You need to use a version newer than 0.9.1. 0.9.1 will not work (as you just saw ;-))

You can get a build from last night here:
http://158.109.9.218:8080/blue/organizations/jenkins/carla/detail/master/12/artifacts
I haven't tested it, but I guess it should work.

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

Same here. No setup file in that folder.

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

Hi,
pip install is for users that build CARLA from source. I will update the documentation accordingly.

Regarding your issue: Currently the ROS bridge requires a CARLA version newer than 0.9.1. Either you download the current master branch from CARLA and build it from source (then pip install... is correct), or you download an intermediate build from Jenkins. In this case, you either use easy_install or simply extend your PYTHONPATH env variable to point to the egg file for your python version.

Regards,
Fabian

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

We update the documentation. Please have a look. Extending the PYTHONPATH seems currently the best option to make it run smoothly on all kinds of systems.

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

@fabianoboril
Thanks for the update! It seems that I still can't run the launch file because of an error.

/home/tixiao/.local/lib/python2.7/site-packages/simple_pid/PID.py:22: UserWarning: time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.
  warnings.warn('time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.')
Traceback (most recent call last):
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/client.py", line 16, in <module>
    from carla_ros_bridge.bridge import CarlaRosBridge
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/bridge.py", line 20, in <module>
    from carla_ros_bridge.parent import Parent
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/parent.py", line 254, in <module>
    from carla_ros_bridge.vehicle import Vehicle     # pylint: disable=wrong-import-position
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/vehicle.py", line 174, in <module>
    from carla_ros_bridge.ego_vehicle import EgoVehicle  # pylint: disable=wrong-import-position
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/ego_vehicle.py", line 23, in <module>
    from carla import VehicleControl
ImportError: cannot import name VehicleControl

python -c 'import carla;print("Success")' gives me Success.

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

@TixiaoShan : Do you use a recent CARLA version (newer than 0.9.1)?

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

@fabianoboril
Yes. I just downloaded compiled version of 0.9.1. After using command export PYTHONPATH=$PYTHONPATH:<path/to/carla/>/PythonAPI/<your_egg_file>, I got a new error, the old error mentioned above is gone.

process[rviz-3]: started with pid [6986]
/home/tixiao/.local/lib/python2.7/site-packages/simple_pid/PID.py:22: UserWarning: time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.
  warnings.warn('time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.')
[INFO] [1545403327.348348, 0.000000]: Trying to connect to localhost:2000
[INFO] [1545403327.359960, 0.000000]: Connected
Traceback (most recent call last):
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/bridge.py", line 157, in _carla_time_tick
    self.update()
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/parent.py", line 156, in update
    self._create_new_children()
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/parent.py", line 107, in _create_new_children
    carla_actor=actor, parent=self)
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/spectator.py", line 40, in __init__
    append_role_name_topic_postfix=append_role_name_topic_postfix)  # pylint: disable=line-too-long
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/actor.py", line 46, in __init__
    if carla_actor.attributes.has_key('role_name'):
AttributeError: 'Actor' object has no attribute 'attributes'

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

@fabianoboril
My bad, I thought 0.9.1 is the newest. I will give it a shot. Thank you so much for your time!

from ros-bridge.

s7ev3n avatar s7ev3n commented on July 19, 2024

Hi, @fabianoboril

Thanks for your help. I have downloaded 0.9.2 pre-built, however it seems the ros_bridge still could not work with this version. It reports to use libpng16-dev which is in conflict with ros that uses libpng12-dev, it also refered in carla-simulator/carla#901 (comment).

I guess I have to build 0.9.2 without png support from source??

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

Hi @s7ev3n:
Try installing only the library (libpng16-16) and not the dev package. Then it should work.

Merry XMas!

from ros-bridge.

s7ev3n avatar s7ev3n commented on July 19, 2024

Thanks!
And Merry XMas!!

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

Hi @fabianoboril ,

I have downloaded the latest 0.9.2 compiled version along with the code in this repo. However, when I launch the ros bridge, I still get a similar error.

process[master]: started with pid [19641]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 3c1d9454-07c6-11e9-b9f0-638d049ea693
process[rosout-1]: started with pid [19654]
started core service [/rosout]
process[carla_ros_bridge-2]: started with pid [19672]
process[rviz-3]: started with pid [19679]
/home/tixiao/.local/lib/python2.7/site-packages/simple_pid/PID.py:22: UserWarning: time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.
  warnings.warn('time.monotonic() not available, using time.time() as fallback. Consider using Python 3.3 or newer to get monotonic time measurements.')
Traceback (most recent call last):
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/client.py", line 16, in <module>
    from carla_ros_bridge.bridge import CarlaRosBridge
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/bridge.py", line 20, in <module>
    from carla_ros_bridge.parent import Parent
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/parent.py", line 254, in <module>
    from carla_ros_bridge.vehicle import Vehicle     # pylint: disable=wrong-import-position
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/vehicle.py", line 174, in <module>
    from carla_ros_bridge.ego_vehicle import EgoVehicle  # pylint: disable=wrong-import-position
  File "/home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/ego_vehicle.py", line 23, in <module>
    from carla import VehicleControl
**ImportError: cannot import name VehicleControl**
[carla_ros_bridge-2] process has died [pid 19672, exit code 1, cmd /home/tixiao/catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/client.py __name:=carla_ros_bridge __log:=/home/tixiao/.ros/log/3c1d9454-07c6-11e9-b9f0-638d049ea693/carla_ros_bridge-2.log].
log file: /home/tixiao/.ros/log/3c1d9454-07c6-11e9-b9f0-638d049ea693/carla_ros_bridge-2*.log
0x17562a0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xcbc550) ): Atte

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

@TixiaoShan : It seems you're PYTHONPATH is missing the CARLA PythonAPI. Did you consider the step to extend your PYTHONPATH according to the README?
https://github.com/carla-simulator/ros-bridge/blob/master/Readme.md

export PYTHONPATH=$PYTHONPATH:<path/to/carla/>/PythonAPI/<your_egg_file>

Having set that properly, your problem should be gone!

Merry XMas!

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

@fabianoboril
Yes, I did use that command to link it to the egg file in the PythonAPI folder.
Also, python -c 'import carla;print("Success")' gives me Success.

from ros-bridge.

fabianoboril avatar fabianoboril commented on July 19, 2024

@TixiaoShan : If you only start python, which version does it report?

from ros-bridge.

TixiaoShan avatar TixiaoShan commented on July 19, 2024

@fabianoboril
It turns out that I forgot to add PythonAPI folder to the path. Silly mistake. Now the ros-bridge can launch with the correct PythonAPI in carla-0.9.2.

### Thanks for your time! Happy Holiday!

from ros-bridge.

raphaellmsousa avatar raphaellmsousa commented on July 19, 2024

I'm getting this error

/home/raphaell/.local/lib/python2.7/site-packages/simple_pid/PID.py:22: UserWarning: time.monotonic() not available in python < 3.3, using time.time() as fallback
warnings.warn('time.monotonic() not available in python < 3.3, using time.time() as fallback')
Traceback (most recent call last):
File "/home/raphaell/ros/catkin_ws_for_carla/src/ros-bridge/src/carla_ros_bridge/client.py", line 21, in
from carla_ros_bridge.bridge import CarlaRosBridge
File "/home/raphaell/ros/catkin_ws_for_carla/src/ros-bridge/src/carla_ros_bridge/bridge.py", line 20, in
from carla_ros_bridge.parent import Parent
File "/home/raphaell/ros/catkin_ws_for_carla/src/ros-bridge/src/carla_ros_bridge/parent.py", line 254, in
from carla_ros_bridge.vehicle import Vehicle # pylint: disable=wrong-import-position
File "/home/raphaell/ros/catkin_ws_for_carla/src/ros-bridge/src/carla_ros_bridge/vehicle.py", line 174, in
from carla_ros_bridge.ego_vehicle import EgoVehicle # pylint: disable=wrong-import-position
File "/home/raphaell/ros/catkin_ws_for_carla/src/ros-bridge/src/carla_ros_bridge/ego_vehicle.py", line 23, in
from carla import VehicleControl
ImportError: cannot import name VehicleControl

from ros-bridge.

gnykumar avatar gnykumar commented on July 19, 2024

Try running the below to check if it pointing to the right version.
after do export of egg from pre compiled workspace

export PYTHONPATH=$PYTHONPATH:/home/user/CARLA_0.9.2/PythonAPI/carla-0.9.2-py2.7-linux-x86_64.egg

python -c 'import carla; print carla'
<module 'carla' from '/home/user/CARLA_0.9.2/PythonAPI/carla-0.9.2-py2.7-linux-x86_64.egg/carla/__init__.py'>

It is pointing to the wrong Carla version, you can delete or rename the older carla version to fix the Error

from ros-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.