禾赛激光雷达调试


环境
Ubuntu 18.04
ROS Melodic
pandarview软件安装包和ros程序

硬件
禾赛 XT32M2X 激光雷达

驱动和pandarview百度网盘下载链接
链接: https://pan.baidu.com/s/1SrauBjtu9COeMB_QbE2twQ 提取码: luib
–来自百度网盘超级会员v5的分享
建议从github上下载最新的ROS驱动包
https://github.com/HesaiTechnology/HesaiLidar_General_ROS

说明书下载链接
https://download.csdn.net/download/qq_38768959/85023927

一、配置IP

将雷达通过网线连接电脑
打开终端

ifconfig

雷达的数据量较大,如果不知道雷达的IP是哪个,可以看下每个IP的数据的接收量,一般每秒增加十几兆左右的那个就是雷达的IP,如下图中的eth0.
请添加图片描述

用以下命令配置ip

sudo ifconfig eth0 192.168.1.100

检查和雷达的通信是否成功

ping 192.168.1.201

如果成功,如下:
请添加图片描述

二、使用pandarview查看点云

下载安装包,可在网盘下载,解压后./执行下面的二进制文件即可安装
请添加图片描述

安装完成后会在home目录下生成一个PandarView_Release文件夹,如下:

请添加图片描述
在该文件夹下./执行PandarView即可启动PandarView软件,然后点击下图图标
请添加图片描述
点击OK
请添加图片描述
就可以看点云
请添加图片描述

三、使用RVIZ查看点云

安装环境

sudo apt install libpcap-dev libyaml-cpp-dev
sudo apt-get update

如果报错

W: An error occurred during the signature verification. The repository
is not updated and the previous index files will be used. GPG error:
http://packages.ros.org/ros/ubuntu bionic InRelease: The following
signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics
info@osrfoundation.org W: Failed to fetch
http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease The
following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open
Robotics info@osrfoundation.org W: Some index files failed to
download. They have been ignored, or old ones used instead.

执行下面两条命令:

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

如果报网络下载失败的错,可以把源换成清华源
执行

cd /etc/apt
sudo cp sources.list sources.list.bak
sudo gedit sources.list

更换内容为

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted

如果报错

E: GPG error: file:/var/visionworks-repo Release: Signed file isn’t
valid, got ‘NODATA’ (does the network require authentication?) E: GPG
error: file:/var/visionworks-sfm-repo Release: Signed file isn’t
valid, got ‘NODATA’ (does the network require authentication?) E: GPG
error: file:/var/visionworks-tracking-repo Release: Signed file isn’t
valid, got ‘NODATA’ (does the network require authentication?)

执行

sudo rm /etc/apt/sources.list.d/***.list
sudo apt-get update -y

然后再执行sudo apt-get update

如果没问题然后继续执行

sudo apt-get install python-catkin-tools
mkdir -p rosworkspace/src
cd rosworkspace/src

将ROS包放到src目录下,我这里用的1.1.12版本的,可在网盘或github下载.如下:
请添加图片描述
cd到rosworkspace目录下

cd ..

编译

 catkin_make -DCMAKE_BUILD_TYPE=Release

如果编译过程中报错

No rule to make target
‘usr/lib/aarch64-linux-gnu/libvtkGUISupportQtWebkit-6.3.so.6.3.0’,
needed by ‘…’. Stop.

原因是libvtkGUISupportQtWebkit-6.3.so.6.3.0失去了目标链接库,重新建立链接即可。
执行

sudo ln -s /usr/lib/aarch64-linux-gnu/libvtkCommonCore-6.3.so /usr/lib/aarch64-linux-gnu/libvtkGUISupportQtWebkit-6.3.so.6.3.0

然后继续编译,编译成功后执行

source devel/setup.bash
roslaunch hesai_lidar hesai_lidar.launch lidar_type:="PandarXTM" frame_id:="PandarXTM"

执行成功后如下:
请添加图片描述
打开rviz:

rviz

添加话题
请添加图片描述
双击PointCloud2
请添加图片描述
将Fixed Frame改成之前启动launch文件后终端上显示的/hesai/hesai_lidar/frame_id
请添加图片描述
即可看到雷达的三维点云

请添加图片描述

四、网页控制

按照前面正确设置IP后,输入网址:192.168.1.201
就可以通过网页进行设置
在这里插入图片描述

### 激光雷达 PCAP 文件中的点云数据格式解释 科技生产的激光雷达设备所生成的PCAP文件包含了网络抓包的数据流,这些数据流记录了由激光雷达传感器捕获的时间戳以及反射强度等信息。对于激光雷达而言,其特有的PCAP文件结构不仅保存了原始的扫描帧头信息还保留了每一束激光返回的具体参数。 具体来说,在激光雷达产生的PCAP文件里,每一条记录代表一次完整的360度水平方向上的扫描结果,即一帧点云数据。该条目通常会包含以下字段: - **时间戳**:表示当前帧被捕捉到的确切时刻。 - **角度分辨率**:指定了相邻两次测量之间的角间距。 - **通道数**:对应于垂直维度上不同高度位置处发射光线的数量。 - **距离值**:反映了目标物体离传感器的距离;此数值可能经过校准处理以提高精度。 - **信号强度/回波幅度**:描述了接收到光脉冲的能量大小,可用于区分材料属性或表面特性[^1]。 为了能够读取并解析来自激光雷达的PCAP文件,开发者们往往需要依赖特定库函数的支持,比如`libpcap`用于基本封包操作而`PCL(Point Cloud Library)`则提供了高级别的点云计算功能。然而,在某些情况下可能会遇到缺少必要的开发环境配置而导致编译失败的情况,如找不到`pcap.h`这样的报错提示就表明系统中未安装相应的软件包[^3]。 当涉及到实际应用层面时,可以采用Python脚本配合第三方模块(例如pyshark、scapy)来实现对上述提到的各种要素的有效提取与转换工作。下面给出一段简化版的例子展示如何初步加载并查看LiDAR PCAP文件的内容片段: ```python from scapy.all import * import struct def parse_hesai_pcap(pcap_file): packets = rdpcap(pcap_file) for packet in packets: # 假设我们只关心UDP负载部分作为有效载荷 payload = bytes(packet[UDP].payload) while len(payload)>0: block_size, channel_num, azimuth = struct.unpack('<H H h', payload[:6]) print(f"Azimuth Angle: {azimuth}, Channel Number: {channel_num}") # 跳过已解码的部分继续下一个block payload = payload[block_size:] parse_hesai_pcap('path/to/hesai_lidar.pcap') ```
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超维空间科技

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值