号令行键入:
w = vrworld('vrcollisions');
号令行键入:
open(w);
号令行键入:
fig = view(w, '-internal');
号令行键入:
col = vrnode(w,'Collision_Sensor')
号令行键入:
rob = vrnode(w,'Robot')
号令行键入:
color = vrnode(w,'Robot_color')
号令行键入:
col.isActive
for ii = 1:30
% Move robot
rob.translation = rob.translation + [0.05 0 0];
vrdrawnow
% If collision is detected, change color to red.
if col.isActive
color.diffuseColor = [1 0 0];
end
end
0 篇文章
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!