-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Java Simulation Examples (#913)
Removes apriltagExample and simposeest, replacing them with swervedriveposeestsim --------- Co-authored-by: Matt <[email protected]>
- Loading branch information
Showing
65 changed files
with
1,860 additions
and
2,012 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## PhotonLib C++ Examples | ||
|
||
### Running examples | ||
|
||
For instructions on how to run these examples locally, see [Running Examples](https://docs.photonvision.org/en/latest/docs/contributing/photonvision/build-instructions.html#running-examples). | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// These should be the only 2 non-project subdirectories in the examples folder | ||
// I could check for (it)/build.gradle to exist, but w/e | ||
def EXCLUDED_DIRS = ["bin", "build"] | ||
|
||
// List all non-hidden directories not in EXCUDED_DIRS | ||
ext.exampleFolderNames = file("${rootDir}") | ||
.listFiles() | ||
.findAll { | ||
return (it.isDirectory() | ||
&& !it.isHidden() | ||
&& !(it.name in EXCLUDED_DIRS) && !it.name.startsWith(".") | ||
&& it.toPath().resolve("build.gradle").toFile().exists()) | ||
} | ||
.collect { it.name } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
new File('examples.txt').eachLine { line -> include line } | ||
apply from: "examples.gradle" | ||
|
||
exampleFolderNames.each { line -> include line } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## PhotonLib Java Examples | ||
|
||
### Running examples | ||
|
||
For instructions on how to run these examples locally, see [Running Examples](https://docs.photonvision.org/en/latest/docs/contributing/photonvision/build-instructions.html#running-examples). | ||
|
||
--- | ||
|
||
### [**`aimattarget`**](aimattarget) | ||
|
||
A simple demonstration of using PhotonVision's 2d target yaw to align a differential drivetrain with a target. | ||
|
||
--- | ||
|
||
### [**`getinrange`**](getinrange) | ||
|
||
A simple demonstration of using PhotonVision's 2d target pitch to bring a differential drivetrain to a specific distance from a target. | ||
|
||
--- | ||
|
||
### [**`aimandrange`**](aimandrange) | ||
|
||
A combination of the previous `aimattarget` and `getinrange` examples to simultaneously aim and get in range of a target. | ||
|
||
--- | ||
|
||
### [**`simaimandrange`**](simaimandrange) | ||
|
||
The above `aimandrange` example with simulation support. | ||
|
||
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/7953350/268856085-432a54b9-f596-4e30-8b57-a8f38f88f985.png" width=60% height=60%> | ||
|
||
**Keyboard controls:** | ||
- Drive forward/backward: W/S | ||
- Turn left/right: A/D | ||
- Perform vision alignment: Z | ||
|
||
--- | ||
|
||
### [**`swervedriveposeestsim`**](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. | ||
|
||
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/7953350/268862944-3392e69a-7705-4dbc-9eb8-0d03a6e27b9e.png" width=60% height=60%> | ||
|
||
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/7953350/268857280-bae145b8-356e-4afb-b842-597dbea60df6.png" width=60% height=60%> | ||
|
||
**Keyboard controls:** | ||
- Translate field-relative: WASD | ||
- Rotate counter/clockwise: Q/E | ||
- Offset pose estimate: X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## **`aimandrange`** | ||
|
||
### See [PhotonLib Java Examples](./README.md#aimandrange) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## **`aimattarget`** | ||
|
||
### See [PhotonLib Java Examples](./README.md#aimattarget) |
6 changes: 0 additions & 6 deletions
6
photonlib-java-examples/apriltagExample/.wpilib/wpilib_preferences.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.