carla-simulator / ros-bridge Goto Github PK
View Code? Open in Web Editor NEWROS bridge for CARLA Simulator
License: MIT License
ROS bridge for CARLA Simulator
License: MIT License
System Specifications
Error
I am trying to open CARLA using ROS but I faced this error when writing this command
roslaunch carla_ros_bridge client.launch
process[carla_ros_bridge-2]: started with pid [21539] /home/user/.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/user/ros/catkin_ws_for_carla/src/src/client.py", line 16, in <module> from carla_ros_bridge.bridge import CarlaRosBridge File "/home/user/ros/catkin_ws_for_carla/src/src/carla_ros_bridge/bridge.py", line 20, in <module> from carla_ros_bridge.parent import Parent File "/home/user/ros/catkin_ws_for_carla/src/src/carla_ros_bridge/parent.py", line 254, in <module> from carla_ros_bridge.vehicle import Vehicle # pylint: disable=wrong-import-position File "/home/user/ros/catkin_ws_for_carla/src/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/user/ros/catkin_ws_for_carla/src/src/carla_ros_bridge/ego_vehicle.py", line 27, in <module> from carla_ros_bridge.msg import CarlaVehicleControl # pylint: disable=no-name-in-module,import-error ImportError: No module named msg
On running the script manual_control.py along with carla_ros_bridge the ego vehicle do not run smoothly there is a tremendous amount of lag when controlled from the keyboard.
Also in my script when I spawn a vehicle in autopilot mode and set its role name as "hero", the motion of ego vehicle is not smooth.
But when I do not set the role name of the vehicle everything works perfectly. I could not understand the problem. I tried changing the PID parameters but no improvement.
This is more of just a tracking thing (I'm not sure if this is the right area).
But travis should be ensuring that some level of 'ros_bridge' functionaltiy works on an ongoing basis (at some level of bare minimum support).
For example, from my local work it seems like libpng16 is going to break that functionality (ros packages only want to work with libpng12); so it would be great to learn about these types of issues at PR creation time instead of after merge...
Hello,
I am working on application where my subscriber is pretty faster.
I want to publish the gnss topic at 100hz rates.
Is there a way to do that?
It seems that I need to adjust carla simulation main core.
According to the last issue, tick interval attribute can be related to my issue.
Where could I find to adjust tick interval of gnss sensor message in carla simulation code?
and how could I adjust frequency of the topic in rosbridge code.
Although I modify rospy.rate frequency from 200hz to 1000hz in run method function of bridge.py file, the rate of frequency of the topic has not been changed.
Thanks and regards,
Hello,
I am using Carla 0.9.3 on Ubuntu 16.04
I can get the ros-bridge to publish the sensor.other.collision data but I am unable to do the same for the sensor.other.lane_detector. Is there some implementation difference between the two sensors? How do I detect the sensor.other.lane_detector actor?
Thanks,
Praneeta
Hi, I am trying to use carla_ros_bridge on precompiled 0.8.4 my carla_ros_bridge and PythonClient came from the latest branch. When I ran a test it gives me this error.
[ROSUNIT] Outputting test results to /home/overlapjho/.ros/test_results/carla_ros_bridge/rostest-test_ros_bridge_client.xml
Traceback (most recent call last):
File "/home/overlapjho/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 9, in <module>
from carla_ros_bridge.bridge import CarlaRosBridge
File "/home/overlapjho/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/bridge.py", line 16, in <module>
from carla_ros_bridge.sensors import CameraHandler, LidarHandler
File "/home/overlapjho/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/sensors.py", line 8, in <module>
from cv_bridge import CvBridge
ImportError: No module named cv_bridge
[Testcase: testtestTopics] ... ERROR!
ERROR: max time [20.0s] allotted for test [testTopics] of type [rostest/publishtest]
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostest/runner.py", line 148, in fn
self.test_parent.run_test(test)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostest/rostest_parent.py", line 132, in run_test
return self.runner.run_test(test)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 684, in run_test
(test.time_limit, test.test_name, test.package, test.type))
--------------------------------------------------------------------------------
[ROSTEST]-----------------------------------------------------------------------
SUMMARY
* RESULT: FAIL
* TESTS: 0
* ERRORS: 1
* FAILURES: 0
Hello ,Carlateam!
I am reading the code in the carla_ros_bridge,and find that there is dynamic_reconfigure server in the ego_vehicle.py, defined as follows:
self.reconfigure_server = Server( EgoVehicleControlParameterConfig, namespace=self.topic_name(), callback=(lambda config, level: AckermannControlVehicle.reconfigure_pid_parameters( self, config, level)))
But I don't look at the code that sendig request of dynamic reconfigure PID parameters.I noticet that when I run roslaunch carla_ros_bridge client.launch
and ./manual_control.py
,there is a print information that is Reconfigure Request: speed (0.05, 0.0, 0.5),accel (0.02, 0.0, 0.05)
.I don't know which code sent the dynamic reconfiguration parameter request.
Hello ,
Im running 0.9.1 carla build. Im able to start the server of 0.9.1 .
But when i run the carla test file , Im getting import carla failed. i.e. carla package not found error. please find the error below:
File "/home/aravind/Desktop/Catkin_ws/src/ros-bridge-master/src/carla_ros_bridge/client.py", line 14, in
import carla
ImportError: No module named carla
[Testcase: testtestTopics] ... ok
[ROSTEST]-----------------------------------------------------------------------
SUMMARY
Please help me on this regard. Thanks in advance
I tried to use ros-bridge and visualize LiDAR data using rviz.
But, I think that visualization of LiDAR data is incorrect.
It seems that the result of visualization is correct when the vehicle stops.
But, it seems that the result of visualization is incorrect and points of past frame remain when the vehicle moves.
I could not determine the problem which is the problem between CARLA and ros-bridge.
$ cd ${CARLA_ROOT}
$ ./CarlaUE4.sh -carla-server -windowed -ResX=320 -ResY=240
$ source ~/ros/catkin_ws_for_carla/devel/setup.bash
$ roslaunch carla_ros_bridge client_with_rviz.launch
$ cd ${CARLA_ROOT}
$ python manual_control.py
And, I selected LiDAR
as sensor.
Hello!
I am having trouble running client_with_rviz.launch
. After following the tutorial and running the commands, rviz opens up and nothing shows up.
Furthermore, it seems like the client has connected to the server. Debugging with ROS shows that there is no data being published under these topics.
Thank you and Merry Christmas!
I am trying to use carla_ros_bridge package Carla version 0.8.4 and ros kinetic
Running the test command fails
rostest carla_ros_bridge ros_bridge_client.test
Output:
Traceback (most recent call last):
File "/home/anshul/catkin_ws/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 42, in <module>
main()
File "/home/anshul/catkin_ws/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 38, in main
carla_ros_bridge.run()
File "/home/anshul/catkin_ws/src/carla_ros_bridge/src/carla_ros_bridge/bridge.py", line 143, in run
map_handler = MapHandler(scene.map_name)
AttributeError: 'SceneDescription' object has no attribute 'map_name'
[INFO] [1540391064.654831]: Shutdown requested
[Testcase: testtestTopics] ... ERROR!
ERROR: max time [20.0s] allotted for test [testTopics] of type [rostest/publishtest]
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostest/runner.py", line 148, in fn
self.test_parent.run_test(test)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostest/rostest_parent.py", line 132, in run_test
return self.runner.run_test(test)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 684, in run_test
(test.time_limit, test.test_name, test.package, test.type))
--------------------------------------------------------------------------------
[ROSTEST]-----------------------------------------------------------------------
SUMMARY
* RESULT: FAIL
* TESTS: 0
* ERRORS: 1
* FAILURES: 0
AttributeError: 'SceneDescription' object has no attribute 'map_name'
In carla ros bridge there is a bridge.py script which has following lines in init method:
self.carla_world.on_tick(self._carla_time_tick)
self.update_lock = threading.Lock()
I have following queries:
The self.update_lock is being used before initialization inside following method:
self.carla_world.on_tick(self._carla_time_tick)
How does this work?
When I use pdb debugger for debugging, error occurs after executing following line:
self.carla_world.on_tick(self._carla_time_tick)
Error - AttributeError: 'CarlaRosBridge' object has no attribute 'update_lock'
But when I run it without debugging, it works fine. How is it happening?
Hello,Carla team!
Thanks for making a good simulator.When I run the control module๏ผfinding that speed controller cannot maintain constant speed .In addition,I want to know if there is a horizontal control module in the ros_bridge.
I am trying to link carla with ros through this link
https://github.com/carla-simulator/carla/tree/master/carla_ros_bridge
However I get and error when testing the installation of carla_ros_bridge when I run the test
rostest carla_ros_bridge ros_bridge_client.test
this is what comes up:
[ros_bridge_client.test] is neither a launch file in package [carla_ros_bridge] nor is [carla_ros_bridge] a launch file name
even though I tried to source it and still fails.
Any Help??
Hi,
I have installed the egg and the installation seems successful and when I run python spawn command I am getting an ImportError. Please help.
xdsim@prescan2:~/carla_0_9_2$ sudo easy_install /home/xdsim/carla_0_9_2/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg
Processing carla-0.9.2-py3.5-linux-x86_64.egg
removing '/usr/local/lib/python3.5/dist-packages/carla-0.9.2-py3.5-linux-x86_64.egg' (and everything under it)
creating /usr/local/lib/python3.5/dist-packages/carla-0.9.2-py3.5-linux-x86_64.egg
Extracting carla-0.9.2-py3.5-linux-x86_64.egg to /usr/local/lib/python3.5/dist-packages
carla 0.9.2 is already the active version in easy-install.pth
Hi Guys,
I am facing the below issue while running roslaunch carla_ros_bridge client.launch
.
I have updated the PYTHONPATH
as mentioned in the RlEADME
and also I am getting success if I run python -c 'import carla;print("Success")'
.
Traceback (most recent call last):
File "/home/user/ros/catkin_ws_for_carla/src/src/carla_ros_bridge/client.py", line 14, in <module>
import carla
File "/home/kishor/Carla_Sim/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/__init__.py", line 7, in <module>
File "/home/kishor/Carla_Sim/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/libcarla.py", line 7, in <module>
File "/home/kishor/Carla_Sim/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/libcarla.py", line 6, in __bootstrap__
ImportError: /home/kishor/.cache/Python-Eggs/carla-0.9.2-py3.5-linux-x86_64.egg-tmp/carla/libcarla.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyUnicode_AsUTF8String
[carla_ros_bridge-2] process has died [pid 23024, exit code 1, cmd /home/kishor/ros/catkin_ws_for_carla/src/src/carla_ros_bridge/client.py __name:=carla_ros_bridge __log:=/home/kishor/.ros/log/bf8f277e-1f0b-11e9-8882-e4b97a000225/carla_ros_bridge-2.log].
log file: /home/kishor/.ros/log/bf8f277e-1f0b-11e9-8882-e4b97a000225/carla_ros_bridge-2*.log
Previously I had faced the similar issue, I was able to fix and posted the fix here. But now I am not able to see the post.
Could you please help me to fix the issue.
Thank you,
KK
Rosbridge dies with different errors every time I stop [ctrl + c] my python script. A similar thing happens with the scenario_runner package when a scenario finishes. Not sure if it is the desired behaviour ??
terminate called after throwing an instance of 'std::bad_weak_ptr'
what(): bad_weak_ptr
[carla_ros_bridge-1] process has died [pid 12253, exit code -6, cmd /home/anshul/catkin_ws/src/carla_ros-bridge/src/carla_ros_bridge/client.py __name:=carla_ros_bridge __log:=/home/anshul/.ros/log/0a3dc748-1265-11e9-ae1d-18a905c1f8b8/carla_ros_bridge-1.log].
log file: /home/anshul/.ros/log/0a3dc748-1265-11e9-ae1d-18a905c1f8b8/carla_ros_bridge-1*.log
And then there are few times it doesn't dies automaically. Not sure what is the reason for this.
I also observed that while closing manual_control.py script it never dies automatically. Is there anything I am missing / doing wrong in my script below??
def main():
actor_list = []
try:
client = carla.Client('localhost', 2000)
client.set_timeout(2.0)
world = client.get_world()
spectator = world.get_spectator()
blueprint_library = world.get_blueprint_library()
bp = random.choice(blueprint_library.filter('vehicle'))
bp.set_attribute('role_name', 'hero')
color = random.choice(bp.get_attribute('color').recommended_values)
bp.set_attribute('color', color)
transform = random.choice(world.get_map().get_spawn_points())
vehicle = world.spawn_actor(bp, transform)
actor_list.append(vehicle)
print('created %s' % vehicle.type_id)
vehicle.set_autopilot(True)
lidar_bp = blueprint_library.find('sensor.lidar.ray_cast')
lidar_bp.set_attribute('rotation_frequency', '10')
lidar_bp.set_attribute('channels', '16')
lidar_bp.set_attribute('range', '5000')
lidar_bp.set_attribute('points_per_second', '222000')
lidar_transform = carla.Transform(carla.Location(x= 0,z=2.4))
lidar = world.spawn_actor(lidar_bp, lidar_transform, attach_to=vehicle)
actor_list.append(lidar)
print('created %s' % lidar.type_id)
while True:
time.sleep(10)
except KeyboardInterrupt:
print("Interrupted!")
finally:
print('destroying actors')
for actor in actor_list:
actor.destroy()
print('done.')
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
finally:
print('\ndone.')
As I was doing data collection with ros-bridge, I encountered the following problem with the bagfiles.
'ascii' codec can't decode byte 0xc2
This problem is know for messages (https://answers.ros.org/question/240612/rosbag-unicodedecodeerror/?answer=242610#post-id-242610). Quoting the answer:
Just check which of your message definitions are UTF-8 encoded by the command line tool
file yourMessageDefinition.msg
. If it tells youASCII text
the definition should be OK, ifUTF-8 Unicode
text it is not.
While debugging I found out that the problem comes specifically from the message /carla/ego_vehicle/ego_vehicle_control_info
.
Everything else seems correct. I'll check it out myself and if I find a solution I'll let you know.
The topic message value of / carla / ego_vehicle / ego_vehicle_control_info is not output properly. When I tried rostopic echo / carla / ego_vehicle / ego_vehicle_control_info, the brake value at the output is being transmitted properly, but the throttle and brake are still fixed at 0.0. How can I fix this to get it to the right value? Which part of the file should I fix?
Hi,
I tried steps mentioned in https://github.com/carla-simulator/ros-bridge
to run ros-bridge with compiled version of carla 0.9.3
But i am not understanding how to add lidar to get lidar point cloud data in ros
and also I am getting below error in ros client_with_rivz.launch terminal
after running manaul.py
[INFO] [1551334494.393631, 260.269848]: Reconfigure Request: speed (0.05, 0.0, 0.5),accel (0.02, 0.0, 0.05),
Traceback (most recent call last):
File "/home/wipro16/carla_ros_ws/src/ros-bridge-0.9.3/src/carla_ros_bridge/bridge.py", line 157, in _carla_time_tick
self.update()
File "/home/wipro16/carla_ros_ws/src/ros-bridge-0.9.3/src/carla_ros_bridge/parent.py", line 159, in update
actor.update()
File "/home/wipro16/carla_ros_ws/src/ros-bridge-0.9.3/src/carla_ros_bridge/ego_vehicle.py", line 214, in update
self.vehicle_control_cycle()
File "/home/wipro16/carla_ros_ws/src/ros-bridge-0.9.3/src/carla_ros_bridge/ego_vehicle.py", line 450, in vehicle_control_cycle
self.run_accel_control_loop()
File "/home/wipro16/carla_ros_ws/src/ros-bridge-0.9.3/src/carla_ros_bridge/ego_vehicle.py", line 567, in run_accel_control_loop
self.info.current.accel)
File "/home/wipro16/.local/lib/python2.7/site-packages/simple_pid/PID.py", line 104, in __call__
self._derivative = -self.Kd * d_input / dt
ZeroDivisionError: float division by zero
and I am able run the vehicle after running manual.py but not ros lidar data.
Can someone help Where I am missing!
System : ubuntu 16, ROS Kinetic, python2.7, pip : pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
exported : egg file from pythonAPI before running ros client launch
installed protobuf and simple pid also and libpng16-16
When I open the server, by the following command
And then I use the manual_control.py to open the client
To here I get the good performance about the simulation
But when I use the ros-bridge
And then the client will be slower, when I type the "w", the vehicle will move forward a little and then be
brake.
Sorry my english is not good enough
I want to know is any setting I forgot or can be tested or this is just a normal phenomenon
Hello, I am using Carla since recently as an application where pedestrians and a ground robot can be controlled. Therefore I'd like to know if it is possible to control the pedestrian movements similarly to how the vehicles are controlled (ackerman messages). so far, I've been able to walk the pedestrians with the carla.Transform and walker.Control and I'm interested in achieving the control in similar fashion as with the ackerman messages
Thanks for the attention and best regards!
I am trying to run the rostest client to test my installation of carla ros bridge using this command: rostest carla_ros_bridge ros_bridge_client.test
and I get this error: carla.tcp.TCPConnectionError: (localhost:2001) failed to read data: [Errno 4] Interrupted system call
the error seems to be coming from this function: measurements, sensor_data = self.client.read_data()
I get the error message: 'failed to read data' that raises an exception as a TCP error.
any help?
rostest carla_ros_bridge ros_bridge_client.test
[ROSTEST]-----------------------------------------------------------------------
SUMMARY
I am using ROS melodic as I am using Debian 9 machine.
Is there a work around for this?
Thanks in advance
Hi,
I am running carla 0.9.1 binary. And I managed to successfully install ros-brigde.
However, when I followed the tests, I met version mismatch issue.
WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API
WARNING: Client API version: = 0.9.1-55-g9a16cf9
WARNING: Simulator API version = 0.9.1
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
Hello,
I am working on application where my subscriber is pretty slow.
I want to publish the topic at lower rates.
Is there a way to do that?
Thanks and regards,
Murali
Is there any docker image for this? With kinetic
or something. I played around a little bit with the image ros:kinetic-robot
but it's cumbersome (I haven't get it to work just yet).
To simplify the usage of the carla ros bridge, we should find a suitable way to make it installable via package.
This depends on a deployable Carla Python API: carla-simulator/carla#81
It would simplify the usage within Autoware: https://github.com/CPFL/Autoware/issues/2052
Hey people, I am using Carla0.9.4 and build it from source. When I'm using manual_control.py and launch the client.launch I get the following error:
Traceback (most recent call last):
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 132, in _callback_sensor_data
self.send_tf_msg()
Traceback (most recent call last):
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/child.py", line 155, in send_tf_msg
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 132, in _callback_sensor_data
tf_msg = self.get_tf_msg()
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/camera.py", line 141, in get_tf_msg
self.send_tf_msg()
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/child.py", line 155, in send_tf_msg
tf_msg = self.get_tf_msg()
tf_msg = super(Camera, self).get_tf_msg()
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 147, in get_tf_msg
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 147, in get_tf_msg
tf_msg.header = self.get_msg_header()
tf_msg.header = self.get_msg_header()
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 119, in get_msg_header
File "/home/user/ros/catkin_ws_for_carla/src/ros-bridge-master/src/carla_ros_bridge/sensor.py", line 119, in get_msg_header
header.stamp = rospy.Time.from_sec(self.current_sensor_data.timestamp)
AttributeError: 'GnssEvent' object has no attribute 'timestamp'
header.stamp = rospy.Time.from_sec(self.current_sensor_data.timestamp)
AttributeError: 'Image' object has no attribute 'timestamp'
What am I doing wrong? I am using python 2.7.
Hi! I use ros and python2. I have tried to use new version carla 0.9.3 and faced next problem:
File "/home/igor/catkin_ws/src/ros-bridge/src/carla_ros_bridge/ego_vehicle.py", line 450, in vehicle_control_cycle
self.run_accel_control_loop()
File "/home/igor/catkin_ws/src/ros-bridge/src/carla_ros_bridge/ego_vehicle.py", line 567, in run_accel_control_loop
self.info.current.accel)
File "/home/igor/.local/lib/python2.7/site-packages/simple_pid/PID.py", line 91, in call
self._derivative = -self.Kd * d_input / dt
ZeroDivisionError: float division by zero
I found, that it is because of new version simple-pid 0.1.5
For now i have solved it by downgrading to simple-pid 0.1.4
have a nice day = )
When visualizing the values of the sensors via rvizf, only one sensor is visualized for one scene. Is there a way to visualize all sensor values? For example, if you turn on the lidar sensor, only the point cloud value is visualized and the other camera screen is stopped. Which part of a file does it need to be modified?
Hi,
I'm experiencing difficulties with test control commands. I spanned a "hero" vehicle by using manual_control.py and launched the bridge ros package. I'm able to echo the topics posted by the bridge, but publishing to the /carla/ego_vehicle/ackermann_cmd topic doesn't do anything - the car only reacts to the keyboard.
I tried removing everything related to the keyboard in the manual_control.py but no luck - the ackermann_cmd still doesn't do anything.
Let me know what might be the problem.
Hello,
There are multiple sensor values in the bag file for the same header.stamp. I can't seem to solve this. Any ideas?
Ubuntu 16.04; Carla 0.9.3
Thanks,
Praneeta
Ubuntu 16.04, ROS Kinetic, CARLA 0.9.2.
After checking out, I ran "check.sh" to see what it turns up.
Then, when running CARLA and trying to start up the ROS bridge, per instructions on the README, I get the following error:
Traceback (most recent call last):
File "/home/ubuntu/catkin_ws/src/ros-bridge/src/carla_ros_bridge/client.py", line 16, in <module>
from carla_ros_bridge.bridge import CarlaRosBridge
File "/home/ubuntu/catkin_ws/src/ros-bridge/src/carla_ros_bridge/bridge.py", line 20, in <module>
from carla_ros_bridge.parent import Parent
File "/home/ubuntu/catkin_ws/src/ros-bridge/src/carla_ros_bridge/parent.py", line 8, in <module>
from carla_ros_bridge.vehicle import Vehicle # pylint: disable=wrong-import-position
File "/home/ubuntu/catkin_ws/src/ros-bridge/src/carla_ros_bridge/vehicle.py", line 8, in <module>
from carla_ros_bridge.ego_vehicle import EgoVehicle # pylint: disable=wrong-import-position
File "/home/ubuntu/catkin_ws/src/ros-bridge/src/carla_ros_bridge/ego_vehicle.py", line 25, in <module>
from carla_ros_bridge.vehicle import Vehicle
ImportError: cannot import name Vehicle
Git shows a bunch of files changed:
$ git status
modified: src/carla_ros_bridge/client.py
modified: src/carla_ros_bridge/ego_vehicle.py
modified: src/carla_ros_bridge/parent.py
modified: src/carla_ros_bridge/physics.py
modified: src/carla_ros_bridge/sensor.py
modified: src/carla_ros_bridge/vehicle.py
$ git diff src/carla_ros_bridge/ego_vehicle.py
diff --git a/src/carla_ros_bridge/ego_vehicle.py b/src/carla_ros_bridge/ego_vehicle.py
index c1bbe83..bb4f8b3 100644
--- a/src/carla_ros_bridge/ego_vehicle.py
+++ b/src/carla_ros_bridge/ego_vehicle.py
@@ -165,10 +165,9 @@ class EgoVehicle(Vehicle):
# send control command out, if there is a ROS control publisher
ros_control_topic = rospy.get_published_topics(namespace='/')
if (any('/carla/ego_vehicle/ackermann_cmd' == x[0] for x in ros_control_topic) or
- any('/carla/ego_vehicle/vehicle_control_cmd' == x[0] for x in ros_control_topic)):
+ any('/carla/ego_vehicle/vehicle_control_cmd' == x[0] for x in ros_control_topic)):
self.carla_actor.apply_control(vehicle_control)
-
def update_current_values(self):
"""
Function to update vehicle control current values.
$ git diff src/carla_ros_bridge/vehicle.py
diff --git a/src/carla_ros_bridge/vehicle.py b/src/carla_ros_bridge/vehicle.py
index 7e2e0bb..604613f 100644
--- a/src/carla_ros_bridge/vehicle.py
+++ b/src/carla_ros_bridge/vehicle.py
@@ -5,6 +5,7 @@
#
# authors: Bernd Gassmann ([email protected])
#
+from carla_ros_bridge.ego_vehicle import EgoVehicle # pylint: disable=wrong-import-position
"""
Classes to handle Carla vehicles
"""
@@ -170,5 +171,5 @@ class Vehicle(Actor):
self.publish_ros_message('/carla/objects', vehicle_object)
+
# this import has to be at the end to resolve cyclic dependency
-from carla_ros_bridge.ego_vehicle import EgoVehicle # pylint: disable=wrong-import-position
Hello,
I am using ros-brige with CARLA 0.9.3 on Ubuntu 16.04
I noticed that all the messages updated by the Vehicle class have a low publish rate - even lower than depth and image publishing rates!
What is the reason this low rate?
Thanks,
Praneeta
Hello,
I have followed the steps in Readme.md to build up the envrionment.
When I in the stage of ROS bridge, the terminal will get crash after executing cmd './CarlaUE4 -carla-server -windowed -ResX=320 -ResY=240'.
I have also attached the crash info. generated from Carla.
Crash.zip
could you help to check?
the following is the error stack:
`[2019.01.10-12.38.08:100][ 0]LogAIModule: Creating AISystem for world Town03
[2019.01.10-12.38.09:254][ 0]LogLoad: Game class is 'TheNewCarlaGameMode_C'
[2019.01.10-12.38.09:380][ 0]LogWorld: Bringing World /Game/Carla/Maps/Town03.Town03 up for play (max tick rate 0) at 2019.01.10-20.38.09
[2019.01.10-12.38.09:400][ 0]LogWorld: Bringing up level for play took: 0.132154
[2019.01.10-12.38.09:414][ 0]LogCarlaServer: Initializing rpc-server at port 2000
[2019.01.10-12.38.10:610][ 0]LogLinux: === Critical error: ===
Unhandled Exception: SIGABRT: abort() called
[2019.01.10-12.38.10:610][ 0]LogLinux: Fatal error!
0x00000000035baba5 FLinuxPlatformStackWalk::CaptureStackBackTrace(unsigned long long*, unsigned int, void*) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformStackWalk.cpp:1038]
0x000000000349fee5 FGenericPlatformStackWalk::StackWalkAndDump(char*, unsigned long, int, void*) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformStackWalk.cpp:171]
0x00000000035795e0 FLinuxCrashContext::CaptureStackTrace() [Runtime/Core/Public/Containers/ContainerAllocationPolicies.h:332]
0x00000000063a645b CommonLinuxCrashHandler(FGenericCrashContext const&) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Linux/LinuxCommonStartup/Private/LinuxCommonStartup.cpp:37]
0x000000000357aa43 PlatformCrashHandler(int, siginfo_t*, void*) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformCrashContext.cpp:521]
0x00007fec633d3390 /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7fec633d3390]
0x00007fec62394428 /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7fec62394428]
0x00007fec6239602a /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7fec6239602a]
0x00000000065a082c ./CarlaUE4() [0x65a082c]
0x00000000065a0641 ./CarlaUE4() [0x65a0641]
0x00000000065a0333 ./CarlaUE4() [0x65a0333]
0x00000000065a2426 ./CarlaUE4() [0x65a2426]
0x0000000006c756ab ./CarlaUE4() [0x6c756ab]
0x0000000006c7562c clmdep_asio::detail::do_throw_error(std::__1::error_code const&, char const*)
0x0000000006c755e2 clmdep_asio::detail::throw_error(std::__1::error_code const&, char const*)
0x0000000006c74f99 clmdep_asio::basic_socket_acceptor<clmdep_asio::ip::tcp, clmdep_asio::socket_acceptor_service<clmdep_asio::ip::tcp> >::basic_socket_acceptor(clmdep_asio::io_service&, clmdep_asio::ip::basic_endpoint<clmdep_asio::ip::tcp> const&, bool)
0x0000000006c73062 rpc::server::impl::impl(rpc::server*, unsigned short)
0x0000000006c70210 rpc::server::server(unsigned short)
0x0000000006c385c3 FTheNewCarlaServer::FPimpl::FPimpl(unsigned short) [/var/lib/jenkins/workspace/carla_0.9.1-C6GE5LCTAJLPLH6VLVPYCJ73A6NDPEZ2O3RLR6D7N6LYCMRH557A/Unreal/CarlaUE4/Plugins/Carla/CarlaDependencies/include/carla/rpc/Server.h:82]
0x0000000006bc77bb FTheNewCarlaServer::Start(unsigned short) [Runtime/Core/Public/Templates/UniquePtr.h:149]
0x0000000006bc7720 UCarlaGameInstance::NotifyBeginEpisode(UCarlaEpisode&) [/var/lib/jenkins/workspace/carla_0.9.1-C6GE5LCTAJLPLH6VLVPYCJ73A6NDPEZ2O3RLR6D7N6LYCMRH557A/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaGameInstance.cpp:18]
0x00000000052d4f2d AActor::DispatchBeginPlay() [Runtime/Core/Public/Containers/UnrealString.h:59]
0x000000000609533d AWorldSettings::NotifyBeginPlay() [Runtime/Core/Public/UObject/NameTypes.h:699]
0x00000000057faf0c AGameStateBase::HandleBeginPlay() [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Engine/Private/GameStateBase.cpp:177]
0x0000000006085379 Unknown [Runtime/Engine/Classes/Engine/World.h:1876]
0x0000000005f99c0a UEngine::LoadMap(FWorldContext&, FURL, UPendingNetGame*, FString&) [Runtime/Engine/Classes/Engine/Engine.h:375]
0x0000000005f96013 UEngine::Browse(FWorldContext&, FURL, FString&) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:10373]
0x00000000057dee4b UGameInstance::StartGameInstance() [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Engine/Private/GameInstance.cpp:436]
0x00000000057af8ae UGameEngine::Start() [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Engine/Private/GameEngine.cpp:751]
0x0000000003449b96 FEngineLoop::Init() [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:2759]
0x0000000003451fc7 GuardedMain(wchar_t const*) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Launch/Private/Launch.cpp:52]
0x00000000063a6eb0 CommonLinuxMain(int, char**, int ()(wchar_t const)) [/var/lib/jenkins/UnrealEngine_4.19/Engine/Source/Runtime/Linux/LinuxCommonStartup/Private/LinuxCommonStartup.cpp:236]
0x00007fec6237f830 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7fec6237f830]
0x0000000003444029 ./CarlaUE4(_start+0x29) [0x3444029]`
It doesn't look like information about the ego vehicles dynamic capabilities are transmitted to ROS. Would it possible to add them to the vehicle info message? Things like min/max bounds on speed/acceleration/jerk. I know that exact bounds can be tricky due to state dependency, but even just having approximate global bounds would be useful. What I'd like is primarily a sanity check: if my controller wants to command the vehicle to accelerate with 999m/s^2, I'd like to know that that's not physically possible.
Hi,
I ran :
and then on new terminal :
rostopic echo /carla/ego_vehicle/ego_vehicle_control_info
ERROR: Cannot load message class for [carla_ros_bridge/EgoVehicleControlInfo]. Are your messages built?
Hey,
I have the following error while launching the bridge node:
File "/home/vadbut/catkin_ws/src/ros-bridge/src/carla_ros_bridge/ego_vehicle.py", line 25, in <module>
from carla_ros_bridge import Vehicle
ImportError: cannot import name Vehicle
Simple stuff like sourcing setup.bash and rebuilding the module doesn't help. I use python 2.7. I tried rearranging the imports and it seems like everything else is being imported perfectly fine except for the Vehicle.
Thanks
Hello,everyone.
Now I try to run the launch file which is client.launch mentioned in the carla_ros_bridge.When I
enable manual control,running the example of forward movements as follows:
rostopic pub /ackermann_cmd ackermann_msgs/AckermannDrive "{steering_angle: 0.0, steering_angle_velocity: 0.0, speed: 10, acceleration: 0.0, jerk: 0.0}" -r 10
I found that speed shown as 9km/h in the carla emulator windows,which is different from speed which is set to 10m/s in the command above.Theoretically it should be 36km/h in the carla emulator windows .Why does this happen?
Hello,
Before diving into the problem I'm encountering, I must precise that I'm beginner with ROS, I know the basics and understand the purpose of nodes, topics, messages...
So lately, I tried to modify the client.launch and client.py files in order to take measurements for a second car that I control at the same time than the first one. The topics created that interest me are the /carla/ego_vehicle/... but unfortunately, it seems like it can be done for only one car at a time.
It is no surprise that I failed with my lack of experience, I couldn't succeed in creating a second node for a second car, like /carla/ego_vehicle_2/... When I modified client.launch and client.py, there was always a conflict because the services were already registered when I was adding a second client/user-controlled car.
Do somebody know if there is a simple way to modify the files in the /src directory in order to obtain a node for each car with the topics /carla/ego_vehicle/... ?
I'm looking forward to implement at least 3 clients (user controlled cars) and record rosbags of these cars at the same time. A command "rostopic list" with 3 clients would give then something similar to:
/carla/ego_vehicle_1/...
/carla/ego_vehicle_2/...
/carla/ego_vehicle_3/...
/carla/map
/carla/objects
/carla/vehicle_marker
/clock
/rosout
/rosout_agg
/tf
Thanks in advance,
Nathan
Note: Sorry if that seems unclear, I can bring more information if requested ofc
Hi,
Is there any plan to simulate a IMU sensor in this ros_brdige?
Thx
HI,
I am trying to send the image saved from my camera (using our existing programs in Carla environment) on the ego vehicle across to ROS environment.
How can I include that in my python code ?
When I try to run roslaunch command -
roslaunch carla_ros_bridge carla_ros_bridge.launch
roslaunch is trying to access a previously built ros brige.. How do I point It to the newly built ros bridge ?
I am using Carla 0.9.2 and ROS Lunar
"/home/xds/catkin_ws/src/carla_ros_bridge1/src/carla_ros_bridge/client.py" from the error message listed below is the wrong path.
Correct path should be -
"/home/xds/ros/carla_ros_bridge/src/carla_ros_bridge/client.py" which is the client.py from the new Carla bridge. How do I correct the link ?
My paths -
Path to Carla is - /home/xds/Carla_0_9_2/
Path to ros bridge - /home/xds/ros/Carla_ros_bridge/
Path to catkin workspace where my ros program is - /home/xds/catkin_ws_carla/
Any ideas please !
xds@prescan2:~/ros/catkin_ws_carla$ roslaunch carla_ros_bridge client.launch
WARNING: Package name "ClosedLoopRealtime" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "WMGCarmakerCameraRSI" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "ClosedLoopRealtimeACSToPod" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
... logging to /home/xds/.ros/log/b098ecea-41c1-11e9-ad39-246e964d427a/roslaunch-prescan2-14824.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
WARNING: Package name "ClosedLoopRealtime" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "WMGCarmakerCameraRSI" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "ClosedLoopRealtimeACSToPod" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
started roslaunch server http://prescan2:36485/
PARAMETERS
NODES
/
carla_ros_bridge (carla_ros_bridge/client.py)
ROS_MASTER_URI=http://localhost:11311
WARNING: Package name "ClosedLoopRealtime" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "WMGCarmakerCameraRSI" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "ClosedLoopRealtimeACSToPod" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
process[carla_ros_bridge-1]: started with pid [14841]
Traceback (most recent call last):
File "/home/xds/catkin_ws/src/carla_ros_bridge1/src/carla_ros_bridge/client.py", line 8, in
from carla.client import make_carla_client
File "/home/xds/carla_0_9_2/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/init.py", line 7, in
File "/home/xds/carla_0_9_2/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/libcarla.py", line 7, in
File "/home/xds/carla_0_9_2/PythonAPI/carla-0.9.2-py3.5-linux-x86_64.egg/carla/libcarla.py", line 6, in bootstrap
ImportError: /home/xds/.cache/Python-Eggs/carla-0.9.2-py3.5-linux-x86_64.egg-tmp/carla/libcarla.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyUnicode_AsUTF8String
[carla_ros_bridge-1] process has died [pid 14841, exit code 1, cmd /home/xds/catkin_ws/src/carla_ros_bridge1/src/carla_ros_bridge/client.py __name:=carla_ros_bridge __log:=/home/xds/.ros/log/b098ecea-41c1-11e9-ad39-246e964d427a/carla_ros_bridge-1.log].
log file: /home/xds/.ros/log/b098ecea-41c1-11e9-ad39-246e964dxds@prescan2:~$ rostopic pub /carla/ego_vehicle_cmd carla_ros_bridge/CarlaEgoVehicleControl "{throttle; 1.0, steer: 0.0}" -r 10
The program 'rostopic' is currently not installed. You can install it by typing:
sudo apt install python-rostopic
I am having an error with rostest for new ros_bridge for carla_0.91
rostest carla_ros_bridge ros_bridge_client.test
... logging to /home/anshul/.ros/log/rostest-encre-454.log
[ROSUNIT] Outputting test results to /home/anshul/.ros/test_results/carla_ros_bridge/rostest-test_ros_bridge_client.xml
[INFO] [1545042396.298388, 0.000000]: Trying to connect to localhost:2000
[INFO] [1545042396.345882, 0.000000]: Connected
Traceback (most recent call last):
File "/home/anshul/enable-s3/catkin_ws_carla/src/ros-bridge/src/carla_ros_bridge/bridge.py", line 155, in _carla_time_tick
self.update()
File "/home/anshul/enable-s3/catkin_ws_carla/src/ros-bridge/src/carla_ros_bridge/parent.py", line 156, in update
self._create_new_children()
File "/home/anshul/enable-s3/catkin_ws_carla/src/ros-bridge/src/carla_ros_bridge/parent.py", line 107, in _create_new_children
carla_actor=actor, parent=self)
File "/home/anshul/enable-s3/catkin_ws_carla/src/ros-bridge/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/anshul/enable-s3/catkin_ws_carla/src/ros-bridge/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'
[INFO] [1545042405.890883, 0.000000]: Shutdown requested
[Testcase: testtestTopics] ... ok
[ROSTEST]-----------------------------------------------------------------------
[carla_ros_bridge.rosunit-testTopics/test_publish][FAILURE]---------------------
Timed out (10s) of /clock publication.
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/opt/ros/kinetic/share/rostest/nodes/publishtest", line 117, in test_publish
self.fail('Timed out (10s) of /clock publication.')
File "/usr/lib/python2.7/unittest/case.py", line 410, in fail
raise self.failureException(msg)
--------------------------------------------------------------------------------
SUMMARY
* RESULT: FAIL
* TESTS: 1
* ERRORS: 0
* FAILURES: 1
I would like to know if there is somewhere available the information about traffict lights, current lane of the vehicle and even weather as a ros message. I ask because this kind of data may be useful for training models.
I run the standard client.launch
but it seems the information I'm talking about is not there.
Thanks in advance.
Hello ,
Im using carla 0.9.1 build version . And I need to do this pip2 install -e . --user --upgrade to get python API client in my workspace
But when i do that Im getting this error as shown below
source/libcarla/libcarla.cpp:7:26: fatal error: carla/Memory.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Any reason why this is happening?
Multi Client Support in Carla 0.9.x is incredibly useful feature and writing a ros_bridge for the it is also a huge task and I appreciate the efforts. I believe some things could be improved.
The actor_id in carla and child id in ros_bridge are different and they both changes everytime I relaunch my python script. This in turn changes my topic names and my frame_id everytime.
It is very difficult with current version of ros_bridge to rename the frame_id and topic names without hardcoding them and naming do not follow the ros conventions. (we should have args in launch file to set the names)
Only in the case of ego_vehicle the topic name remains same. But what if I don't want to control my vehicle with ros but with another client for example in scenario_runner for junction_crossing. I need to control two vehicle through python client and acquire the sensor data from both vehicle through ros.
All the TF transforms in carla 0.92 rosbridge are with respect to the /map
frame.
If we follow the robot TF setup guide for navigation stack in ros: link
Transforms for the sensors should actually be with respect to the vehicle (if it is attached to the vehicle while spawning in Carla).
Some of the standard codes in ros could not run because they are expecting TF base_link --> lidar
.
But through carla_ros_bridge we get /map--> /base_link
and /map --> lidar
. How to get the transform with respect to vehicle??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.