https://github.com/cansik/sweep-processing
Sweep Library for Processing
https://github.com/cansik/sweep-processing
hardware library lidar processing sensor sweep
Last synced: about 1 month ago
JSON representation
Sweep Library for Processing
- Host: GitHub
- URL: https://github.com/cansik/sweep-processing
- Owner: cansik
- Created: 2017-07-24T09:26:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T11:56:52.000Z (over 7 years ago)
- Last Synced: 2025-03-31T02:12:56.272Z (2 months ago)
- Topics: hardware, library, lidar, processing, sensor, sweep
- Language: Java
- Size: 5.81 MB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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)
Use the Scanse Sweep LIDAR with processing.## Introduction
**Sweep for Processing** is a port of the **[Scanse](http://scanse.io/) [Sweep LIDAR](https://github.com/scanse/sweep-sdk)** library for processing. It gives you full access to the C API and adds some processing specfic methods to it.
Currently it is still under development and **ONLY** tested on MacOS.

*Example of the LIDAR with FX2D*
## Example
### Basic
To get sample data from the LIDAR sensor, you have to create a new `SweepSensor` and call the `start` method. The start method needs the path to the Sweep COM port.```java
import ch.bildspur.sweep.*;SweepSensor sweep;
void setup()
{
size(600, 300, FX2D);sweep = new SweepSensor(this);
sweep.start("/dev/tty.usbserial-DO004HM4");
}
```In draw you then just have to read the new samples from the device.
```java
void draw()
{
// do your stuff
// read samples
List samples = sweep.getSamples()
// do drawing
}
```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).
*Based on [BasicExample](examples/BasicExample/BasicExample.pde)*
### Asynchronous
With version `0.3` it is possible to start the device asynchronous and set the set the **motor speed** and **sample rate** through the constructor (thanks to [@felixerdy](https://github.com/felixerdy)).```java
import ch.bildspur.sweep.*;SweepSensor sweep;
void setup()
{
size(600, 300, FX2D);sweep = new SweepSensor(this);
sweep.startAsync("/dev/tty.usbserial-DO004HM4", 5, 500);
}
```It is recommended to use this method if the processing main thread should not be blocked by the start of the sweep device.
*Based on [AsyncExample](examples/AsyncExample/AsyncExample.pde)*