Skip to content

Commit

Permalink
Add optional debug string to RealTrafficCar
Browse files Browse the repository at this point in the history
  • Loading branch information
pziecina committed May 27, 2020
1 parent 3474aad commit 01cc062
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion carla_real_traffic_scenarios/utils/carla.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import carla
from carla_real_traffic_scenarios.utils.collections import smallest_by
from carla_real_traffic_scenarios.utils.geometry import jaccard_rectangles
from carla_real_traffic_scenarios.utils.transforms import Transform
from carla_real_traffic_scenarios.utils.transforms import Transform, Vector3
from carla_real_traffic_scenarios.vehicles import VehicleModel, VEHICLES

LOGGER = logging.getLogger(__name__)
Expand All @@ -19,6 +19,7 @@ class RealTrafficVehicle(NamedTuple):
length_m: float
transform: Transform
speed: float
debug: Optional[str]


class RealTrafficVehiclesInCarla:
Expand Down Expand Up @@ -61,6 +62,10 @@ def step(self, vehicles):
)
self._vehicle_by_vehicle_id[real_vehicle.id] = carla_vehicle

if real_vehicle.debug:
self._world.debug.draw_string((target_transform.position + Vector3(2, 0, 4)).as_carla_location(),
str(real_vehicle.debug))

now_vehicle_ids = {v.id for v in vehicles}
previous_vehicles_ids = set(self._vehicle_by_vehicle_id.keys())

Expand Down

0 comments on commit 01cc062

Please sign in to comment.