MATLAB 帮助中心
停止从 Velodyne LiDAR 传感器流式传输点云
stop(lidarobj)
Add-On Required: 此功能需要
stop(lidarobj) 停止从 lidarobj 指定的 Velodyne LiDAR® 传感器流式传输点云。现有点云继续存在于缓冲区中。
lidarobj
示例
全部折叠
PointCloud
此示例说明如何创建一个到 NVIDIA® Jetson™ 平台上的 Velodyne LiDAR 传感器的连接,并从该传感器捕获 PointCloud 帧。
使用 jetson 函数创建一个从 MATLAB® 软件到 NVIDIA 硬件的实时硬件连接。要创建一个实时硬件连接对象,请提供目标板的主机名或 IP 地址、用户名和密码。例如,
jetson
hwobj = jetson('jetson-board-name','ubuntu','ubuntu');
创建一个 MATLAB 入口函数以从 Velodyne LiDAR 传感器捕获 PointCloud 帧。
function outStruct = readPointCloudFrame(mdlName,calibFile,port) %#codegen % Create hwobj hwobj = jetson(); % % Create Velodyne Lidar Object for 'VLP16' make obj = velodynelidar(hwobj,mdlName,calibFile,'Port',port); % Start Receiving LiDAR Packets start(obj); if strcmp(mdlName,'VLP16') lenOut = 120; outStructLen = 28000; else lenOut = 70; outStructLen = 48000; end % timePause = uint8(1); outStruct = cell(2,lenOut); for i=1:lenOut outStruct{1,i} = zeros(outStructLen,3); outStruct{2,i} = zeros(outStructLen,1,'uint8'); end for i=1:lenOut % Read a Point Cloud frame pcFrame = read(obj); outStruct{1,i} = pcFrame.Location(1:min(pcFrame.Count,outStructLen),:); outStruct{2,i} = pcFrame.Intensity(1:min(pcFrame.Count,outStructLen)); pause(0.1); end % Stop receiving LiDAR Packets stop(obj); % xyz = pcFrame.Location; % Intensity = pcFrame.Intensity; end
注意
该入口函数不能有多个连接到 Velodyne LiDAR 传感器的连接对象。
将 readPointCloudFrame 入口函数部署到 NVIDIA Jetson 平台
readPointCloudFrame
sensorModel = coder.Constant('VLP16'); port = 2368; calibrationFile = coder.Constant(fullfile(pwd,'VLP16CalibFile.xml')); cfg = coder.config('exe'); cfg.Hardware = coder.hardware('NVIDIA Jetson'); cfg.GenerateExampleMain = "GenerateCodeAndCompile"; codegen -config cfg -args {sensorModel,calibrationFile,port} readPointCloudFrame
velodynelidar
使用 velodynelidar 创建的 Velodyne LiDAR 传感器连接,指定为 velodynelidar 对象。
全部展开
在 R2020b 中推出
read
start
drive
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处