# Add collission geometry to prismatic joint

4 views (last 30 days)
Lukas Schroth on 1 May 2022
Commented: Lukas Schroth on 25 May 2022
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 CommentsShowHide 1 older comment
Lukas Schroth on 2 May 2022
Hi Karsh,
Yes exactly, or another possibility to use colission checking in case of an prismatic joint.

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);
body1=getBody(rbt,"body1");
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;
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
Lukas Schroth on 25 May 2022
Thank you very much, it helped!

### Categories

Find more on Robotics in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!