-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python documentation to trajectories (#2618)
- Loading branch information
Showing
7 changed files
with
173 additions
and
11 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
20 changes: 20 additions & 0 deletions
20
...e/advanced-controls/trajectories/examples/trajectory-generation-1/py/ExampleTrajectory.py
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,20 @@ | ||
from wpimath.geometry import Pose2d, Rotation2d, Translation2d | ||
from wpimath.trajectory import TrajectoryGenerator, TrajectoryConfig | ||
|
||
|
||
def generateTrajectory(): | ||
# 2018 cross scale auto waypoints. | ||
sideStart = Pose2d.fromFeet(1.54, 23.23, Rotation2d.fromDegrees(-180)) | ||
crossScale = Pose2d.fromFeet(23.7, 6.8, Rotation2d.fromDegrees(-160)) | ||
|
||
interiorWaypoints = [ | ||
Translation2d.fromFeet(14.54, 23.23), | ||
Translation2d.fromFeet(21.04, 18.23), | ||
] | ||
|
||
config = TrajectoryConfig.fromFps(12, 12) | ||
config.setReversed(True) | ||
|
||
trajectory = TrajectoryGenerator.generateTrajectory( | ||
sideStart, interiorWaypoints, crossScale, config | ||
) |
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
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
Oops, something went wrong.