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.

Implementation:CARLA simulator Carla Python AdRss Bindings

From Leeroopedia
Revision as of 12:14, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/CARLA_simulator_Carla_Python_AdRss_Bindings.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Python Bindings, Safety Systems
Last Updated 2026-02-15 05:00 GMT

Overview

Boost.Python binding file that exposes the Intel Ad-RSS (Responsibility-Sensitive Safety) library integration classes to the CARLA Python API.

Description

This file defines export_ad() and export_ad_rss() functions that register the RSS safety system classes with Boost.Python. The export_ad() function initializes the ad namespace submodule and imports the ad_physics, ad_map_access, ad_rss, and ad_rss_map_integration Python bindings. The export_ad_rss() function exposes key classes including RssEgoDynamicsOnRoute (ego vehicle dynamics such as speed, heading, acceleration), RssActorConstellationResult and RssActorConstellationData for per-actor RSS configuration, RssResponse for RSS check results, RssSensor with properties for ego/other vehicle/pedestrian dynamics and routing targets, RssRestrictor for applying RSS-safe control restrictions, and enumerations for RssLogLevel and RssRoadBoundariesMode. Helper functions manage GIL-safe callback registration for actor constellation callbacks.

Usage

This binding is conditionally compiled when LIBCARLA_RSS_ENABLED is defined. It allows Python scripts to attach an RSS sensor to a vehicle, configure RSS dynamics parameters, register actor constellation callbacks, and restrict vehicle controls based on RSS safety checks.

Code Reference

Source Location

  • Repository: CARLA
  • File: PythonAPI/carla/src/AdRss.cpp

Signature

void export_ad();
void export_ad_rss();

// Key classes exposed:
class_<carla::rss::EgoDynamicsOnRoute>("RssEgoDynamicsOnRoute")
class_<carla::rss::ActorConstellationResult>("RssActorConstellationResult")
class_<carla::rss::ActorConstellationData>("RssActorConstellationData", no_init)
class_<csd::RssResponse, bases<cs::SensorData>>("RssResponse", no_init)
class_<cc::RssSensor, bases<cc::Sensor>>("RssSensor", no_init)
class_<carla::rss::RssRestrictor>("RssRestrictor")

Import

import carla
# RssSensor is attached via the blueprint system
rss_sensor = world.spawn_actor(rss_bp, transform, attach_to=vehicle)

I/O Contract

Inputs

Name Type Required Description
callback callable Yes (for register_actor_constellation_callback) Python callable for per-actor RSS configuration
routing_target carla.Transform Yes (for append_routing_target) Target transform for RSS route planning
log_level RssLogLevel Yes (for set_log_level) Logging verbosity level
vehicle_control carla.VehicleControl Yes (for restrict_vehicle_control) Control to be restricted by RSS
proper_response ad.rss.ProperResponse Yes (for restrict_vehicle_control) RSS proper response object

Outputs

Name Type Description
ego_vehicle_dynamics ad.rss.world.RssDynamics RSS dynamics parameters for ego vehicle
response_valid bool Whether the RSS response check is valid
proper_response ad.rss.ProperResponse RSS computed proper response
ego_dynamics_on_route RssEgoDynamicsOnRoute Ego dynamics relative to planned route

Usage Examples

import carla

client = carla.Client('localhost', 2000)
world = client.get_world()

# Spawn RSS sensor attached to ego vehicle
rss_bp = world.get_blueprint_library().find('sensor.other.rss')
rss_sensor = world.spawn_actor(rss_bp, carla.Transform(), attach_to=ego_vehicle)

# Configure dynamics
rss_sensor.ego_vehicle_dynamics = ego_dynamics
rss_sensor.road_boundaries_mode = carla.RssRoadBoundariesMode.On

# Listen for RSS responses
rss_sensor.listen(lambda rss_response: process_rss(rss_response))

Related Pages

Page Connections

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