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
Copy file name to clipboardExpand all lines: docs/tutorials/using-xv11-lidar.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,20 +32,58 @@ For the details, follow video tutorial:
32
32
## Motor Connector
33
33
34
34
The part with resistors is optional. It allows EV3 to autodetect the motor but in ev3dev you can load the driver manually.
35
-
If you decide not to solder the resistors you only have to make two connections (PWM0 and PWM1).
35
+
If you decide not to solder the resistors you only have to make two connections (PWM0-PWR and PWM1-Ground).
36
36
37
37
{% include screenshot.html source="/images/xv11-tutorial/lidar_motor_scheme.png" %}
38
38
39
+
In both cases (w/o resistors) you are limited to unregulated motor control.
40
+
39
41
## Data and Power Connector
40
42
41
43
{% include screenshot.html source="/images/xv11-tutorial/lidar_data_scheme.png" %}
42
44
45
+
## Sensor Port Mode
46
+
47
+
I am assuming your data connector is connected to `port 1` (adjust commands otherwise).
48
+
49
+
You will have to put the sensor port in `other-uart` mode:
50
+
51
+
echo other-uart > /sys/class/lego-port/port0/mode
52
+
53
+
You can read and write to or from LIDAR at:
54
+
55
+
/dev/tty_in1
56
+
57
+
It is binary tty communication. More information in `Testing the LIDAR` section.
58
+
59
+
## Motor Port Mode
60
+
61
+
I am assuming your motor connector is connected to `port A` and it is the only motor.
62
+
63
+
With auto-detection (resistors) your motor interface is available at:
64
+
65
+
/sys/class/tacho-motor/motor0
66
+
67
+
If you decided to not solder the resistors in motor connector, you have to put the motor port in `dc-motor` mode:
68
+
69
+
echo dc-motor > /sys/class/lego-port/port4/mode
70
+
71
+
Then your motor interface will be available at:
72
+
73
+
/sys/class/dc-motor/motor0
74
+
75
+
In both cases (w/o resistors) you are limited to unregulated motor control.
76
+
43
77
## LIDAR Rotational Geometry
44
78
45
79
If you assume that XV11 LIDAR returns you the distance to the object you will have it *almost* right. To do it correctly take into account the rotational geometry of the LIDAR.
46
80
47
81
{% include screenshot.html source="/images/xv11-tutorial/lidar_rotational_geometry.png" %}
48
82
83
+
You may ignore the above and the reported distance will still be approximately correct.
84
+
You will introduce systematic error, dependent on angle, bounded by 25 mm on x and y.
85
+
Regardless, the LIDAR has also random error with variance dependent on distance, surface and reflection angle.
86
+
49
87
## Testing the LIDAR
50
88
51
89
You can use [xv11test] from the github repository to:
@@ -54,7 +92,8 @@ You can use [xv11test] from the github repository to:
54
92
- plot the LIDAR scan
55
93
- get idea how to communicate with the LIDAR
56
94
- get idea how to interpret the LIDAR output and apply geometric correction
57
-
- or use `xv11lidar.h` and `xv11lidar.c` as a simple C library to communicate with the LIDAR
95
+
- use `xv11lidar.h` and `xv11lidar.c` as a simple C library to communicate with the LIDAR
96
+
- run `xv11test` with `-raw` argument and pipe LIDAR data to your program (C, C# and Java examples included)
58
97
59
98
Go to repository and follow readme.md instructions.
0 commit comments