Skip to content

Proposal for Introducing a Reactive Agent #1595

@takanotaiga

Description

@takanotaiga

Overview

Currently, NPCs in the scenario_simulator lack the ability to dynamically avoid surrounding objects. For example, when a pedestrian NPC walks on the road and notices a vehicle ahead, it cannot stop and may collide with it.

In this proposal, I suggest integrating the ORCA (Optimal Reciprocal Collision Avoidance) algorithm into the NPC movement logic to enable dynamic obstacle avoidance. I first created a new plugin and conducted functional tests.

  1. Pedestrian–Vehicle Avoidance Scenario at a Crosswalk

    • With ORCA applied, the pedestrian NPC recognizes vehicles on the crosswalk and safely navigates around them to complete the crossing.
    • In the default scenario_simulator, the pedestrian NPC overlaps with the vehicle and results in a collision.
parked_at_crosswalk.mov
  1. Two Pairs (Four Pedestrians) Crossing Scenario

    • Enabling ORCA’s reciprocal avoidance feature allows pedestrians to cross smoothly without colliding with one another.
head_on_pedestrian.mov

The results confirm that extending NPC avoidance capabilities yields more realistic and safer simulated behaviors.

Implementation Details

The ORCA algorithm used here is designed for multiple moving agents to consider each other’s trajectories and avoid collisions, implemented based on the following paper:

I do not use ORCA to determine NPC waypoints. Instead, I continue to leverage existing route-following mechanisms such as follow_lane_action. ORCA is applied only to avoid other agents or obstacles that appear along the planned path, preserving compatibility with the current system while enhancing safety.

Internal Demand

Introducing this feature is expected to address the following in-house needs:

  • Improved Test Accuracy: NPCs that exhibit realistic behavior will enable more reliable scenario testing.
  • Reduction of Unrealistic Collisions: Suppresses unnatural collision detections that formerly arose.
  • Efficiency in Generating Training Data: Automating near-real-world behavior reduces annotation effort.

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions