Skip to content

Commit 3501e48

Browse files
Updating Python Examples
1 parent aeb660d commit 3501e48

28 files changed

+380
-300
lines changed
72.3 KB
Loading
Loading
65.7 KB
Loading
Loading
Loading
77.4 KB
Loading
75.6 KB
Loading
22.2 KB
Loading
950 Bytes
Loading
Loading
Loading
Loading
23.6 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
23.6 KB
Loading

docs/examples-Python.md

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

docs/examples_ftc.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
icon: first
3+
---
4+
5+
!!! attention
6+
Please ensure you have done the Software Setup before attempting to run the example! You need to have at least version v9.2 of the SDK running on the Control Hub, and add the sensor to your Hardware Config.
7+
8+
Unlike our Arduino and Python libraries that include several examples, there is only a single but comprehensive example for FTC. This sample OpMode is available in Blocks, OnBot Java, and Android Studio; setup instructions are avaiable for each, but running the sample is the same.
9+
10+
# Blocks
11+
12+
Create a new OpMode based on the sample called `SensorSparkFunOTOS`.
13+
14+
TODO
15+
16+
# OnBot Java
17+
18+
Create a new OpMode based on the sample called `SensorSparkFunOTOS`.
19+
20+
TODO
21+
22+
# Android Studio
23+
24+
Navigate to the sample OpModes under FtcRobotController -> java -> `org.firstinspires.ftc.robotcontroller.external.samples` -> `SensorSparkFunOTOS`. Make a copy of this file in the TeamCode folder along with the rest of your code.
25+
26+
!!! attention
27+
It is strongly recommended that you do not modify the sample OpModes within the FtcRobotController sample folder! Always make a copy so you have clean examples to work with!
28+
29+
After making a copy, comment out or delete the `@Disabled` to enable the OpMode. Then upload the code to the robot.
30+
31+
32+
<figure markdown>
33+
[![](assets/img/ftc_example/android_studio.png){ width="100%" }](assets/img/ftc_example/android_studio.png "Click to enlarge")
34+
<figcaption markdown></figcaption>
35+
</figure>
36+
37+
# Run the Example
38+
39+
On the Driver Station, select the TeleOp dropdown menu, and you should see the `Sensor: SparkFun OTOS` sample OpMode; select it.
40+
41+
When you press the `INIT` button, the sensor will initialize, the IMU will be calibrated, and the tracking algorithm will be reset. The telemetry on the driver station will display the version numbers read from the device.
42+
43+
When you press the `Start` button, the telemetry will display the (x,y) coordinates and heading angle of the robot, as measure by the sensor. If you have gamepad #1 connected, you can press Y (triangle) to reset the tracking, or press X (square) to re-calibrate the IMU.
44+
45+
<figure markdown>
46+
[![](assets/img/ftc_example/driver_station.jpg){ width="400" }](assets/img/ftc_example/driver_station.jpg "Click to enlarge")
47+
<figcaption markdown></figcaption>
48+
</figure>

0 commit comments

Comments
 (0)