You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1511_software/thunderauto/index.md
+82-53Lines changed: 82 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,76 +7,105 @@ parent: 1511 Software
7
7
8
8
# ThunderAuto
9
9
10
-
{: .important }
11
-
Some of this information may be outdated. I may update soon but we'll see.
12
-
13
10
*[Description](#description)
14
-
*[Usage](#usage)
15
-
*[Robot Code](#robot-code)
16
-
*[Movement](#movement)
17
-
*[Actions](#actions)
11
+
*[Creating a Project](#creating-a-project)
12
+
*[The Editor](#the-editor)
13
+
*[Path Editor Page](#path-editor-page)
14
+
*[Path Manager Page](#path-manager-page)
15
+
*[Properties Page](#properties-page)
16
+
*[Actions Page](#actions-page)
18
17
*[Installation](#installation)
19
-
*[Building](#building)
20
18
21
19
## Description
22
-
ThunderAuto is a custom tool for planning autonomous paths for FRC robots.
20
+
ThunderAuto is a custom tool for creating pahts for FRC robots.
23
21
24
22
ThunderAuto's code is hosted on GitHub [here](https://github.com/frc1511/ThunderAuto).
25
23
26
-
## Usage
27
-
When starting the program, the user has the option to either create a new project or open a previously saved one. If the user chooses to create a new project, they can customize various settings, including the maximum velocity and acceleration, the dimensions of the robot, and the field image.
Select the "New Project" button on the Welcome popup, or press Ctrl+N.
31
+
32
+
You need to specify a few settings to create a project:
33
+
34
+
<dl>
35
+
<dt>Path</dt>
36
+
<dd>The location to save the <b>.thunderauto</b> project and all of the exported <b>.csv</b> files.</dd>
37
+
<dt>Field</dt>
38
+
<dd>Which field to use. I will update the app with every year's game field, although choosing <b>Custom</b> will open a popup to select a custom field image.</dd>
39
+
<dt>Controller Type</dt>
40
+
<dd>What kind of drivetrain the robot uses. Only Holonomic (Swerve) drivebases are currently supported by ThunderAuto, with Ramsete drivebases soon? to come.</dd>
The Path Editor page presents the current path on top of the field image. Points can be selected and dragged around to shape the desired path.
56
+
57
+
Pan around with __Shift+Left-Click__ or __Middle-Click__. Zoom with the scroll wheel.
58
+
59
+
__Double-Click__ to create a point. Double-clicking the curve will insert the new point into it. Double-clicking anywhere else will add a point to whichever end is closer to the cursor.
28
60
29
-
<imgsrc="/assets/images/thunderauto/screenshot_2.png"alt="ThunderAuto New Project Window"width="500">
61
+
Use the __Delete__ or __Backspace__ keys to delete the selected point.
30
62
31
-
Upon creating a new project, the user is presented with multiple windows including the Path Selector, Path Editor, and Properties Editor.
63
+
A tooltip is shown when the cursor hovers over the curve.
64
+
The tooltip includes the time, velocity, centripetal acceleration, and curvature at the hovered point.
By default, the color of the curve represents the velocity of the robot (blue = slow, magenta = fast). This can be changed in the [Properties page](#properties-page).
34
67
35
-
The Path Selector window provides the tools for selecting, creating, deleting, and renaming paths. The Path Editor displays the current path as a Bézier curve on the field image, with a gradient representing the robot's velocity (blue for slow, red/pink for fast). The user can add or remove waypoints and adjust their attributes, such as the robot's desired position, rotation, and heading, either directly in the Path Editor or by selecting a waypoint in the Path Editor and using the Properties Page's 'Point' dropdown.
68
+
###Path Manager Page
36
69
37
-
In the Properties Page, the user can also flag a waypoint for the robot to stop at by checking the 'Stop' checkbox. This causes the app to calculate the robot's deceleration to a complete stop at the selected point and its subsequent acceleration as it continues the trajectory. When a waypoint is marked as stopped, the Path Editor separates the heading handles, allowing the robot to resume the path at a different angle from when it reached the point.
ThunderAuto also has a feature called Actions, which allows the user to specify specific actions for the robot to perform at certain points along the trajectory. The Properties Page's dropdown menu provides tools for creating, deleting, and renaming Actions, and for selecting which Actions should be applied to each waypoint.
72
+
The Path Manager page presents a list of all paths in the project.
40
73
41
-
When the user is satisfied with the path they have created, they can use the Properties Page's 'Export' button (under the 'Curve' dropdown) to save the path as a CSV file in the project's directory. The CSV file contains a list of timestamps corresponding to the robot's desired position, rotation, velocity, and actions.
74
+
The selected path in this page is shown in the Path Editor and Properties pages.
42
75
43
-
## Robot Code
44
-
The code needed to run a ThunderAuto trajectory on the robot does not need to be complex, as the app handles most of the motion calculations before the robot executes them.
76
+
Rename a path by double-clicking its name.
45
77
46
-
You can refer to Homer's code [here](https://github.com/petelilley/Homer) for a simple example of how to use ThunderAuto's exported CSV files to execute a trajectory.
78
+
Delete a path by clicking the trash can icon.
47
79
48
-
### Movement
49
-
To begin, the exported CSV file should be placed in a location on the robot that is easy to access, such as the deploy directory. Before the trajectory can be run, the robot's program must [parse the CSV file](https://github.com/petelilley/Homer/blob/main/src/Main/Trajectory/Trajectory.cpp#L13) and create two maps that represent the path's States and Actions over time. When the trajectory is being executed, the robot needs to keep track of the elapsed time and then use this information to [sample](https://github.com/petelilley/Homer/blob/main/src/Main/Trajectory/Trajectory.cpp#L34) the current State from the map of States. Adding [linear interpolation](https://github.com/petelilley/Homer/blob/main/src/Main/Trajectory/Trajectory.cpp#L66) between States can help smooth out the trajectory. The WPILib [HolonomicDriveController](https://github.wpilib.org/allwpilib/docs/release/cpp/classfrc_1_1_holonomic_drive_controller.html) class can be used to calculate the optimal axis velocities for moving the robot based on the current State (as determined by odometry) and the desired State.
80
+
### Properties Page
50
81
51
-
### Actions
52
-
To process Actions, the robot's program must have a [list of Actions](https://github.com/frc1511/Homer/blob/main/src/Main/Autonomous/Autonomous.h#L85) that matches the one used in the app. As the robot follows the path, the program should compare the set bits in the current action bit-field with the available actions. When a match is found, the program can execute any code related to that action. "Blocking" actions can be implemented by stopping the trajectory timer, but these should only be used at waypoints where the robot is supposed to stop.
The Properties page presents properties related to the currently selected point and general path properties.
84
+
85
+
The __Point__ dropdown contains tools related to the selected point. Properties include the point's position, heading, heading weights, rotation, and whether to stop there.
86
+
87
+
If the __Stop__ checkbox is checked the robot will decelerate to a stop at that point. When stopped, the point's incoming and outgoing headings may be different.
88
+
89
+
There is also a dropdown named __Actions__ where actions from the [Actions Page](#actions-page) can be checked on/off for the point.
90
+
91
+
The __Path__ dropdown contains tools related to the selected path.
92
+
93
+
The __Export__ button will export the path to a CSV file in the project's directory. The CSV file is named using the path's name shown in the [Path Manager Page](#path-manager-page).
94
+
95
+
The __Linear Accel__ and __Linear Velocity__ fields edit the robot's maximum allowable acceleration and velocity when traveling the path.
96
+
97
+
The __Centripetal Accel__ field controls the maximum centripetal acceleration of the robot as it makes a turn.
98
+
99
+
100
+
The following fields control what's displayed in the [Path Editor Page](#path-editor-page). The __Curve Overlay__ field controls the color of the curve. The __Show Tangents__, __Show Rotation__, and __Show Tooltip__ checkboxes control whether their respective items are rendered.
0 commit comments