Skip to content

Commit 58701c5

Browse files
Codelab Updates (#1091)
* Initial exporter changes * feat(tutorials): Add APS codelab Also removed old codelabs, along with images. * feat(tutorials)!: Add configure assets codelab. WIP * feat[tutorials]: Complete code simulation and configure assets codelabs.
1 parent 8d17e1b commit 58701c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+249
-279
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.gradle/
22
.vscode/
33
.wpilib/
4+
.settings/
45
build/
56
.settings/
67

simulation/samples/JavaSample/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ simgui.json
66
.gradle/
77
.vscode/
88
.wpilib/
9+
.settings/
910
build/
1011
ctre_sim/
1112
bin/

tutorials/APS.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
author: Synthesis Team
2+
summary: How to use Autodesk Platform Services to store and load Synthesis assemblies.
3+
id: APSCodelab
4+
tags: Autodesk, APS, Autodesk Platform Services, Fusion
5+
categories: Services
6+
environments: Synthesis
7+
status: Draft
8+
feedback link: https://github.com/Autodesk/synthesis/issues
9+
10+
# Autodesk Platform Services
11+
12+
## APS (Fusion)
13+
14+
### Login
15+
16+
In order to make use of the Autodesk Platform Services (APS) integration, you first have to log in. This can be done with the middle toolbar button.
17+
18+
![aps toolbar button](img/aps/aps-button-fusion.png)
19+
20+
![aps login](img/aps/aps-login-fusion.png)
21+
22+
Once logged in, you'll be able to see your name in the main export panel.
23+
24+
![aps info](img/aps/aps-info-fusion.png)
25+
26+
### Export Option
27+
28+
To store an export in your current project, make sure the "Export Location" option is set to "Upload".
29+
30+
![upload location option](img/aps/aps-location-fusion.png)
31+
32+
## APS (Synthesis)
33+
34+
### Login
35+
36+
To log into your Autodesk account, open the left menu and click on "APS Login".
37+
38+
![left menu in synthesis](img/aps/aps-left-menu-fission.png)
39+
40+
![login page](img/aps/aps-login-fission.png)
41+
42+
Upon successful login, you should see a notification in the bottom-right, as well as a greeting and your profile picture replacing the "APS Login" button.
43+
44+
![aps login notification](img/aps/aps-notif-fission.png)
45+
46+
![aps profile](img/aps/aps-profile-fission.png)
47+
48+
### Importing
49+
50+
Once logged in, when you open the "Spawn Asset" panel, the remote assets section will begin to search your projects and show any and all Synthesis assemblies available for importing.
51+
52+
![spawn asset panel](img/aps/import-fission.png)
53+
54+
After you've imported them for the first time, they will be saved for later use and won't require APS login to access so long as they stay saved in your browser.
55+
56+
## Need More Help?
57+
58+
If you need help with anything regarding Synthesis or it's related features please reach out through our
59+
[discord sever](https://www.discord.gg/hHcF9AVgZA). It's the best way to get in contact with the community and our current developers.

tutorials/CodeSimulation.md

Lines changed: 114 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,135 @@ feedback link: https://github.com/Autodesk/synthesis/issues
99

1010
# Code Simulation in Synthesis
1111

12-
## Setup
13-
14-
### Setup (Project Side)
12+
## Setup (Robot Code Side)
1513

1614
The Synthesis simulator comes with code simulation already integrated. However, a development environment for what ever code your are trying to simulate will be required.
17-
Synthesis' code simulation relies on the WPILib HALSim extensions, specifically the websocket-client extension. To enable this for your project, add the following lines to
18-
your `build.gradle` file.
15+
Synthesis' code simulation relies on the WPILib HALSim extensions, specifically the websocket-client extension. You'll need to make the following changes to your `build.gradle` in order to properly simulate your code in Synthesis.
16+
17+
### 1. Desktop Support
18+
19+
You'll need to enable desktop support for your project in order to run the HALSim:
20+
21+
```java
22+
def includeDesktopSupport = true
23+
```
24+
25+
### 2. Websocket Server Extension
26+
27+
In order to communicate with your browser, you'll need to enable the websocket server extension with the following:
1928

2029
```java
2130
wpi.sim.envVar("HALSIMWS_HOST", "127.0.0.1")
22-
wpi.sim.addWebsocketsClient().defaultEnabled = true
31+
wpi.sim.addWebsocketsServer().defaultEnabled = true
32+
```
33+
34+
### 3. SyntheSim (Optional)
35+
36+
For CAN-based device support (TalonFX, CANSparkMax, most Gyros), you'll need our own library--SyntheSim. Currently only available for Java, SyntheSim adds additional support for third party devices that don't follow WPILib's web socket specification. It's still in early development, so you'll need to clone and install the library locally in order to use it:
37+
38+
```sh
39+
$ git clone https://github.com/Autodesk/synthesis.git
40+
$ cd synthesis/simulation/SyntheSimJava
41+
$ ./gradlew build && ./gradlew publishToMavenLocal
42+
```
43+
44+
Next, you'll need to have the local maven repository is added to your project by making sure the following is included in your `build.gradle` file:
45+
46+
```java
47+
repositories {
48+
mavenLocal()
49+
...
50+
}
51+
```
52+
53+
Finally, you can add the SyntheSim dependency to your `build.gradle`:
54+
55+
```java
56+
dependencies {
57+
...
58+
implementation "com.autodesk.synthesis:SyntheSimJava:1.0.0"
59+
...
60+
}
61+
```
62+
63+
All of these instructions can be found in the [SyntheSim README](https://github.com/Autodesk/synthesis/blob/prod/simulation/SyntheSimJava/README.md).
64+
65+
SyntheSim is very much a work in progress. If there is a particular device that isn't compatible, feel free to head to our [GitHub](https://github.com/Autodesk/synthesis) to see about contributing.
66+
67+
### 4. HALSim GUI
68+
69+
This should be added by default, but in case it isn't, add this to your `build.gradle` to enable the SimGUI extension by default.
70+
71+
```java
72+
wpi.sim.addGui().defaultEnabled = true
73+
```
74+
75+
This will allow you to change the state of the robot, as well as hook up any joysticks you'd like to use during teleop. You must use this GUI in order
76+
to bring your robot out of disconnected mode, otherwise we won't be able to change the state of your robot from within the app.
77+
78+
### 5. Start your code
79+
80+
To start your robot code, you can use the following simulate commands with gradle:
81+
82+
```bash
83+
$ ./gradlew simulateJava
84+
```
85+
86+
or for C++:
87+
88+
```bash
89+
$ ./gradlew simulateNative
2390
```
2491

25-
<b>NOTE:</b> The GUI extension interfaces really well and add Joystick/Controller support to your code, whereas Synthesis currently only supports controllers for non-code simulation.
26-
If you wish to test using your controllers, I recommend using the GUI extension in conjunction.
92+
WPILib also has a command from within VSCode you can use the start your robot code:
93+
94+
![image_caption](img/code-sim/wpilib-ext-simulate.png)
95+
96+
## Setup (Synthesis Web-app Side)
97+
98+
Once started, make sure in the SimGUI that your robot state is set to "Disabled", **not** "Disconnected".
99+
100+
### Spawning in a Robot
101+
102+
Open up [Fission](https://synthesis.autodesk.com/fission/) and spawn in a robot. Once spawned in, place it down and open the config panel. This can be
103+
done by using the left-hand menu and navigating to your robot in the config panel, or by right-clicking on your robot and selecting the "Configure" option.
104+
105+
Next, switch the brain currently controlling the robot. In order to give the simulation control over the robot, the brain must be switched from "Synthesis"
106+
to "WPILib". At the moment, only one robot can be controlled by the simulation at a time.
107+
108+
In the top-right, there should be a connection status indicator. If your robot program was running prior to switching to the "WPILib" brain, it should connect
109+
quickly.
110+
111+
### Simulation Configuration
112+
113+
Under your robot in the config panel, there should be a Simulation option now. Here you can find all the settings for the code simulation.
114+
115+
![image_caption](img/code-sim/config-panel-simulation.png)
116+
117+
#### Auto Reconnect
118+
119+
You can enabled auto reconnect incase you are having issues with this. In order for it to take affect, you have to enable the setting, then switch back to the "Synthesis"
120+
brain and then back again to the "WPILib" brain. This setting will be saved.
121+
122+
#### Wiring Panel
27123

28-
### Setup (Robot Side)
124+
This panel can be used to "wire up" your robot. It will show you all the inputs and outputs available from both the simulation and robot. The handles (little circles with
125+
labels) are colored to indicate the type of data they represent. Hover over the information icons for more information.
29126

30-
Inside of Synthesis, you must configure your "IO map" so we know what signals go where. You can access the configuration modal on the side bar.
31-
Once inside the configuration modal, you can add the devices you want to add support for.
32-
<br/>
33-
<b>NOTE:</b> Currently, due to the way the websocket extension works, no CAN devices are supported. We plan on bringing CAN support for the 2023 Summer release or potentially earlier.
34-
At the moment, PWM and Quadrature Encoders (encoders that use 2 DIO ports each) are supported, with more device types and sensors on the way.
127+
![image_caption](img/code-sim/wiring-panel.png)
35128

36-
## Usage
129+
The bottom-left controls can be used to zoom in/out, fit your view to the nodes, and add junction nodes for connection many connections to many connections.
37130

38-
### Synthesis
131+
#### Auto Testing
39132

40-
Inside of Synthesis, open up the DriverStation. Once connected, you can use it like normal. Our DriverStation is currently limited in its features, so if you need anything beyond
41-
enabling and choosing between Telop and Auto, I recommend using the GUI extension for more functionality.
133+
The Auto Testing panel allows for iterative testing of an autonomous routine. I'd recommend making sure that the auto reconnect option is enabled.
42134

43-
### Running the code Simulation
135+
![image_caption](img/code-sim/auto-testing.png)
44136

45-
I recommend using VSCode and the WPILib Suite extension for running the code simulation. Alternatively you can use this command:
46-
`gradlew.bat simulationJava` or `gradlew.bat simulate`
137+
You can specify a max time, alliance station, and game data. Once you've decided on those and have place the robot where you want, you can start your auto routine.
138+
After the specified amount of time, or when the stop button is pressed, the simulation will freeze and you can either reset to where you started, or close the panel.
47139

48140
## Need More Help?
49141

50142
If you need help with anything regarding Synthesis or it's related features please reach out through our
51-
[discord sever](https://www.discord.gg/hHcF9AVgZA). It's the best way to get in contact with the community and our current developers.
143+
[discord server](https://www.discord.gg/hHcF9AVgZA). It's the best way to get in contact with the community and our current developers.

tutorials/ConfigMode.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

tutorials/ConfigureAssets.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
author: Synthesis Team
2+
summary: Tutorial for navigating and using the configure assets panel.
3+
id: ConfigureAssets
4+
tags: Configuration, Assets, Options, Customization
5+
categories: Configuration
6+
environments: Synthesis
7+
status: Draft
8+
feedback link: https://github.com/Autodesk/synthesis/issues
9+
10+
# Configure Assets
11+
12+
## Main Panel
13+
14+
Use the configure assets panel to modify assemblies in the scene. You can open it either via the left-hand menu,
15+
or by right clicking on an assembly and selecting "Configure".
16+
17+
## Robots
18+
19+
### Brain
20+
21+
The brain determines what controls the robot. There are currently two options, "Synthesis" and "WPILib".
22+
23+
### Move
24+
25+
Add a gizmo tool to your field to orientate it.
26+
27+
### Intake
28+
29+
Setup the intake zone for your robot.
30+
31+
### Ejector
32+
33+
Setup the ejector position and direction for your robot.
34+
35+
### Configure Joints
36+
37+
Edit the joints on your robot and adjust the speed and force behind them.
38+
39+
### Sequence Joints
40+
41+
Configure joints to work together. Helpful for multi-stage elevators.
42+
43+
### Controls (Synthesis Brain)
44+
45+
Change the controls of the input scheme currently in use, as well as switch which scheme is actively in use.
46+
47+
### Simulation (WPILib Brain)
48+
49+
Modify the relation between your robot within Synthesis and your code.
50+
51+
## Fields
52+
53+
### Move
54+
55+
Add a gizmo tool to your field to orientate it.
56+
57+
### Scoring Zones
58+
59+
Add, modify, and delete scoring zones.
60+
61+
## Input
62+
63+
This works the same as the controls section for the robot. You can modify the controls for the schemes, as well as add and delete them.
64+
65+
## Need More Help?
66+
67+
If you need help with anything regarding Synthesis or it's related features please reach out through our
68+
[discord sever](https://www.discord.gg/hHcF9AVgZA). It's the best way to get in contact with the community and our current developers.

0 commit comments

Comments
 (0)