Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

366 examine how the driving score is computed #405

Merged
merged 5 commits into from
Nov 3, 2024

Conversation

seitzseb
Copy link
Collaborator

@seitzseb seitzseb commented Oct 31, 2024

Description

This change adds a file explaining the computation of the driving score.

Fixes #366

Type of change

  • This change is a documentation update

Does this PR introduce a breaking change?

No.

Most important changes

changes file /doc/research/paf24/general/driving_score.md

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (might be obsolete with CI later on)
  • New and existing unit tests pass locally with my changes (might be obsolete with CI later on)

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive overview of the "Driving Score" computation for evaluating driving proficiency in CARLA simulations.
    • Added detailed metrics and measurements related to driving performance, including route completion and infraction penalties.
    • Included a list of infractions ranked by severity with corresponding penalties.
    • Implemented a timeout mechanism for agents blocked indefinitely, affecting scoring.
  • Documentation

    • Enhanced the documentation with new sections and subsections covering various aspects of the driving score and agent behavior expectations, including off-road driving and additional events.

@seitzseb seitzseb linked an issue Oct 31, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

Walkthrough

The changes introduce a comprehensive overview of the "Driving Score" computation in the document driving_score.md. This includes the definition of the driving score, route completion metrics, infraction penalties, and a detailed list of infractions ranked by severity. New sections cover agent behavior expectations and scenarios affecting scoring, such as timeouts and off-road driving. The document serves as a foundational reference for understanding metrics used in the CARLA simulation environment.

Changes

File Path Change Summary
doc/research/paf24/general/driving_score.md Added new sections: Driving Score Computation, Metrics and Measurements, Driving Score, Route Completion, Infraction Penalty, Infractions, Off-road Driving, Additional Events, and Sources.

Assessment against linked issues

Objective Addressed Explanation
Examine how the Driving Score is computed (#366)

Possibly related PRs

Suggested reviewers

  • RoyaLxPole
  • victor-42

Poem

In the world of CARLA, we drive with glee,
A score for our journeys, as clear as can be.
With metrics and infractions, we learn and we grow,
Each route that we take, our skills will show!
Hop along, dear agents, let’s race through the night,
With scores shining bright, we’ll reach new heights! 🐰🚗✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
doc/research/paf24/general/driving_score.md (5)

1-4: Enhance the document summary.

Consider expanding the summary to include:

  • The purpose of this document (e.g., reference guide, technical specification)
  • The target audience (e.g., developers, researchers)
  • The relationship to the CARLA simulation environment

Example enhancement:

# Driving Score Computation

-**Summary:** The Driving score is the main performance metric of the agent and therefore has to be examined.
+**Summary:** This technical reference document explains how the Driving Score, the main performance metric for autonomous agents in the CARLA simulation environment, is computed. It serves as a comprehensive guide for developers and researchers to understand how agent performance is evaluated through route completion and various infractions.

21-23: Improve formula presentation and explanation.

The driving score formula could be better formatted and explained:

  1. Use display math mode for better readability
  2. Add a more detailed explanation of the variables

Suggested enhancement:

-\[\frac{1}{N}\sum^i_N R_i P_i\]
+\[
+\text{DrivingScore} = \frac{1}{N}\sum_{i=1}^N R_i P_i
+\]
+where:
+- $N$ is the total number of routes evaluated
+- $R_i$ is the completion percentage of route $i$ (between 0 and 1)
+- $P_i$ is the cumulative infraction penalty for route $i$ (between 0 and 1)

41-59: Standardize infraction penalties format and add measurement criteria.

Consider enhancing this section with:

  1. Consistent formatting for penalty values
  2. Specific criteria for each infraction
  3. Tabular format for better readability

Example enhancement:

| Infraction Type | Penalty Coefficient | Measurement Criteria |
|-----------------|:------------------:|---------------------|
| Collision with pedestrians | 0.50 | Any contact between agent and pedestrian |
| Collision with vehicles | 0.60 | Any contact between agent and other vehicles |
| Collision with static elements | 0.65 | Any contact with buildings, poles, etc. |
| Running red light | 0.70 | Crossing stop line while signal is red |
| Running stop sign | 0.80 | Failing to come to complete stop |
| Scenario timeout | 0.70 | Exceeding 4-minute time limit |
| Speed maintenance failure | 0.70 | Speed deviation from nearby traffic |
| Emergency vehicle yield failure | 0.70 | Not yielding within X seconds |
🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)


68-78: Enhance timeout explanations with examples.

Consider adding:

  1. Examples for each timeout scenario
  2. Explanation of the 0.8 factor in route timeout calculation
  3. Practical examples of route timeout calculations

Example addition:

For example, for a 1000-meter route:
- Maximum allowed time = 1000 * 0.8 = 800 seconds
- This allows for an average speed of 4.5 km/h (1.25 m/s)

79-82: Expand sources section with version information.

Consider enhancing the sources section with:

  1. Access dates for external links
  2. CARLA version number this documentation applies to
  3. Additional relevant documentation or research papers

Example format:

## Sources

- [Alpha Drive Carla Leaderboard Case Study](https://alphadrive.ai/industries/automotive/carla-leaderboard-case-study/) (accessed October 2024)
- [Carla Leaderboard](https://leaderboard.carla.org/) (CARLA version X.Y.Z)
- CARLA Documentation v0.9.13: Metrics and Evaluation
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8c968fb and fcb6783.

📒 Files selected for processing (1)
  • doc/research/paf24/general/driving_score.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
doc/research/paf24/general/driving_score.md

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)

🔇 Additional comments (1)
doc/research/paf24/general/driving_score.md (1)

62-65: Clarify off-road driving criteria.

The current description lacks specific details about:

  1. How "off-road" is defined (e.g., percentage of vehicle outside lane markings)
  2. How this percentage affects the route completion score
  3. Whether there's a tolerance threshold before penalties apply

Could you provide more specific details about these criteria?

Copy link
Contributor

@victor-42 victor-42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good, but please replace [ with $$ to display the formulas correctly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
doc/research/paf24/general/driving_score.md (4)

19-24: Enhance formula explanation for better readability.

Consider expanding the explanation to define variables more explicitly:

  • What is the expected range of values for $R_i$ (e.g., [0,1] or [0,100])?
  • Is $P_i$ always ≤ 1.0 since it's described as starting from an "ideal 1.0 base score"?

Would you like me to propose an expanded explanation that includes these details?


37-61: Consider adding context for penalty coefficients and timeout values.

To improve understanding:

  1. Add rationale for the chosen penalty coefficients (e.g., why is pedestrian collision 0.50 vs vehicle collision 0.60?)
  2. Explain why 4 minutes was chosen as the timeout threshold
  3. Consider adding examples of how multiple infractions compound using the geometric series formula
🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)


51-53: Simplify wording for clarity.

The current phrase "maintain a minimum speed in keeping with nearby traffic" could be simplified.

Consider this revision:

-The agent is expected to maintain a minimum speed in keeping with nearby traffic.
+The agent is expected to maintain a speed consistent with nearby traffic.
🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)


79-82: Consider expanding the sources section.

The current sources focus solely on CARLA-specific implementations. Consider adding:

  1. Academic references about autonomous driving metrics
  2. Industry standards or benchmarks for driving performance evaluation
  3. Links to related CARLA documentation about the simulation environment
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fcb6783 and d13de4e.

📒 Files selected for processing (1)
  • doc/research/paf24/general/driving_score.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
doc/research/paf24/general/driving_score.md

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)

🔇 Additional comments (3)
doc/research/paf24/general/driving_score.md (3)

1-13: LGTM! Well-structured document organization.

The table of contents is clear, comprehensive, and properly linked to all sections.


76-78: Clarify route timeout calculation.

The factor 0.8 used in route timeout calculation needs more context:

  1. What's the reasoning behind using 0.8 specifically?
  2. Does this mean the agent is expected to maintain an average speed of 1.25 m/s (1/0.8)?
  3. Consider adding an example calculation for better understanding.

1-82: Overall approval: Documentation meets objectives.

The document successfully fulfills its purpose of explaining the driving score computation, providing a comprehensive overview of all components and metrics. The mathematical formulas, penalty systems, and various scenarios are well-documented, making it a valuable reference for understanding the CARLA evaluation system.

🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘in keeping with’ might be wordy. Consider a shorter alternative.
Context: ...is expected to maintain a minimum speed in keeping with nearby traffic. The agent’s speed will ...

(EN_WORDINESS_PREMIUM_IN_KEEPING_WITH)

@seitzseb seitzseb merged commit cae64fd into main Nov 3, 2024
4 checks passed
@seitzseb seitzseb deleted the 366-examine-how-the-driving-score-is-computed branch November 3, 2024 09:27
@coderabbitai coderabbitai bot mentioned this pull request Nov 3, 2024
11 tasks
@seitzseb seitzseb added this to the Sprint 00 2024-11-04 milestone Nov 3, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 10, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examine how the Driving Score is computed
2 participants