Skip to content

Commit

Permalink
Python示例增加TEA
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanyiaini committed Jan 12, 2024
1 parent dde846c commit 190d650
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ add_subdirectory(src)
##############################
#build examples
if(BUILD_EXAMPLES)
add_subdirectory(samples)
add_subdirectory(examples)
endif()

#############################################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions python/examples/tea_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import ydlidar
import time
import sys

if __name__ == "__main__":
ydlidar.os_init();
port = "192.168.0.11";
laser = ydlidar.CYdLidar();
laser.setlidaropt(ydlidar.LidarPropSerialPort, port);
laser.setlidaropt(ydlidar.LidarPropSerialBaudrate, 8090);
laser.setlidaropt(ydlidar.LidarPropLidarType, ydlidar.TYPE_TOF);
laser.setlidaropt(ydlidar.LidarPropDeviceType, ydlidar.YDLIDAR_TYPE_TCP);
laser.setlidaropt(ydlidar.LidarPropScanFrequency, 20.0);
laser.setlidaropt(ydlidar.LidarPropSampleRate, 20);
laser.setlidaropt(ydlidar.LidarPropSingleChannel, False);
laser.setlidaropt(ydlidar.LidarPropIntenstiy, True);
laser.setlidaropt(ydlidar.LidarPropMaxAngle, 180.0);
laser.setlidaropt(ydlidar.LidarPropMinAngle, -180.0);
laser.setlidaropt(ydlidar.LidarPropMaxRange, 50.0);
laser.setlidaropt(ydlidar.LidarPropMinRange, 0.01);

ret = laser.initialize();
if ret:
ret = laser.turnOn();
scan = ydlidar.LaserScan()
while ret and ydlidar.os_isOk() :
r = laser.doProcessSimple(scan);
if r:
print("Scan received[",scan.stamp,"]:",scan.points.size(),"ranges is [",1.0/scan.config.scan_time,"]Hz");
else :
print("Failed to get Lidar Data.")
time.sleep(0.05);
laser.turnOff();
laser.disconnecting();
File renamed without changes.

0 comments on commit 190d650

Please sign in to comment.