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 RssCheck: Difference between revisions

From Leeroopedia
Auto-imported from implementations/CARLA_simulator_Carla_RssCheck.md
 
Sync from local file
 
Line 150: Line 150:


* [[requires_env::Environment:CARLA_simulator_Carla_Simulation_Runtime]]
* [[requires_env::Environment:CARLA_simulator_Carla_Simulation_Runtime]]
* [[CARLA_simulator_Carla_RssCheck_Interface]] - Header file and class interface definition
* [[Implementation:CARLA_simulator_Carla_RssCheck_Interface]] - Header file and class interface definition
* [[CARLA_simulator_Carla_RssSensor]] - Sensor that drives the RssCheck lifecycle
* [[Implementation:CARLA_simulator_Carla_RssSensor]] - Sensor that drives the RssCheck lifecycle
* [[CARLA_simulator_Carla_Vehicle_Class]] - Vehicle class used as ego actor
* [[Implementation:CARLA_simulator_Carla_Vehicle_Class]] - Vehicle class used as ego actor


[[Category:Implementations]]
[[Category:Implementations]]

Latest revision as of 10:34, 27 September 2026

Knowledge Sources
Domains Safety, RSS, Autonomous Driving
Last Updated 2026-02-15 05:00 GMT

Overview

RssCheck is the core implementation of Responsibility-Sensitive Safety (RSS) checks for the CARLA simulator, performing safety evaluations of ego vehicle dynamics against other actors in the simulation environment.

Description

The RssCheck class implements the actual RSS checks based on the CARLA world description. It integrates with the ad-rss-lib (Intel's RSS library) and ad-map-access to perform map-based safety analysis. The implementation provides:

  • Default vehicle dynamics configuration for ego vehicles, other vehicles, and pedestrians, including longitudinal/lateral acceleration limits, braking parameters, response times, and unstructured settings.
  • Actor constellation callbacks that allow per-frame, per-actor configuration of RSS calculation modes and dynamics parameters.
  • Route management including routing targets, road boundary enforcement, and route dropping for random rerouting.
  • Ego dynamics computation on the current route, decomposing velocity and acceleration into lateral and longitudinal components relative to the route.
  • RSS world model creation by matching actors to the HD map and creating RSS scenes via RssSceneCreation.
  • Multi-threaded object checking via the inner RssObjectChecker class, optionally leveraging TBB for parallel processing.

Key supporting structures include EgoDynamicsOnRoute (ego vehicle state relative to the route), ActorConstellationResult (RSS configuration per actor), and ActorConstellationData (map-matched information for ego and other actors).

Usage

Use RssCheck when integrating RSS safety monitoring into autonomous driving scenarios within CARLA. It is typically instantiated and invoked by the RssSensor which calls CheckObjects each simulation tick. The class can be configured with custom actor constellation callbacks for fine-grained control over RSS parameters per actor.

Code Reference

Source Location

  • Repository: CARLA
  • File: LibCarla/source/carla/rss/RssCheck.cpp (1017 lines)

Signature

namespace carla {
namespace rss {

class RssCheck {
public:
  using ActorConstellationCallbackFunctionType =
      std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr<ActorConstellationData>)>;

  RssCheck(float max_steering_angle);
  RssCheck(float max_steering_angle, ActorConstellationCallbackFunctionType rss_actor_constellation_callback,
           carla::SharedPtr<carla::client::Actor> const &carla_ego_actor);
  ~RssCheck();

  bool CheckObjects(carla::client::Timestamp const &timestamp,
                    carla::SharedPtr<carla::client::ActorList> const &actors,
                    carla::SharedPtr<carla::client::Actor> const &carla_ego_actor,
                    ::ad::rss::state::ProperResponse &output_response,
                    ::ad::rss::state::RssStateSnapshot &output_rss_state_snapshot,
                    ::ad::rss::situation::SituationSnapshot &output_situation_snapshot,
                    ::ad::rss::world::WorldModel &output_world_model,
                    EgoDynamicsOnRoute &output_rss_ego_dynamics_on_route);

  static ::ad::rss::world::RssDynamics GetDefaultVehicleDynamics();
  static ::ad::rss::world::RssDynamics GetDefaultPedestrianDynamics();
  static RoadBoundariesMode GetDefaultRoadBoundariesMode();

  void SetLogLevel(const spdlog::level::level_enum &log_level);
  void SetMapLogLevel(const spdlog::level::level_enum &map_log_level);
  const ::carla::rss::RoadBoundariesMode &GetRoadBoundariesMode() const;
  void SetRoadBoundariesMode(const ::carla::rss::RoadBoundariesMode &road_boundaries_mode);
  void AppendRoutingTarget(const ::carla::geom::Transform &routing_target);
  void ResetRoutingTargets();
  void DropRoute();
};

} // namespace rss
} // namespace carla

Import

#include "carla/rss/RssCheck.h"

I/O Contract

Inputs

Name Type Required Description
max_steering_angle float Yes Maximum steering angle of the ego vehicle in radians
timestamp carla::client::Timestamp Yes Current simulation timestamp for the RSS check
actors SharedPtr<ActorList> Yes List of all actors in the current simulation world
carla_ego_actor SharedPtr<Actor> Yes The ego vehicle actor to evaluate RSS for
rss_actor_constellation_callback ActorConstellationCallbackFunctionType No Optional callback for per-actor RSS configuration

Outputs

Name Type Description
output_response ad::rss::state::ProperResponse The proper RSS response indicating safe actions
output_rss_state_snapshot ad::rss::state::RssStateSnapshot Snapshot of all RSS states for all actor pairs
output_situation_snapshot ad::rss::situation::SituationSnapshot Snapshot of all RSS situations
output_world_model ad::rss::world::WorldModel The RSS world model used for the check
output_rss_ego_dynamics_on_route EgoDynamicsOnRoute Ego vehicle dynamics decomposed along the route
return bool True if the RSS check was performed successfully

Usage Examples

// Create RssCheck with default constellation callback
carla::rss::RssCheck rss_check(max_steering_angle);

// Configure road boundaries mode
rss_check.SetRoadBoundariesMode(carla::rss::RoadBoundariesMode::On);

// Add routing targets
rss_check.AppendRoutingTarget(target_transform);

// Perform RSS check
ad::rss::state::ProperResponse response;
ad::rss::state::RssStateSnapshot rss_state_snapshot;
ad::rss::situation::SituationSnapshot situation_snapshot;
ad::rss::world::WorldModel world_model;
carla::rss::EgoDynamicsOnRoute ego_dynamics;

bool success = rss_check.CheckObjects(
    timestamp, actors, ego_actor,
    response, rss_state_snapshot, situation_snapshot,
    world_model, ego_dynamics);

Related Pages