Files
PhotonVision/photonlib-java-examples/README.md
amquake ce0d28da93 Update Java Simulation Examples (#913)
Removes apriltagExample and simposeest, replacing them with swervedriveposeestsim

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-10-05 08:57:38 -04:00

1.8 KiB

PhotonLib Java Examples

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.


getinrange

A simple demonstration of using PhotonVision's 2d target pitch to bring a differential drivetrain to a specific distance from a target.


aimandrange

A combination of the previous aimattarget and getinrange examples to simultaneously aim and get in range of a target.


simaimandrange

The above aimandrange example with simulation support.

Keyboard controls:

  • Drive forward/backward: W/S
  • Turn left/right: A/D
  • Perform vision alignment: Z

swervedriveposeestsim

A minimal swerve drive example demonstrating the usage of PhotonVision for AprilTag vision estimation with a swerve drive pose estimator.

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

Keyboard controls:

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