diff --git a/carla_ros_bridge/src/carla_ros_bridge/bridge.py b/carla_ros_bridge/src/carla_ros_bridge/bridge.py index 9e34f499..4fdd825e 100755 --- a/carla_ros_bridge/src/carla_ros_bridge/bridge.py +++ b/carla_ros_bridge/src/carla_ros_bridge/bridge.py @@ -427,19 +427,19 @@ def main(args=None): carla_world = carla_client.get_world() - if "town" in parameters and not parameters['passive']: - if parameters["town"].endswith(".xodr"): - carla_bridge.loginfo( - "Loading opendrive world from file '{}'".format(parameters["town"])) - with open(parameters["town"]) as od_file: - data = od_file.read() - carla_world = carla_client.generate_opendrive_world(str(data)) - else: - if carla_world.get_map().name != parameters["town"]: - carla_bridge.loginfo("Loading town '{}' (previous: '{}').".format( - parameters["town"], carla_world.get_map().name)) - carla_world = carla_client.load_world(parameters["town"]) - carla_world.tick() +# if "town" in parameters and not parameters['passive']: +# if parameters["town"].endswith(".xodr"): +# carla_bridge.loginfo( +# "Loading opendrive world from file '{}'".format(parameters["town"])) +# with open(parameters["town"]) as od_file: +# data = od_file.read() +# carla_world = carla_client.generate_opendrive_world(str(data)) +# else: +# if carla_world.get_map().name != parameters["town"]: +# carla_bridge.loginfo("Loading town '{}' (previous: '{}').".format( +# parameters["town"], carla_world.get_map().name)) +# carla_world = carla_client.load_world(parameters["town"]) +# carla_world.tick() carla_bridge.initialize_bridge(carla_client.get_world(), parameters) diff --git a/carla_spawn_objects/config/objects.json b/carla_spawn_objects/config/objects.json index daba209d..aaba5818 100644 --- a/carla_spawn_objects/config/objects.json +++ b/carla_spawn_objects/config/objects.json @@ -52,65 +52,15 @@ { "type": "sensor.lidar.ray_cast", "id": "lidar", - "spawn_point": {"x": 0.0, "y": 0.0, "z": 2.4, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "spawn_point": {"x": 0.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, "range": 50, - "channels": 32, - "points_per_second": 320000, + "channels": 128, + "points_per_second": 281600, "upper_fov": 2.0, "lower_fov": -26.8, "rotation_frequency": 20, "noise_stddev": 0.0 }, - { - "type": "sensor.lidar.ray_cast_semantic", - "id": "semantic_lidar", - "spawn_point": {"x": 0.0, "y": 0.0, "z": 2.4, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, - "range": 50, - "channels": 32, - "points_per_second": 320000, - "upper_fov": 2.0, - "lower_fov": -26.8, - "rotation_frequency": 20 - }, - { - "type": "sensor.other.radar", - "id": "radar_front", - "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, - "horizontal_fov": 30.0, - "vertical_fov": 10.0, - "points_per_second": 1500, - "range": 100.0 - }, - { - "type": "sensor.camera.semantic_segmentation", - "id": "semantic_segmentation_front", - "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, - "fov": 90.0, - "image_size_x": 400, - "image_size_y": 70 - }, - { - "type": "sensor.camera.depth", - "id": "depth_front", - "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, - "fov": 90.0, - "image_size_x": 400, - "image_size_y": 70 - }, - { - "type": "sensor.camera.dvs", - "id": "dvs_front", - "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, - "fov": 90.0, - "image_size_x": 400, - "image_size_y": 70, - "positive_threshold": 0.3, - "negative_threshold": 0.3, - "sigma_positive_threshold": 0.0, - "sigma_negative_threshold": 0.0, - "use_log": true, - "log_eps": 0.001 - }, { "type": "sensor.other.gnss", "id": "gnss", @@ -136,7 +86,7 @@ "id": "lane_invasion", "spawn_point": {"x": 0.0, "y": 0.0, "z": 0.0} }, - { + { "type": "sensor.pseudo.tf", "id": "tf" }, diff --git a/carla_spawn_objects/config/objects.json.bak b/carla_spawn_objects/config/objects.json.bak new file mode 100644 index 00000000..daba209d --- /dev/null +++ b/carla_spawn_objects/config/objects.json.bak @@ -0,0 +1,162 @@ +{ + "objects": + [ + { + "type": "sensor.pseudo.traffic_lights", + "id": "traffic_lights" + }, + { + "type": "sensor.pseudo.objects", + "id": "objects" + }, + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "sensor.pseudo.markers", + "id": "markers" + }, + { + "type": "sensor.pseudo.opendrive_map", + "id": "map" + }, + { + "type": "vehicle.tesla.model3", + "id": "ego_vehicle", + "sensors": + [ + { + "type": "sensor.camera.rgb", + "id": "rgb_front", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "image_size_x": 800, + "image_size_y": 600, + "fov": 90.0 + }, + { + "type": "sensor.camera.rgb", + "id": "rgb_view", + "spawn_point": {"x": -4.5, "y": 0.0, "z": 2.8, "roll": 0.0, "pitch": 20.0, "yaw": 0.0}, + "image_size_x": 800, + "image_size_y": 600, + "fov": 90.0, + "attached_objects": + [ + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + }, + { + "type": "sensor.lidar.ray_cast", + "id": "lidar", + "spawn_point": {"x": 0.0, "y": 0.0, "z": 2.4, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "range": 50, + "channels": 32, + "points_per_second": 320000, + "upper_fov": 2.0, + "lower_fov": -26.8, + "rotation_frequency": 20, + "noise_stddev": 0.0 + }, + { + "type": "sensor.lidar.ray_cast_semantic", + "id": "semantic_lidar", + "spawn_point": {"x": 0.0, "y": 0.0, "z": 2.4, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "range": 50, + "channels": 32, + "points_per_second": 320000, + "upper_fov": 2.0, + "lower_fov": -26.8, + "rotation_frequency": 20 + }, + { + "type": "sensor.other.radar", + "id": "radar_front", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "horizontal_fov": 30.0, + "vertical_fov": 10.0, + "points_per_second": 1500, + "range": 100.0 + }, + { + "type": "sensor.camera.semantic_segmentation", + "id": "semantic_segmentation_front", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "fov": 90.0, + "image_size_x": 400, + "image_size_y": 70 + }, + { + "type": "sensor.camera.depth", + "id": "depth_front", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "fov": 90.0, + "image_size_x": 400, + "image_size_y": 70 + }, + { + "type": "sensor.camera.dvs", + "id": "dvs_front", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "fov": 90.0, + "image_size_x": 400, + "image_size_y": 70, + "positive_threshold": 0.3, + "negative_threshold": 0.3, + "sigma_positive_threshold": 0.0, + "sigma_negative_threshold": 0.0, + "use_log": true, + "log_eps": 0.001 + }, + { + "type": "sensor.other.gnss", + "id": "gnss", + "spawn_point": {"x": 1.0, "y": 0.0, "z": 2.0}, + "noise_alt_stddev": 0.0, "noise_lat_stddev": 0.0, "noise_lon_stddev": 0.0, + "noise_alt_bias": 0.0, "noise_lat_bias": 0.0, "noise_lon_bias": 0.0 + }, + { + "type": "sensor.other.imu", + "id": "imu", + "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0}, + "noise_accel_stddev_x": 0.0, "noise_accel_stddev_y": 0.0, "noise_accel_stddev_z": 0.0, + "noise_gyro_stddev_x": 0.0, "noise_gyro_stddev_y": 0.0, "noise_gyro_stddev_z": 0.0, + "noise_gyro_bias_x": 0.0, "noise_gyro_bias_y": 0.0, "noise_gyro_bias_z": 0.0 + }, + { + "type": "sensor.other.collision", + "id": "collision", + "spawn_point": {"x": 0.0, "y": 0.0, "z": 0.0} + }, + { + "type": "sensor.other.lane_invasion", + "id": "lane_invasion", + "spawn_point": {"x": 0.0, "y": 0.0, "z": 0.0} + }, + { + "type": "sensor.pseudo.tf", + "id": "tf" + }, + { + "type": "sensor.pseudo.objects", + "id": "objects" + }, + { + "type": "sensor.pseudo.odom", + "id": "odometry" + }, + { + "type": "sensor.pseudo.speedometer", + "id": "speedometer" + }, + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + } + ] +} diff --git a/carla_spawn_objects/launch/carla_example_ego_vehicle.launch.py b/carla_spawn_objects/launch/carla_example_ego_vehicle.launch.py index ee24a672..cb948335 100644 --- a/carla_spawn_objects/launch/carla_example_ego_vehicle.launch.py +++ b/carla_spawn_objects/launch/carla_example_ego_vehicle.launch.py @@ -38,16 +38,16 @@ def generate_launch_description(): 'spawn_sensors_only': launch.substitutions.LaunchConfiguration('spawn_sensors_only') }.items() ), - launch.actions.IncludeLaunchDescription( - launch.launch_description_sources.PythonLaunchDescriptionSource( - os.path.join(get_package_share_directory( - 'carla_spawn_objects'), 'set_initial_pose.launch.py') - ), - launch_arguments={ - 'role_name': launch.substitutions.LaunchConfiguration('role_name'), - 'control_id': launch.substitutions.LaunchConfiguration('control_id') - }.items() - ) +# launch.actions.IncludeLaunchDescription( +# launch.launch_description_sources.PythonLaunchDescriptionSource( +# os.path.join(get_package_share_directory( +# 'carla_spawn_objects'), 'set_initial_pose.launch.py') +# ), +# launch_arguments={ +# 'role_name': launch.substitutions.LaunchConfiguration('role_name'), +# 'control_id': launch.substitutions.LaunchConfiguration('control_id') +# }.items() +# ) ]) return ld