-
Notifications
You must be signed in to change notification settings - Fork 1
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
added violations recording for pedestrian collisions #143
base: master
Are you sure you want to change the base?
Conversation
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.
Works, just small tweaks. @drodeur could you have a super quick look?
Let's harmonize with NCAP: https://cdn.euroncap.com/media/58226/euro-ncap-aeb-vru-test-protocol-v303.pdf So we can approximate that with a radius of 0.27 m. I updated the constant. |
@@ -159,6 +175,19 @@ def do_polygons_intersect(self, polygon_a, polygon_b): | |||
return False; | |||
|
|||
return True | |||
|
|||
def check_circle_rectangle_collision(self, centre, rectangle, radius): |
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.
this checking is not that great. The pedestrian could be close to the closest point but still outside of the bounding box. We need to see that it's actually inside the box. Additionally, the pedestrian could "slip through" the middle between two vertices: the width is 1.8 m, so there's a gap of 1.26 m in between! Even worse for the length, which is 4.5 m.
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.
Consider the situation in the image. A very crude and fast check would be to see if
minx<=px<=maxx and miny<py<maxy
that would place it inside the dashed box. Of course, that condition would be true for pedestrian P, which would be a false positive. So, we need to now confirm that it actually intersects with the bounding box.
In this image, we can use the orange circle (vx, vy) with radius (vw/2). If the pedestrain is inside, collision for sure. Using the larger blue circle can have pedestrian P as a false positive.
So, all these are just very simple and fast checks. I would do the following:
- check whether within the orange circle first, if not,
- check whether within the dashed box, if yes
- do a detailed check with the proper bounding box overlap.
added collision checking between vehicles and pedestrians. Fixes #140
The violations are recorded in violations.json.
Test with NCAP_723-sdv.osm (scenario developed for ford)
the desirable outcome should look something like this:
{"1": {"12": {"CollisionWithPedestrian": {"colliderId": 4, "message": "v1 bounding box overlapped with the pedestrian agent v4"}}}}