Skip to content

Commit a45b408

Browse files
committed
that should be almost everything
1 parent 143fe9b commit a45b408

4 files changed

Lines changed: 234 additions & 6 deletions

File tree

.idea/workspace.xml

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: HuskyLens
3+
description: Reading blocks and arrows with NextHuskyLens
4+
sidebar:
5+
order: 2
6+
---
7+
8+
import { Tabs, TabItem } from '@astrojs/starlight/components';
9+
10+
`NextHuskyLens` is a wrapper around the [HuskyLens](https://www.gobilda.com/huskylens-ai-camera-vision-sensor-with-gobilda-case/) that initializes the device lazily from the hardware map. It wraps common read and setup methods.
11+
Anything else not wrapped is accessible through `camera`.
12+
13+
## Creating a NextHuskyLens
14+
15+
<Tabs syncKey="language">
16+
<TabItem label="Kotlin">
17+
```kotlin
18+
val huskyLens = NextHuskyLens("huskyLens") // Using your configuration name
19+
```
20+
</TabItem>
21+
<TabItem label="Java">
22+
```java
23+
NextHuskyLens huskyLens = new NextHuskyLens("huskyLens"); // Using your configuration name
24+
```
25+
</TabItem>
26+
</Tabs>
27+
28+
## Usage
29+
30+
### `selectAlgorithm(algorithm)`
31+
32+
Selects the recognition algorithm.
33+
34+
<Tabs syncKey="language">
35+
<TabItem label="Kotlin">
36+
```kotlin
37+
huskyLens.selectAlgorithm(HuskyLens.Algorithm.OBJECT_TRACKING)
38+
```
39+
</TabItem>
40+
<TabItem label="Java">
41+
```java
42+
huskyLens.selectAlgorithm(HuskyLens.Algorithm.OBJECT_TRACKING);
43+
```
44+
</TabItem>
45+
</Tabs>
46+
47+
### `blocks(id)`
48+
49+
Returns all currently seen blocks, or only blocks with the given id, this is capped at 6.
50+
51+
<Tabs syncKey="language">
52+
<TabItem label="Kotlin">
53+
```kotlin
54+
val allBlocks = huskyLens.blocks()
55+
56+
val blocksWithId = huskyLens.blocks(1)
57+
```
58+
</TabItem>
59+
<TabItem label="Java">
60+
```java
61+
HuskyLens.Block[] allBlocks = huskyLens.blocks();
62+
63+
HuskyLens.Block[] blocksWithId = huskyLens.blocks(1);
64+
```
65+
</TabItem>
66+
</Tabs>
67+
68+
### `arrows(id)`
69+
70+
Returns all currently seen arrows, or only arrows with the given id, this is capped at 6.
71+
72+
<Tabs syncKey="language">
73+
<TabItem label="Kotlin">
74+
```kotlin
75+
val allArrows = huskyLens.arrows()
76+
77+
val arrowsWithId = huskyLens.arrows(1)
78+
```
79+
</TabItem>
80+
<TabItem label="Java">
81+
```java
82+
HuskyLens.Arrow[] allArrows = huskyLens.arrows();
83+
84+
HuskyLens.Arrow[] arrowsWithId = huskyLens.arrows(1);
85+
```
86+
</TabItem>
87+
</Tabs>
88+
89+
### `knock()`
90+
91+
Verifies the device is responding over I2C. Returns `true` if it is.
92+
93+
<Tabs syncKey="language">
94+
<TabItem label="Kotlin">
95+
```kotlin
96+
if (huskyLens.knock()) { ... }
97+
```
98+
</TabItem>
99+
<TabItem label="Java">
100+
```java
101+
if (huskyLens.knock()) { ... }
102+
```
103+
</TabItem>
104+
</Tabs>
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: Limelights
3+
description: Reading AprilTags and pose data with NextLimelight
4+
sidebar:
5+
order: 1
6+
---
7+
8+
import { Tabs, TabItem } from '@astrojs/starlight/components';
9+
10+
`NextLimelight` is a wrapper around the [Limelight3A](https://limelightvision.io/products/limelight-3a) that initializes the device lazily from the hardware map. While creating many useful methods. Any data that is not wrapped can be accessed through `camera`.
11+
12+
13+
## Creating a NextLimelight
14+
15+
<Tabs syncKey="language">
16+
<TabItem label="Kotlin">
17+
```kotlin
18+
val limelight = NextLimelight("limelight") // Using your configuration name
19+
```
20+
</TabItem>
21+
<TabItem label="Java">
22+
```java
23+
NextLimelight limelight = new NextLimelight("limelight"); // Using your configuration name
24+
```
25+
</TabItem>
26+
</Tabs>
27+
28+
## Usage
29+
30+
### `startReading(pipeline, hz)`
31+
32+
Sets the poll rate and pipeline, then starts polling, all in one call.
33+
34+
<Tabs syncKey="language">
35+
<TabItem label="Kotlin">
36+
```kotlin
37+
limelight.startReading(pipeline = 0, hz = 100)
38+
```
39+
</TabItem>
40+
<TabItem label="Java">
41+
```java
42+
limelight.startReading(0, 100);
43+
```
44+
</TabItem>
45+
</Tabs>
46+
47+
### `getDistance(unit, id)`
48+
49+
Returns the straight-line distance (hypotenuse) from the robot to the AprilTag for the matching `id` (or any visible tag if `id` is `null`), in the given unit or `null` if no valid tag is available.
50+
51+
<Tabs syncKey="language">
52+
<TabItem label="Kotlin">
53+
```kotlin
54+
val distance = limelight.getDistance(id = 7) //Defaults to Inches
55+
if (distance != null) {
56+
// ...
57+
}
58+
```
59+
</TabItem>
60+
<TabItem label="Java">
61+
```java
62+
Distance distance = limelight.getDistance(Inches.INSTANCE, 7); //Defaults to Inches
63+
if (distance != null) {
64+
// ...
65+
}
66+
```
67+
</TabItem>
68+
</Tabs>
69+
70+
### `getPose()`
71+
72+
Returns the robot's field position in [FTC coordinates](https://ftc-docs.firstinspires.org/en/latest/game_specific_resources/field_coordinate_system/field-coordinate-system.html), or `null` if no valid pose is available.
73+
74+
<Tabs syncKey="language">
75+
<TabItem label="Kotlin">
76+
```kotlin
77+
val pose = limelight.getPose()
78+
if (pose != null) {
79+
// ...
80+
}
81+
```
82+
</TabItem>
83+
<TabItem label="Java">
84+
```java
85+
Pose2d pose = limelight.getPose();
86+
if (pose != null) {
87+
// ...
88+
}
89+
```
90+
</TabItem>
91+
</Tabs>
92+
93+
### `getPedroPose()`
94+
95+
Returns the robot's field position in [Pedro coordinates](https://pedropathing.com/docs/pathing/reference/coordinates), or `null` if no valid pose is available.
96+
97+
<Tabs syncKey="language">
98+
<TabItem label="Kotlin">
99+
```kotlin
100+
val pose = limelight.getPedroPose()
101+
if (pose != null) {
102+
// ...
103+
}
104+
```
105+
</TabItem>
106+
<TabItem label="Java">
107+
```java
108+
Pose2d pose = limelight.getPedroPose();
109+
if (pose != null) {
110+
// ...
111+
}
112+
```
113+
</TabItem>
114+
</Tabs>

src/content/docs/hardware/miscellaneous/rgb-indicator.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: RGB Indicators
33
description: Controlling the goBILDA PWM RGB Indicator Light with NextRGBIndicator
44
sidebar:
5-
order: 1
5+
order: 3
66
---
77

88
import { Tabs, TabItem } from '@astrojs/starlight/components';

0 commit comments

Comments
 (0)