class_docstr: BridgeHelper provides methos to ease the co-simulation between vissim and carla.
class_docstr_tok: ["BridgeHelper","provides","methos","to","ease","the","co-simulation","between","vissim","and","carla","."]
docstr: Returns vissim transform based on carla transform.
docstr_tok: ["Returns","vissim","transform","based","on","carla","transform","."]
code: def get_vissim_transform(in_carla_transform, extent=None):
      """
      Returns vissim transform based on carla transform.
      """
      in_location = in_carla_transform.location
      in_rotation = in_carla_transform.rotation
  
      # From center to front-center-bumper (carla reference system).
      if extent is not None:
          yaw = -1 * in_rotation.yaw
          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,
          )
      else:
          out_location = (in_location.x, in_location.y, in_location.z)
      out_rotation = (
          in_rotation.pitch,
          in_rotation.yaw,
          in_rotation.roll,
      )
  
      # Transform to vissim reference system (right-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], out_rotation[2]
          ),
      )
  
      return out_transform
  
file_path: carla/Co-Simulation/PTV-Vissim/vissim_integration/bridge_helper.py
imports: import logging
  import math
  import random
  import carla
label_desc: Use image node_id 2 for calling the BridgeHelper obj's underlying member method code with example usage: obj.get_vissim_transform(in_carla_transform, extent) and returns: out_transform