(string[] args)
| 5 | class Program |
| 6 | { |
| 7 | static void Main(string[] args) |
| 8 | { |
| 9 | ydlidar.os_init(); |
| 10 | CYdLidar lidarClass = new CYdLidar(); |
| 11 | string port = "COM7"; |
| 12 | int optname = (int)LidarProperty.LidarPropSerialPort; |
| 13 | lidarClass.setlidaropt(optname, port); |
| 14 | optname = (int)LidarProperty.LidarPropSerialBaudrate; |
| 15 | lidarClass.setlidaropt(optname, 512000); |
| 16 | |
| 17 | optname = (int)LidarProperty.LidarPropLidarType; |
| 18 | |
| 19 | int lidarType = (int)LidarTypeID.TYPE_TOF; |
| 20 | lidarClass.setlidaropt(optname, lidarType); |
| 21 | |
| 22 | |
| 23 | bool ret = lidarClass.initialize(); |
| 24 | if(ret) |
| 25 | { |
| 26 | ret = lidarClass.turnOn(); |
| 27 | } else |
| 28 | { |
| 29 | Console.WriteLine("error:" + lidarClass.DescribeError()); |
| 30 | } |
| 31 | LaserScan scan = new LaserScan(); |
| 32 | while (ret && ydlidar.os_isOk()) |
| 33 | { |
| 34 | if(lidarClass.doProcessSimple(scan)) |
| 35 | { |
| 36 | Console.WriteLine("stamp: "+ scan.stamp + ", size: " + scan.points.Count); |
| 37 | } |
| 38 | } |
| 39 | lidarClass.turnOff(); |
| 40 | lidarClass.disconnecting(); |
| 41 | lidarClass.Dispose(); |
| 42 | |
| 43 | } |
| 44 | } |
| 45 | } |
nothing calls this directly
no test coverage detected