Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:CARLA simulator Carla Sensor Attachment

From Leeroopedia
Knowledge Sources
Domains Autonomous Driving Simulation, Robotics Perception
Last Updated 2026-02-15 00:00 GMT

Overview

Sensor attachment is the process of mounting a virtual sensor onto a parent actor through a parent-child hierarchy, ensuring the sensor moves with its host and produces data from the correct vantage point.

Description

Autonomous vehicles perceive the world through an array of sensors: cameras, LiDAR, radar, GNSS, IMU, and more. In simulation, these sensors are modeled as actors that must be attached to the vehicle they instrument. The attachment creates a parent-child relationship where:

  • The sensor's transform is specified relative to the parent actor's local coordinate frame.
  • When the parent moves, the sensor moves with it automatically.
  • The sensor captures data from its world-space position, which is the composition of the parent's transform and the sensor's relative offset.

Attachment types control the mechanical relationship between parent and child:

  • Rigid attachment locks the sensor to the parent with zero degrees of freedom. The sensor perfectly tracks every movement of the parent, including sudden accelerations and collisions. This is the standard mode for most sensor setups.
  • SpringArm attachment connects the sensor through a virtual spring-damper mechanism. The sensor follows the parent but with smoothed motion, similar to a third-person camera in video games. This is primarily used for spectator cameras, not for sensor data collection where accurate positioning matters.
  • SpringArmGhost attachment is similar to SpringArm but the arm does not collide with world geometry, allowing it to pass through walls. This is useful for cinematic camera placements.

The relative transform defines the sensor's mounting position in the parent's local frame. Common mounting positions include the vehicle roof (for LiDAR), behind the windshield (for forward camera), side mirrors (for lateral cameras), and the front bumper (for radar).

Usage

Use sensor attachment whenever you need to:

  • Instrument an ego vehicle -- Mount the full sensor suite (cameras, LiDAR, radar, GNSS, IMU) onto the autonomous vehicle.
  • Create multi-camera rigs -- Attach multiple cameras at different positions and orientations for surround-view perception.
  • Build spectator views -- Attach a follow camera using SpringArm for visualization purposes.
  • Instrument NPC vehicles -- Attach sensors to other vehicles for data collection from diverse viewpoints.

Theoretical Basis

Parent-child transform composition:

sensor_world_transform = parent_world_transform * sensor_relative_transform

Where:
  parent_world_transform = Transform(parent_location, parent_rotation)
  sensor_relative_transform = Transform(offset_location, offset_rotation)

Common sensor mounting positions (relative to vehicle center):

Sensor Location (x, y, z) Rotation (pitch, yaw, roll) Notes
Front camera (2.0, 0.0, 1.4) (0, 0, 0) Behind windshield, forward-facing
Roof LiDAR (0.0, 0.0, 2.4) (0, 0, 0) Centered on roof, level
Left camera (0.0, -0.5, 1.4) (0, -90, 0) Left side, facing left
Right camera (0.0, 0.5, 1.4) (0, 90, 0) Right side, facing right
Rear camera (-2.0, 0.0, 1.4) (0, 180, 0) Rear bumper, facing backward
Front radar (2.2, 0.0, 0.5) (0, 0, 0) Front bumper, low mount
GNSS (0.0, 0.0, 2.4) (0, 0, 0) Roof-mounted
IMU (0.0, 0.0, 0.0) (0, 0, 0) Vehicle center of mass

Attachment type behavior:

Rigid:
  sensor_position(t) = parent_position(t) + rotate(offset, parent_rotation(t))
  -- Instantaneous, no lag

SpringArm:
  target(t) = parent_position(t) + rotate(offset, parent_rotation(t))
  sensor_position(t) = lerp(sensor_position(t-1), target(t), damping)
  -- Smooth following with configurable damping
  -- Arm collides with geometry (retracts to avoid clipping)

SpringArmGhost:
  -- Same as SpringArm but arm passes through geometry

Data flow after attachment:

[Vehicle Moves] --> [Sensor Position Updates] --> [Sensor Captures Data]
                                                       |
                                                  [Callback Fires]
                                                       |
                                                  [Client Receives Data]

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment