机器人碰撞检测——生成无碰撞轨迹
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                机器人碰撞检测——生成无碰撞轨迹
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                為了避免這些碰撞,添加中間路徑點,以確保機器人繞過障礙物。
intermediatePose1 = trvec2tform([-.3 -.2 .6])*axang2tform([0 1 0 -pi/4]); % Out and around the sphere intermediatePose2 = trvec2tform([0.2,0.2,0.6])*axang2tform([1 0 0 pi]); % Come in from aboveintermediateConfig1 = ik("EndEffector_Link",intermediatePose1,weights,q(:,collidingIdx1)); intermediateConfig2 = ik("EndEffector_Link",intermediatePose2,weights,q(:,collidingIdx2));% Show the new intermediate poses ax = exampleHelperVisualizeCollisionEnvironment(worldCollisionArray); show(robot,intermediateConfig1,"Parent",ax,"PreservePlot",false); show(robot,intermediateConfig2,"Parent",ax);然后生成一個新的軌跡
?
[q,qd,qdd,t] = trapveltraj([homeConfiguration(robot),intermediateConfig1,startConfig,intermediateConfig2,endConfig],200,"EndTime",2);驗證生成的新軌跡是無碰撞的
%Initialize outputs inCollision = false(length(q),1); % Check whether each pose is in collision for i = 1:length(q)inCollision(i) = checkCollision(robot,q(:,i),worldCollisionArray,"IgnoreSelfCollision","on"); end isTrajectoryInCollision = any(inCollision)計算出的結(jié)果為:
isTrajectoryInCollision = logical0可視化生成的軌跡:
% Plot the environment ax2 = exampleHelperVisualizeCollisionEnvironment(worldCollisionArray);% Visualize the robot in its home configuration show(robot,startConfig,"Parent",ax2);% Update the axis size axis equal% Loop through the other positions for i = 1:length(q)show(robot,q(:,i),"Parent",ax2,"PreservePlot",false);% Update the figure drawnow end?畫出隨時間變化的關(guān)節(jié)位置:
figure plot(t,q) xlabel("Time") ylabel("Joint Position")?
總結(jié)
以上是生活随笔為你收集整理的机器人碰撞检测——生成无碰撞轨迹的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 计算机共享的媒体设备,多台计算机、手机和
- 下一篇: Redisson(4)分布式锁之RedL
