ARM开发板连接并使用Mid-40扫描仪

1.添加以太网信息
在这里插入图片描述
点击+,设置静态ip
在这里插入图片描述
2.连接扫描仪,并连接到事先设置好的Mid网络。
3.安装必要的包
在运行数据采集程序前需要安装keyboard、serial、crcmod、tqdm、laspy、deprecated、pyserial包,命令如下:

yy@yy:~$ cd '/media/yy/work/OpenPyLivox-used' 
pip3 install keyboard -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install serial -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install crcmod -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install tqdm -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install laspy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install deprecated -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pyserial -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

随后运行 python3 main.py

Using computer IP address: 192.168.1.50

   *** Discovered a Livox sensor ***
           Type: Mid-40 
         Serial: 0TFDH590067M23
          IP(s): 192.168.1.23  (ID: 1)
                 
Attempting to auto-connect to the Livox Mid-40  with S/N: 0TFDH590067M23
Connected to the Livox Mid-40  at IP: 192.168.1.23 (ID: 1)
      Computer IP Address:    192.168.1.50
      Sensor IP Address(es):  ['192.168.1.23']
      Data Port Number(s):    ['40864']
      Command Port Number(s): ['39335']
   192.168.1.23      -->     F/W Version: 03.08.0000
   192.168.1.23      -->     Serial # 0TFDH590067M23
   192.168.1.23      <--     sent lidar spin up request
   192.168.1.23      -->     lidar is ready
   192.168.1.23      <--     sent start data stream request
   192.168.1.23      <--     sent update UTC request
   192.168.1.23      <--     sent dual return lidar mode request
   192.168.1.23      <--     sent stop IMU data push request
   192.168.1.23      <--     sent turn on rain/fog suppression request
   192.168.1.23      -->     CAPTURING DATA...
   192.168.1.23      -->     writing real-time data to BINARY file: 20210512-095217

注:
可能会出现以下情况:
1)根据提示keyboard库需要在root权限下使用,因此在采集数据前切换到root

File "/home/yy/.local/lib/python3.6/site-packages/keyboard/_nixcommon.py", line 174, in ensure_root
    raise ImportError('You must be root to use this library on linux.')
ImportError: You must be root to use this library on linux.

2)根据程序,我们自己定义的扫描终止热键为ctrl+q

def singleSCanerCapture():
    sflag = status()
    scanner = CSCanner()
    thread_scanner = threading.Thread(target=scanner.scanner_on)
    thread_scanner.daemon = True
    thread_scanner.start()
    # 监听到键盘事件ctrl+c 则停止扫描并掉电
    if not keyboard.wait('ctrl+q'):
        scanner.scanner_off()
        sflag.break_flag = True
        print("*"*30+"finished"+"*"*30)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值