【机器人】基于缓冲的不确定性感知沃罗诺伊单元多机器人碰撞规避附Matlab代码
✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、算法改进、程序设计科研仿真。
🍎完整代码获取 定制创新 论文复现私信
🍊个人信条:做科研,博学之、审问之、慎思之、明辨之、笃行之,是为:博学慎思,明辨笃行。
🔥 内容介绍
基于缓冲的不确定性感知沃罗诺伊单元(Buffered Uncertainty-Aware Voronoi Cell,BUA-VC)多机器人碰撞规避,是一种用于多机器人系统中动态避碰的方法。具体介绍如下:
-
核心原理:该方法结合了 Voronoi 图的几何特性与机器人运动的不确定性建模,通过扩展传统 Voronoi 单元边界来确保安全距离。先量化 “不确定性”,通过感知误差建模和动态障碍物概率预测,确定机器人的感知误差及动态障碍物的位置范围等。然后,将传统 Voronoi 单元的边界 “向外扩展” 一个由 “机器人自身感知误差 + 相邻机器人感知误差 + 动态障碍物预测范围” 组成的 “缓冲距离”,构建缓冲 Voronoi 单元,形成碰撞避免的 “安全间隙”。并且,缓冲 Voronoi 单元会根据场景实时调整,如误差变大时缓冲区扩大,动态障碍物靠近时优先避让,任务紧急时优化缓冲策略等。
-
优势:该方法具有概率安全保证,通过统计学方法量化碰撞风险,优于固定距离的几何方法;具备动态适应性,可实时更新缓冲距离,适应机器人运动状态的变化;计算高效,基于 Voronoi 图的局部性质,仅需邻域机器人信息即可更新单元。
-
应用场景:适用于高动态、传感器噪声显著的环境,如物流仓库中 AGV 机器人搬运场景、工厂车间中协作机器人同步作业场景,以及室外无人机集群巡检场景等。
⛳️ 运行结果

📣 部分代码
%% initialization script% common pre-run set up for simulation and experiment%% Setup pathsetPath;%% Problem setupglobal pr% environment dimensionpr.dim = mode_dim; % problem dimensionxdim = [-5, 5]; % workspaceydim = [-5, 5];zdim = [ 0, 3];if pr.dim == 2pr.ws = [xdim; ydim];elseif pr.dim == 3zdim = [0, 10];pr.ws = [xdim; ydim; zdim];end% robot physicspr.robot_type = 0; % robot typepr.radius = 0.2; % robot radiuspr.maxSpeed = 0.4; % robot maximal speedpr.boundLocalRadius = 2.0; % local bound radius, m% simulation setuppr.dtSim = 0.1; % time step, spr.N = 10; % number of stagepr.ifSimRobotNoise = 1; % if simulating measurement noisepr.ifSimBoxObsNoise= 1;% collision probability thresholdpr.collision_probability = 0.10;pr.collision_parameter = erfinv(2*sqrt(1-pr.collision_probability) - 1);% BVC or BUAVCpr.method = mode_region; % 0 - BVC; 1 - BUAVCif pr.ifSimRobotNoise == 0pr.method = 0;fprintf('Simulate robot localization noise: No. \n');fprintf('Computation of safe region: BVC. \n');elsefprintf('Simulate robot localization noise: Yes. \n');if pr.method == 0fprintf('Computation of safe region: BVC. \n');elseif pr.method == 1fprintf('Computation of safe region: BUAVC. \n');elseerror('Safe region mode is not defined!');endendpr.control = mode_control; % 0 - one-step; 1 - mpcif pr.control == 0fprintf('Controller mode: Feedback reactive. \n');elseif pr.control == 1fprintf('Controller mode: MPC. \n');elseerror('Controller mode is not defined!');end% weightspr.weights = [0.0, 0.0; 1.0, 0.0]'; % w_pos, w_input, stage and terminal weights%% Simulation configurationglobal cfg% visualization setupcfg.ifShowHistoryTra = 1; % if plotting the history trajectory of the robotcfg.ifShowSafeRegion = 1; % if plotting the obstacle-free safe region for each robotcfg.ifShowVelocity = 0; % if plotting robot velocity%% Scenario setup% static obstaclesif pr.dim == 2vert_m = 4;[nBoxObs, boxPos, boxSize, boxYaw] = box_initial_2D(3);elseif pr.dim == 3vert_m = 8;[nBoxObs, boxPos, boxSize, boxYaw] = box_initial_3D(3);endboxVert = zeros(pr.dim, vert_m, nBoxObs);for iBox = 1 : nBoxObs[temp_vert, ~] = box2PolyVertsCons(pr.dim, boxPos(:, iBox), ...boxSize(:, iBox), boxYaw(:, iBox));boxVert(:, :, iBox) = temp_vert; % dim * m * nBoxObsend% multiple robot, robot initial and end position should not collide with each other and with obstaclesnRobot = 5; % number of robotscollision_mtx = ones(nRobot, nRobot+nBoxObs);while (sum(sum(collision_mtx)) > 0)fprintf('Generating robot initial positions and goals ... \n');if pr.dim == 2robotStartPos = robotStartPos_2D(nRobot, 3, pr.ws(1,:), pr.ws(2,:), pr.radius);% robotEndPos = robotStartPos_2D(nRobot, 2, pr.ws(1,:), pr.ws(2,:), pr.radius);robotEndPos = -robotStartPos; % robot final goal positionelseif pr.dim == 3robotStartPos = robotStartPos_3D(nRobot, 2, pr.ws(1,:), pr.ws(2,:), pr.ws(3,:), pr.radius);robotEndPos(1:2, :) = -robotStartPos(1:2, :); % robot final goal positionrobotEndPos(3, :) = zdim(1) + zdim(2) - robotStartPos(3, :);endcollision_mtx_start = collision_check(nRobot, nBoxObs, robotStartPos, 1.2*pr.radius, boxVert);collision_mtx_end = collision_check(nRobot, nBoxObs, robotEndPos, 1.2*pr.radius, boxVert);collision_mtx = [collision_mtx_start; collision_mtx_end];end% robot localization measurement noiserobotPosNoise = zeros(pr.dim, pr.dim, nRobot);for iRobot = 1 : nRobotrobotPosNoise(:, :, iRobot) = 0.10^2 * eye(pr.dim);end% obs localization measurment noiseboxPosNoise = zeros(pr.dim, pr.dim, nBoxObs);for iBox = 1 : nBoxObsboxPosNoise(:, :, iBox) = 0.10^2 * eye(pr.dim);endpr.nRobot = nRobot;pr.robotStartPos = robotStartPos;pr.robotEndPos = robotEndPos;pr.robotPosNoise = robotPosNoise;pr.nBoxObs = nBoxObs;pr.boxPos = boxPos;pr.boxSize = boxSize;pr.boxYaw = boxYaw;pr.boxPosNoise = boxPosNoise;%% For mpcsi_mpc_setup;
🔗 参考文献
🍅更多免费数学建模和仿真教程关注领取
DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)