Files
PhotonVision/photonlib-java-examples
Sam Freund f2e262d59d Bring CombinedRuntimeLoader into PV [NFC] (#2367)
Given that WPILib is nuking their Java tooling, it becomes necessary to
pull said tooling into PV itself. This migrates the
CombinedRuntimeLoader into PV, which should finalize all of the tooling
migration.
2026-02-18 10:02:53 -06:00
..
2026-01-17 00:55:30 +00:00
2026-01-17 00:55:30 +00:00
2026-01-12 14:00:11 -08:00
2026-01-17 00:55:30 +00:00
2026-01-12 14:00:11 -08:00
2026-01-12 14:00:11 -08:00
2024-09-15 00:10:02 -04:00

PhotonLib Java Examples

All examples demonstrate controlling a swerve drive with outputs from PhotonVision.

Simulation is available to demonstrate the concepts - swerve physics is approximated.

You can access a stream of what the simulated camera sees by going to https://localhost:1182 .

Running examples

For instructions on how to run these examples locally, see Running Examples.


aimattarget

A simple demonstration of using PhotonVision's 2d target yaw to align a differential drivetrain with a target.

Keyboard controls:

  • Translate field-relative: WASD
  • Rotate counter/clockwise: Q/E
  • Perform vision alignment: Z

aimandrange

Extendsaimattarget to add getting in range of the target.

Keyboard controls:

  • Translate field-relative: WASD
  • Rotate counter/clockwise: Q/E
  • Perform vision alignment: Z

poseest

The example also has simulation support with an approximation of swerve drive dynamics.

Keyboard controls:

  • Translate field-relative: WASD
  • Rotate counter/clockwise: Q/E
  • Perform vision alignment: Z
  • Offset pose estimate: X