class_docstr: BridgeHelper provides methos to ease the co-simulation between sumo and carla.
class_docstr_tok: ["BridgeHelper","provides","methos","to","ease","the","co-simulation","between","sumo","and","carla","."]
docstr: Returns carla transform based on sumo transform.
docstr_tok: ["Returns","carla","transform","based","on","sumo","transform","."]
code: def get_carla_transform(in_sumo_transform, extent):
      """
      Returns carla transform based on sumo transform.
      """
      offset = BridgeHelper.offset
      in_location = in_sumo_transform.location
      in_rotation = in_sumo_transform.rotation
  
      # From front-center-bumper to center (sumo reference system).
      # (http://sumo.sourceforge.net/userdoc/Purgatory/Vehicle_Values.html#angle)
      yaw = -1 * in_rotation.yaw + 90
      pitch = in_rotation.pitch
      out_location = (
          in_location.x - math.cos(math.radians(yaw)) * extent.x,
          in_location.y - math.sin(math.radians(yaw)) * extent.x,
          in_location.z - math.sin(math.radians(pitch)) * extent.x,
      )
      out_rotation = (
          in_rotation.pitch,
          in_rotation.yaw,
          in_rotation.roll,
      )
  
      # Applying offset sumo-carla net.
      out_location = (
          out_location[0] - offset[0],
          out_location[1] - offset[1],
          out_location[2],
      )
  
      # Transform to carla reference system (left-handed system).
      out_transform = carla.Transform(
          carla.Location(
              out_location[0], -out_location[1], out_location[2]
          ),
          carla.Rotation(
              out_rotation[0], out_rotation[1] - 90, out_rotation[2]
          ),
      )
  
      return out_transform
  
file_path: carla/Co-Simulation/Sumo/sumo_integration/bridge_helper.py
imports: import json
  import logging
  import math
  import os
  import random
  import carla
  import traci
  from .sumo_simulation import SumoSignalState, SumoVehSignal
label_desc: Use image node_id 1 for calling the BridgeHelper obj's underlying member method code with example usage: obj.get_carla_transform(in_sumo_transform, extent) and returns: out_transform