idsc-frazzoli / dg-commons

Driving games common tools
GNU General Public License v3.0
24 stars 6 forks source link

add eval functions #124

Open ysli16 opened 1 month ago

ysli16 commented 1 month ago

Add common functions to evaluate the performance of ego vehicle in the simulation. For safety, the functions to find the minimum distance, minimum time-to-collision(ttc) and maximum deceleration-rate-to-avoid-collision(drac) are implemented. The vehicle geometry is considered in the computation. For efficiency, the function to find the first time that the ego vehicle entered its desired lane is implemented. It only checks whether the vehicle enters the goal lane(or its predecessor/successor), regardless of the progress on the lane. For comfort, the max jerk and the rms of frequency-weighted acceleration(according to ISO2631) is computed.

This will be merged after tested locally for the pdm4ar exercise.

alezana commented 1 month ago

@ysli16 could you please

alezana commented 1 month ago

Other suggestions from looking at the code:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 84.37500% with 40 lines in your changes missing coverage. Please review.

Project coverage is 80.22%. Comparing base (c217817) to head (330ec2c).

Files with missing lines Patch % Lines
src/dg_commons/eval/efficiency.py 62.66% 19 Missing and 9 partials :warning:
src/dg_commons/eval/safety.py 94.59% 3 Missing and 5 partials :warning:
src/dg_commons/eval/comfort.py 87.87% 2 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #124 +/- ## ========================================== + Coverage 78.31% 80.22% +1.91% ========================================== Files 72 75 +3 Lines 4943 5199 +256 Branches 331 377 +46 ========================================== + Hits 3871 4171 +300 + Misses 991 930 -61 - Partials 81 98 +17 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alezana commented 1 month ago

@ysli16 see the above comment as review