Skip to content

Commit f0e1da2

Browse files
committed
Updated ThunderAuto page
1 parent 6adb6e8 commit f0e1da2

File tree

10 files changed

+82
-53
lines changed

10 files changed

+82
-53
lines changed

1511_software/thunderauto/index.md

Lines changed: 82 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,105 @@ parent: 1511 Software
77

88
# ThunderAuto
99

10-
{: .important }
11-
Some of this information may be outdated. I may update soon but we'll see.
12-
1310
* [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)
1817
* [Installation](#installation)
19-
* [Building](#building)
2018

2119
## 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.
2321

2422
ThunderAuto's code is hosted on GitHub [here](https://github.com/frc1511/ThunderAuto).
2523

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.
24+
Supported on Windows and macOS.
25+
26+
<img src="/assets/images/thunderauto/main.png" alt="ThunderAuto Path Editor" width="800">
27+
28+
## Creating a Project
29+
30+
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>
41+
<dt>Robot Length</dt>
42+
<dd>Length of the robot (meters).</dd>
43+
<dt>Robot Width</dt>
44+
<dd>Width of the robot (meters).</dd>
45+
</dl>
46+
47+
<img src="/assets/images/thunderauto/new_project.png" alt="ThunderAuto New Project Window" width="300" style="display: block; margin-left: auto; margin-right: auto; width: 50%;">
48+
49+
## The Editor
50+
51+
### Path Editor Page
52+
53+
<img align="right" src="/assets/images/thunderauto/dragging.gif" alt="ThunderAuto Editor Dragging GIF" width="350">
54+
55+
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.
2860

29-
<img src="/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.
3062

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.
3265

33-
<img src="/assets/images/thunderauto/screenshot_1.png" alt="ThunderAuto Path Editor" width="800">
66+
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).
3467

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
3669

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.
70+
<img align="right" src="/assets/images/thunderauto/path_manager.png" alt="ThunderAuto Path Manager Page" width="200">
3871

39-
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.
4073

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.
4275

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.
4577

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.
4779

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
5081

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.
82+
<img align="right" src="/assets/images/thunderauto/properties_page.png" alt="ThunderAuto Properties Page" width="200">
83+
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.
101+
102+
### Actions Page
103+
104+
<img align="right" src="/assets/images/thunderauto/actions_page.png" alt="ThunderAuto Actions Page" width="200">
105+
106+
The Actions page presents the global list of actions. Actions can be assigned to points in the [Properties Page](#properties-page).
53107

54108
## Installation
55-
* [Executable Download](https://github.com/petelilley/ThunderAuto/releases/latest)
56-
57-
Keep ThunderAuto up to date! Due to the fact that ThunderAuto is a custom tool, backwards compatibility is not guaranteed!
58-
59-
## Building
60-
Supported operating systems are Windows and macOS. Make sure to resolve all the git submodules before building!
61-
{% highlight bash %}
62-
git submodule init
63-
git submodule update
64-
{% endhighlight %}
65-
66-
Build projects can be generated using CMake. Tested targets include Visual Studio 2019 or 2022 on Windows and Xcode or Unix Makefiles on macOS.
67-
#### Configure Windows
68-
{% highlight bash %}
69-
cmake . -B build -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release
70-
{% endhighlight %}
71-
72-
#### Configure macOS
73-
{% highlight bash %}
74-
cmake . -B build -G "Xcode" -DCMAKE_BUILD_TYPE=Release
75-
{% endhighlight %}
76-
77-
#### Build
78-
{% highlight bash %}
79-
cmake --build build
80-
{% endhighlight %}
81-
82-
All the app's resources (Images, Fonts, etc.) are built into the executable, so there's no need to worry about moving them around once it's built.
109+
* [Releases](https://github.com/petelilley/ThunderAuto/releases)
110+
111+
Keep ThunderAuto up to date! Backwards compatibility is not guaranteed!
103 KB
Loading
517 KB
Loading

assets/images/thunderauto/main.png

868 KB
Loading
75.8 KB
Loading
99.9 KB
Loading
347 KB
Loading
-990 KB
Binary file not shown.
-175 KB
Binary file not shown.
-793 KB
Binary file not shown.

0 commit comments

Comments
 (0)