[photon-lib] Python support for PNP_DISTANCE_TRIG_SOLVE#2015
[photon-lib] Python support for PNP_DISTANCE_TRIG_SOLVE#2015mcm001 merged 5 commits intoPhotonVision:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This adds support for PNP_DISTANCE_TRIG_SOLVE in the the python PhotonPoseEstimator, mirroring the implementation in the Java PhotonPoseEstimator. Changes: - Add PoseStrategy.PNP_DISTANCE_TRIG_SOLVE - Add PhotonPoseEstimator.addHeadingData() - Update PhotonCameraSim to optionally take in a function to get the FPGA timestamp - Fix PhotonCameraSim.process() to set ntReceiveTimestampMicros in the result - Minor readability improvements to PhotonPipelineResult - Minor test improvements to PhotonPoseEstimatorTest - Add .vscode/settings.json (to make running pythonb tests in VSCode easier)
7dc9ac7 to
d7d7bab
Compare
195f64b to
6756161
Compare
@Gold856 by "timestamp injection" do you mean passing a fake I'm not sure why the Java tests don't have this problem. I tried running Note that |
|
So, is it just too fast? If it's too fast, I'll accept a small sleep at the start of the test with a comment explaining why to make it work. I really don't like having that timestamp function. Alternatively, it looks like we use PhotonCameraInjector in order to inject pipeline results, which I suspect is related, since it allows you to specify the timestamp yourself. You could give that a try as well. |
@Gold856 The problem isn't that the code/tests are "too fast". The estimator gets the current time and is provided the latency, and uses those values to infer the time that the image was captured. The values provided by the test resulted in an image capture time that was negative unless the test started >1s after the HAL was initialized.
I strongly dislike adding sleeps to "fix" tests. I changed the tests to set
The code that is calling I did a bit of searching, and it looks like I could have the test use |
This adds support for PNP_DISTANCE_TRIG_SOLVE in the the python PhotonPoseEstimator, mirroring the implementation in the Java PhotonPoseEstimator.
Changes:
Merge checklist: