forked from Xevel/NXV11
-
Notifications
You must be signed in to change notification settings - Fork 10
/
README.txt
56 lines (37 loc) · 2.76 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
XV-11 test
Copyright 2010 Nicolas "Xevel" Saugnier
This repository contains the python visualizer, as well as the arduino sketch that spoofs a lidar (using a few full revolutions).
How to make the program work in demo mode :
- install VPython
- open XV-11_test.py in VIDLE (installed with VPython)
- set use_real_robot to False
- F5 to run. Maintain left+right mouse button + move the mouse up and down to zoom.
How to make the program work in live mode :
- install VPython
- install PySerial
- open XV-11_test.py in VIDLE (installed with VPython)
- set your COM port number (be careful, on Windows, COM5 has is the port number 4 ...)
- F5 to run. Maintain left+right mouse button + move the mouse up and down to zoom.
How to make an arduino spoof the lidar:
- program LidarSpoofing on your arduino (works on ATmega328 and better, get an older version if you have an ATMega168 base board), and update your com port
For better performances, you have to lower the latency (16ms by default on windows, 10ms on some Linux) of the COM port.
On windows, this is an advanced property of the COM port, accessible through the Device Manager.
How to extract your data to give them to the spoofer (from a Saleae Logic Scan, the long and not _too_ painful way):
- Open the session in Saleae Logic
- Choose "Analyser" > "Async Serial", set the correct channel and check "Use Autobaud"
- click the "Export Analyser Data" of the analyser you just created, save to a file
- copy the content (or just part of it) into an OpenOffice Calc spreadsheet, choose the comma as separator
- discard the column containing the time, and the headers if any. Move the data to column B, remove all the leading blank lines if any
- save the spreadsheet in .CSV format, using a comma as field separator, and *nothing* as text separator
- select the part you want to use, copy it into the LidarSpoofing/data.pde file, replacing the current data, and update the number of sample (equal to the number of lines you selected). Be careful not to copy too much, the arduino has limited flash memory. And the max size of an array is 32K...
- program the arduino with this sketch, then run the python script. The last scan will probably be messed up, but it should go back to normal at the next revolution.
Licensing
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.