Grid Surface
Libraries:
Simscape /
Multibody /
Curves and Surfaces
Description
The Grid Surface block creates a Cartesian grid surface that you can use to model contact problems. You can model contacts between the grid surface and various types of geometries. For the supported geometries, see Supported Geometries. In addition, the Grid Surface block supports the Custom Tire Force and Torque and Magic Formula Tire Force and Torque blocks.
You must use the positive normal side of the grid surface for contact, which the positive z-axis of the reference frame points to. Otherwise, the block ejects the contacting part through the surface to the positive side.
The grid surface has a similar format to the grid generated by the ndgrid
function in MATLAB®. To model a grid surface, use the X Grid Vector and Y Grid Vector parameters to specify
the coordinates in the x and y directions of the
grid surface, then use the Z Heights parameter to specify
the elevations of the grid points in the z direction. You can use the
block to create a surface that represents a square, rectangular, or non-uniform
grid.
The image shows an illustration of a grid surface whose Z Heights
parameter is [0 0 0.5 0.5; 0 0 0.5 0.5; 0 0 0 0; 0 0 0 0]
. The
columns of the matrix are along the x-axis, and the rows of the
matrix are along the y-axis.
To create a grid surface using LiDAR data, you must convert the scattered data to gridded
data before using it in the Grid Surface block. To
convert the data, you can use a scatteredInterpolant
object to create an
interpolant function by using the x, y, and
z values of the LiDAR data, create x and
y grid vectors that represent the domain of the grid, and then
use the grid vectors as the query points of the interpolant function to produce
z values for the grid surface. The produced z
values form a matrix in the ndgrid
format that you can use to
specify the Z Heights parameter. You can also use the griddata
function to produce z values for a grid
surface, but you need to transpose the output matrix to the ndgrid
format.
Note
For the best simulation performance, make the spacing in the x
and y grid vectors as large as possible while also being small
enough to represent the surface with sufficient accuracy. To change the spacing of
the grid vectors and compute the corresponding z values , use the
griddedInterpolant
object or interp2
function.
Generally, you need to clean the LiDAR data before converting it to gridded data, such as
removing outliers or NaN values. To clean the data, use the isnan
and isoutlier
functions.
Examples
Ports
Frame
Geometry
Parameters
Version History
Introduced in R2021b
See Also
Spatial Contact
Force | Point Cloud | griddata
| isnan
| isoutlier
| scatteredInterpolant
| griddata
| griddedInterpolant
| interp2