-
Notifications
You must be signed in to change notification settings - Fork 6
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
add eval functions #124
base: master
Are you sure you want to change the base?
add eval functions #124
Conversation
@ysli16 could you please
|
Other suggestions from looking at the code:
acc_time = []
for idx in range(len(commands.timestamps)):
acc_time.append(commands.values[idx].acc) can be a single line
for idx in range(0, len(states.values)):
state = states.values[idx]
timestep = states.timestamps[idx]
reached = desired_lane_reached(lanelet_network, goal_lane, state, pos_tol, heading_tol)
if reached:
reached_time = timestep
break
return float(reached_time) can be for idx, state in enumerate(states.values):
reached = desired_lane_reached(lanelet_network, goal_lane, state, pos_tol, heading_tol)
if reached:
reached_time = states.timestamps[idx]
break
return float(reached_time) ps: Here I don't really like the -1 as return if it is not reached, very bug prone |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. |
@ysli16 see the above comment as review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some food for thought. View full project report here.
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.