Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(launch): add default map [Town05] #739

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<arg name="spawn_point" default=""/><!-- use comma separated format "x,y,z,roll,pitch,yaw" -->

<!-- Map to load on startup (either a predefined CARLA town (e.g. 'Town01'), or a OpenDRIVE map file) -->
<arg name="town" default=''/>
<arg name="town" default='Town05'/>

<!-- Enable/disable passive mode -->
<arg name='passive' default=''/>
Expand Down
7 changes: 3 additions & 4 deletions carla_ros_bridge/src/carla_ros_bridge/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
except ImportError:
import Queue as queue
import sys
from distutils.version import LooseVersion
from packaging.version import Version
from threading import Thread, Lock, Event

import carla
Expand Down Expand Up @@ -413,13 +413,12 @@ def main(args=None):

# check carla version
dist = pkg_resources.get_distribution("carla")
if LooseVersion(dist.version) != LooseVersion(CarlaRosBridge.CARLA_VERSION):
if Version(dist.version).release[0] != Version(CarlaRosBridge.CARLA_VERSION).release[0]:
carla_bridge.logfatal("CARLA python module version {} required. Found: {}".format(
CarlaRosBridge.CARLA_VERSION, dist.version))
sys.exit(1)

if LooseVersion(carla_client.get_server_version()) != \
LooseVersion(carla_client.get_client_version()):
if Version(carla_client.get_server_version()) != Version(carla_client.get_client_version()):
carla_bridge.logwarn(
"Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API. Client API version: {}. Simulator API version: {}"
.format(carla_client.get_client_version(),
Expand Down
11 changes: 6 additions & 5 deletions carla_ros_bridge/src/carla_ros_bridge/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,15 @@ def sensor_data_updated(self, carla_sensor_data):
"This function has to be implemented by the derived classes")

def _update_synchronous_event_sensor(self, frame, timestamp):
buffer_size = 5
while True:
try:
carla_sensor_data = self.queue.get(block=False)
if carla_sensor_data.frame != frame:
self.node.logwarn("{}({}): Received event for frame {}"
" (expected {}). Process it anyways.".format(
self.__class__.__name__, self.get_id(),
carla_sensor_data.frame, frame))
frame_difference = abs(carla_sensor_data.frame - frame)
if frame_difference > buffer_size:
self.node.logwarn("{}({}): Received event for frame {} (expected {}). Process it anyways.".format(
self.__class__.__name__, self.get_id(),
carla_sensor_data.frame, frame))
self.node.logdebug("{}({}): process {}".format(
self.__class__.__name__, self.get_id(), frame))
self.publish_tf(trans.carla_transform_to_ros_pose(
Expand Down