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

camerad: add CameraConfig struct for initializing CameraState in constructor #33065

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Jul 24, 2024

reopen #33034

Copy link
Contributor

github-actions bot commented Jul 24, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@adeebshihadeh
Copy link
Contributor

trigger-jenkins

@adeebshihadeh
Copy link
Contributor

Failed on OX03C10
image

@deanlee deanlee marked this pull request as draft July 24, 2024 20:43
@deanlee
Copy link
Contributor Author

deanlee commented Jul 24, 2024

Strange, but I don't think this PR is the likely cause. It only initializes a few parameters for the camera before opening it. However, I'll double-check later.

@deanlee
Copy link
Contributor Author

deanlee commented Jul 25, 2024

Failed on OX03C10

I ran test_camerad.py on device (OX03C10) multiple times without errors. that error report might be due to a flaky test?
Screenshot from 2024-07-25 15-55-47

@deanlee deanlee marked this pull request as ready for review July 25, 2024 12:10
@adeebshihadeh
Copy link
Contributor

This test is quite reliable, but let's try again.

trigger-jenkins

@deanlee deanlee marked this pull request as draft July 25, 2024 17:34
@deanlee
Copy link
Contributor Author

deanlee commented Jul 25, 2024

The issue should be identified now. It's an initialization problem.

Previously, the CameraState had no constructor and did not manage its own initialization, depending on MultiCameraState cameras = {}; to set its member variables to zero.

This pull request introduces a constructor for CameraState, meaning that CameraState must now take responsibility for initializing its own member variables. Otherwise, the member variables could contain corrupt data.

I have committed the fix. The CameraState class now properly manages its own initialization, which should help it pass the test and improve overall reliability.

@deanlee deanlee marked this pull request as ready for review July 25, 2024 19:46
@adeebshihadeh
Copy link
Contributor

trigger-jenkins

@adeebshihadeh adeebshihadeh merged commit 75f49f8 into commaai:master Jul 25, 2024
17 of 18 checks passed
Edison-CBS pushed a commit to Edison-CBS/openpilot that referenced this pull request Sep 15, 2024
…tructor (commaai#33065)

* Add CameraConfig struct for initializing CameraState in constructor

* init member variables
old-commit-hash: 75f49f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants