Skip to content

Commit

Permalink
Merge pull request #410 from carla-simulator/fix_lidar_noetic
Browse files Browse the repository at this point in the history
Fix lidar parsing in noetic
  • Loading branch information
joel-mb committed Nov 2, 2020
2 parents 9311dd8 + 5e9802a commit 0700f2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions carla_ros_bridge/src/carla_ros_bridge/lidar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
<CARLA_DIR>/PythonAPI/carla/dist/carla-<CARLA_VERSION>-\
py<PYTHON_VERSION>-linux-x86_64.egg to your PYTHONPATH."
py<PYTHON_VERSION>-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 <CARLA_DIR>/PythonAPI/carla to your PYTHONPATH."
print("ERROR: CARLA Python Agents not available. \
Please add <CARLA_DIR>/PythonAPI/carla to your PYTHONPATH.")
sys.exit(1)


Expand Down

0 comments on commit 0700f2d

Please sign in to comment.