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

FPS lowered to 20 FPS when 13 sensors are used #12

Closed
lukeharwood11 opened this issue Jun 6, 2022 · 4 comments
Closed

FPS lowered to 20 FPS when 13 sensors are used #12

lukeharwood11 opened this issue Jun 6, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@lukeharwood11
Copy link
Owner

lukeharwood11 commented Jun 6, 2022

Fix description:

Masks take up a lot of time to generate, so cache all the possible masks and place them in the correct location.

@lukeharwood11 lukeharwood11 self-assigned this Jun 7, 2022
@lukeharwood11 lukeharwood11 added the bug Something isn't working label Jun 7, 2022
@lukeharwood11
Copy link
Owner Author

Possible Solution

mask_index = int(car_v.angle) - 180 + self.angle
if mask_index < 0:
    mask_index += 360
mask = ...

@lukeharwood11
Copy link
Owner Author

Update:
Cached 359 masks for each angle. Current implementation calculates the offset of the new angle and grabs the corresponding mask from the SensorBuilder class. An (x, y) offset is calculated (the position of the car) and the mask is moved into position.

@lukeharwood11
Copy link
Owner Author

Current implementation maintains ~55-60 fps

@lukeharwood11
Copy link
Owner Author

Using numpy arrays instead of masks (for sensors) allows for 100-120fps (when using 10 sensors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant