Use the getCapsules function to see if the end effector, "tool0", has any collision capsules. Because tool0 is just a frame, it has no collision mesh to approximate as a collision capsule.
capsulesTool = getCapsules(capsIRB,"tool0")
capsulesTool =
1x0 empty cell array
Add a capsule to tool0, at a position 0.15 meters along the x-axis, with a radius of 0.15 and a length of 0.
ans =
collisionCapsule with properties:
Radius: 0.1500
Length: 0
Pose: [4x4 double]
Remove the capsule from the base link. Then, reduce the collision capsule size of tool0, and move it -0.05 meters from the previous position along the x-axis.
capapprox — Capsule approximation of rigid body tree capsuleApproximation object
Capsule approximation of a rigid body tree, specified as a
capsuleApproximation object.
bodyname — Name of rigid body string scalar | character vector
Name of the rigid body, specified as a string scalar or character vector. The rigid
body must exist in the rigidBodyTree object of the
RigidBodyTree property of capsapprox.
Example: "EndEffectorTool"
Data Types: char | string
idx — Index of collision capsule in rigid body nonnegative integer
Index of the collision capsule in the rigid body, specified as a nonnegative integer.
Example: 5
pose — Updated pose for collision capsule 4-by-4 matrix
Updated pose for the collision capsule, specified as a 4-by-4 homogeneous
transformation matrix defined with respect to the frame of the rigid body
bodyname.
Example: eye(4)
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.