-
Notifications
You must be signed in to change notification settings - Fork 0
add camera and vision utils #5
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
base: main
Are you sure you want to change the base?
Conversation
riley-jen
left a comment
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.
overall, augment thinks that some of the logic here is not efficient. is that possibly causing some of our vision problems?
|
|
||
| SmartDashboard.putBoolean("isConnected/" + m_cameraName, m_camera.isConnected()); | ||
| } | ||
|
|
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.
--- getters ---
none have null checks. not sure whether we want to add them/how to deal with it. i know that we technically check for emptiness in other places but a lot safer to do something here
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.
I don't know if this is good coding practice (Max might know better), but you could probably just throw an exception if it's null. I wonder if this is a question to ask LLMs -- I haven't set up augment successfully yet but I'm working on it,
src/main/java/frc/robot/subsystems/vision/LocalizationCamera.java
Outdated
Show resolved
Hide resolved
| totalTime += Math.abs(m_lastEstPoses.get(i).timestampSeconds - m_lastEstPoses.get(i+1).timestampSeconds); | ||
| } | ||
|
|
||
| double avgDist = totalDistance / m_lastEstPoses.size(); |
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.
division by 0?
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.
as long as VisionConstants.NUM_LAST_EST_POSES is >0 (and it really should be), the check at line 232
if (m_lastEstPoses.size() < VisionConstants.NUM_LAST_EST_POSES) {
return true;
}
should prevent that.
however, not sure if it's good practice to just assume that will be the case.
not ready to be merged yet!
i opened this so that i can add some comments on the code because i am not sure what we want to do with the vision code. please see them below