Add Sensors to Virtual Worlds

You can set up an interface in a Simulink® block diagram to sensors in a virtual reality scene. You can also input signals programmatically from the virtual world into a simulation model.

Virtual reality scenes can contain sensors, which are nodes that generate events and output values depending on time, navigation, and actions and distance changes in the scene. These nodes add interactivity to the virtual world. The virtual world sensors resemble real world sensors, such as ultrasonic, LIDAR, and touch sensors. You can use Simulink 3D Animation™ functions to read sensor field values into simulation models and control simulation based on the user interaction with the virtual scene.

You can use collision detection to accurately model physical constraints of objects in the real world, where generally two objects cannot be in the same place at the same time. You can use collision detection node outputs to:

  • Change the state of other virtual world nodes.

  • Apply MATLAB® algorithms to collision data.

  • Drive Simulink models.

For example, you can use geometric sensors for robotics modeling.

You can define these sensors in the scene.

CylinderSensorMaps pointer motion (for example, a mouse) into a rotation on an invisible cylinder that is aligned with the y-axis of the local coordinate system
PlaneSensorMaps pointing device motion into two-dimensional translation in a plane parallel to the z=0 plane of the local coordinate system.
ProximitySensorGenerates events when the viewer enters, exits, and moves within a region in space (defined by a box)
SphereSensorMaps pointing device motion into spherical rotation about the origin of the local coordinate system
TimeSensorGenerates events as time passes
TouchSensorTracks the location and state of the pointing device and detects when you point at geometry contained by the TouchSensor node parent group.
VisibilitySensorDetects visibility changes of a rectangular box as you navigate the world.
PointPickSensorUses point clouds to detect which of the points are inside colliding geometries
LinePickSensorUses ray fans or other sets of lines that detect the distance to the colliding geometries
PrimitivePickSensorPrimitive geometries (such as a cone, sphere, or box) that detect colliding geometries

See Also


Related Topics

Was this topic helpful?