Create collision cylinder geometry
collisionCylinder to create a cylinder collision geometry
centered at the origin.
Radius of cylinder, specified as a positive scalar. Units are in meters.
Length of cylinder, specified as a positive scalar. Units are in meters.
eye(4)(default) | real-valued matrix
Pose of the collision geometry relative to the world frame, specified as a 4-by-4 homogeneous matrix. You can change the pose after you create the collision geometry.
|Show collision geometry|
Create a cylinder collision geometry centered at the origin. The cylinder is 4 meters long with a radius of 1 meter.
rad = 1; len = 4; cyl = collisionCylinder(rad,len)
cyl = collisionCylinder with properties: Radius: 1 Length: 4 Pose: [4x4 double]
Visualize the cylinder.
Create a homogeneous transformation that corresponds to a clockwise rotation of radians about the y-axis. Set the cylinder pose to the new matrix. Show the cylinder.
ang = pi/4; mat = axang2tform([0 1 0 ang]); cyl.Pose = mat; show(cyl)