File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,10 @@ def publish_scan(self, frame: bytes) -> None:
116116 msg .angle_min = math .radians (fsa )
117117 msg .angle_max = math .radians (lsa )
118118 msg .angle_increment = math .radians (step )
119- msg .range_min = 0.0
120- msg .range_max = float ( 0x3FFF )
119+ msg .range_min = 0.02 # radius of scanner head is 2 cm
120+ msg .range_max = 10.0 # assumed
121121 # time between full 360 sweep: approx 6 rotations per second
122- msg .scan_time = 1.0 / 6
122+ msg .scan_time = 1.0 / 5.8
123123 # time between rays: 6 fps, 36*16 rays per scan
124124 msg .time_increment = msg .scan_time * 10 / (360 * 16 )
125125
@@ -128,7 +128,7 @@ def publish_scan(self, frame: bytes) -> None:
128128 dist = (frame [idx ] + (frame [idx + 1 ] << 8 )) & 0x3FFF
129129 intensity = frame [idx + 2 ]
130130 idx += 3
131- msg .ranges .append (float ( dist ))
131+ msg .ranges .append (dist / 1000.0 ) # normalize to meters
132132 msg .intensities .append (float (intensity ))
133133
134134 self .publisher .publish (msg )
You can’t perform that action at this time.
0 commit comments