From 5e9802a80333f4128f6201d79fcb5d6b33f66537 Mon Sep 17 00:00:00 2001 From: "Pasch, Frederik" Date: Mon, 2 Nov 2020 17:37:10 +0100 Subject: [PATCH] Fix lidar parsing in noetic --- carla_ros_bridge/src/carla_ros_bridge/lidar.py | 4 ++-- .../carla_ros_scenario_runner.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/carla_ros_bridge/src/carla_ros_bridge/lidar.py b/carla_ros_bridge/src/carla_ros_bridge/lidar.py index d5ee9a29..7d50e326 100644 --- a/carla_ros_bridge/src/carla_ros_bridge/lidar.py +++ b/carla_ros_bridge/src/carla_ros_bridge/lidar.py @@ -66,7 +66,7 @@ def sensor_data_updated(self, carla_lidar_measurement): ] lidar_data = numpy.fromstring( - carla_lidar_measurement.raw_data, dtype=numpy.float32) + bytes(carla_lidar_measurement.raw_data), dtype=numpy.float32) lidar_data = numpy.reshape( lidar_data, (int(lidar_data.shape[0] / 4), 4)) # we take the oposite of y axis @@ -123,7 +123,7 @@ def sensor_data_updated(self, carla_lidar_measurement): PointField('ObjTag', 20, PointField.UINT32, 1), ] - lidar_data = numpy.fromstring(carla_lidar_measurement.raw_data, + lidar_data = numpy.fromstring(bytes(carla_lidar_measurement.raw_data), dtype=numpy.dtype([ ('x', numpy.float32), ('y', numpy.float32), diff --git a/carla_ros_scenario_runner/src/carla_ros_scenario_runner/carla_ros_scenario_runner.py b/carla_ros_scenario_runner/src/carla_ros_scenario_runner/carla_ros_scenario_runner.py index a23e83d6..bd4821c3 100755 --- a/carla_ros_scenario_runner/src/carla_ros_scenario_runner/carla_ros_scenario_runner.py +++ b/carla_ros_scenario_runner/src/carla_ros_scenario_runner/carla_ros_scenario_runner.py @@ -26,16 +26,16 @@ try: import carla # pylint: disable=unused-import except ImportError: - print "ERROR: CARLA Python Egg not available. Please add \ + print("ERROR: CARLA Python Egg not available. Please add \ /PythonAPI/carla/dist/carla--\ - py-linux-x86_64.egg to your PYTHONPATH." + py-linux-x86_64.egg to your PYTHONPATH.") sys.exit(1) try: from agents.navigation.local_planner import LocalPlanner # pylint: disable=unused-import except ImportError: - print "ERROR: CARLA Python Agents not available. \ - Please add /PythonAPI/carla to your PYTHONPATH." + print("ERROR: CARLA Python Agents not available. \ + Please add /PythonAPI/carla to your PYTHONPATH.") sys.exit(1)