Add collission geometry to prismatic joint
3 views (last 30 days)
Show older comments
Hey all,
I need to add collision meshes to my robot which has one prismatic degree of freedom.
Is there any possibility to add a colission Mesh to the Body that "expands" with the prismatic joint. If I add one to the corresponding body it cannot cover the whole arm when it is extended.
Any Ideas or workarounds are welcome, thanks in advance!!
Yours,
Lukas
2 Comments
Karsh Tharyani
on 2 May 2022
Hi Lukas,
Correct me if I am wrong, but are you looking for a deformable collision geometry on a rigid body?
Karsh
Answers (1)
Karsh Tharyani
on 2 May 2022
Edited: Karsh Tharyani
on 2 May 2022
Hi Lukas,
A rigid body, by definition, can't deform, hence it doesn't have a deformable collision geometry. A prismatic joint (specified via a "rigidBodyJoint") defines a constraint on the relative motion between two bodies, and doesn't actually hold a collision geometry.
You can add a collision geometry on a body, and self-collisions will be ignored between bodies on adjacent indices. Please refer to the following example which demonstrates planning for a rigid body tree with a prismatic and a revolute joint using "manipulatorRRT".
%% An example rigid body tree
rbt=twoJointRigidBodyTree("row");
body2=getBody(rbt,"body2");
prismaticjnt=rigidBodyJoint("j1","prismatic");
prismaticjnt.JointAxis=[1,0,0];
setFixedTransform(prismaticjnt,trvec2tform([0.5,0,0]));
replaceJoint(rbt,"body2",prismaticjnt);
addCollision(body2,"cylinder",[0.01,0.5],trvec2tform([0.25,0,0])*eul2tform([0,pi/2,0]));
body1=getBody(rbt,"body1");
addCollision(body1,"cylinder",[0.01,0.5],trvec2tform([0.25,0,0])*eul2tform([0,pi/2,0]));
show(rbt,"Collisions","on");
%% Add an obstacle to the environment
sphere=collisionSphere(0.1);
sphere.Pose=trvec2tform([0.7,0.7,0.1]);
env={sphere};
%% Plan between two joint configurations
planner=manipulatorRRT(rbt,env);
plannedpath=plan(planner,[0,0],[pi/2,-0.5]);
interpolatedPlan=interpolate(planner,plannedpath);
%% Visualize planned path
hold on;
show(env{1});
view([0,90])
for i = 1:size(interpolatedPlan,1)
show(rbt,interpolatedPlan(i,:),"Collisions","on","FastUpdate",true,"PreservePlot",false);
drawnow;
end
hold off;
I hope the above answers your query.
If you have a specific use case where deformable collision geometries are required, please don't hesitate to reach Technical Support and share your use case.
Best,
Karsh
See Also
Categories
Find more on Assembly in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!