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
# Sweep for Processing [](https://travis-ci.org/cansik/sweep-processing)[](https://ci.appveyor.com/project/cansik/sweep-processing)[](https://codebeat.co/projects/github-com-cansik-sweep-processing-master)
2
-
Use the scanse sweep lidar with processing.
2
+
Use the Scanse Sweep LIDAR with processing.
3
3
4
4
## Introduction
5
5
@@ -9,4 +9,39 @@ Currently it is still under development and is **ONLY** tested on MacOS.
9
9
10
10

11
11
12
-
*Example of the LIDAR with FX2D*
12
+
*Example of the LIDAR with FX2D*
13
+
14
+
## Example
15
+
To simply get sample data from the LIDAR sensor, you have to create a new `SweepSensor` and call the `start` mehtod. The start method needs the path to the Sweep COM port.
16
+
17
+
```java
18
+
importch.bildspur.sweep.*;
19
+
20
+
SweepSensor sweep;
21
+
22
+
void setup()
23
+
{
24
+
size(600, 300, FX2D);
25
+
26
+
sweep =newSweepSensor(this);
27
+
sweep.start("/dev/tty.usbserial-DO004HM4");
28
+
}
29
+
```
30
+
31
+
In draw you then just have to read the new samples from the device.
32
+
33
+
```java
34
+
void draw()
35
+
{
36
+
// do your stuff
37
+
38
+
// read samples
39
+
List<SensorSample> samples = sweep.getSamples()
40
+
41
+
// do drawing
42
+
}
43
+
```
44
+
45
+
It is recommended to save the reference to the list of samples in a own variable and only use `getSamples()` once in a draw loop. Otherwise it is not guaranteed, that the samples are from the same scan (Concurrency).
46
+
47
+
*Based on [BasicExample](examples/BasicExample/BasicExample.pde)*
0 commit comments