Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
laviRZ committed Feb 16, 2024
2 parents d41caaf + 6a2d83e commit 698815c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,19 @@ jobs:
release:
needs: [build-client, run_docs]

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-22.04
steps:

# Download literally every single artifact.
- uses: actions/download-artifact@v4

- run: find .

- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: copy file via ssh password
uses: appleboy/[email protected]
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
host: ${{ secrets.WEBMASTER_SSH_HOST }}
username: ${{ secrets.WEBMASTER_SSH_USERNAME }}
password: ${{ secrets.WEBMASTER_SSH_KEY }}
port: ${{ secrets.WEBMASTER_SSH_PORT }}
source: "*"
target: /var/www/html/photonvision-docs/
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const getUniqueVideoFormatsByResolution = (): VideoFormat[] => {
const calib = useCameraSettingsStore().getCalibrationCoeffs(format.resolution);
if (calib !== undefined) {
// For each error, square it, sum the squares, and divide by total points N
format.mean = calib.meanErrors.reduce((a, b) => a + b) / calib.meanErrors.length;
if (calib.meanErrors.length)
format.mean = calib.meanErrors.reduce((a, b) => a + b, 0) / calib.meanErrors.length;
else format.mean = NaN;
format.horizontalFOV =
2 * Math.atan2(format.resolution.width / 2, calib.cameraIntrinsics.data[0]) * (180 / Math.PI);
Expand Down Expand Up @@ -256,7 +258,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
>
<td>{{ getResolutionString(value.resolution) }}</td>
<td>
{{ value.mean !== undefined ? (isNaN(value.mean) ? "NaN" : value.mean.toFixed(2) + "px") : "-" }}
{{ value.mean !== undefined ? (isNaN(value.mean) ? "Unknown" : value.mean.toFixed(2) + "px") : "-" }}
</td>
<td>{{ value.horizontalFOV !== undefined ? value.horizontalFOV.toFixed(2) + "°" : "-" }}</td>
<td>{{ value.verticalFOV !== undefined ? value.verticalFOV.toFixed(2) + "°" : "-" }}</td>
Expand Down
2 changes: 1 addition & 1 deletion photon-lib/py/photonlibpy/photonCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def getLatestResult(self) -> PhotonPipelineResult:
retVal.populateFromPacket(pkt)
# NT4 allows us to correct the timestamp based on when the message was sent
retVal.setTimestampSeconds(
timestamp / 1e-6 - retVal.getLatencyMillis() / 1e-3
timestamp / 1e6 - retVal.getLatencyMillis() / 1e3
)
return retVal

Expand Down
4 changes: 2 additions & 2 deletions photonlib-cpp-examples/aimattarget/src/main/include/Robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Robot : public frc::TimedRobot {
void TeleopPeriodic() override;

private:
// Change this to match the name of your camera
photon::PhotonCamera camera{"photonvision"};
// Change this to match the name of your camera as shown in the web UI
photon::PhotonCamera camera{"YOUR_CAMERA_NAME_HERE"};
// PID constants should be tuned per robot
frc::PIDController controller{.1, 0, 0};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class Robot extends TimedRobot {
// How far from the target we want to be
final double GOAL_RANGE_METERS = Units.feetToMeters(3);

// Change this to match the name of your camera
PhotonCamera camera = new PhotonCamera("photonvision");
// Change this to match the name of your camera as shown in the web UI
PhotonCamera camera = new PhotonCamera("YOUR_CAMERA_NAME_HERE");

// PID constants should be tuned per robot
final double LINEAR_P = 0.1;
Expand Down

0 comments on commit 698815c

Please sign in to comment.