VR Sink - Write data from Simulink model to virtual world

Library

Virtual Reality Toolbox

Description

The VR Sink block writes values from its ports to virtual world fields specified in the Block Parameters dialog box.

The VR Sink block cannot be compiled by the Real-Time Workshop software, but it can be used as a SimViewing device on the host computer.

This block is equivalent to the VR To Video block, except that its Show video output port is unchecked by default.

Data Type Support

A VR Sink block accepts all meaningful data types on input. The block converts these data types to natural VRML types as necessary. These data types include logicals, many types of signed and unsigned integers, singles, and doubles. The MATLAB and Simulink interfaces also accept matrices. For further details, see VRML Field Data Types.

Block Parameters Dialog Box

Source file — VRML file name specifying the virtual world this block is connected to. The View button allows you to view the world in the Virtual Reality Toolbox viewer or a Web browser. The Edit button launches an external VRML editor, and the Reload button reloads the world after you change it. By default, the full path to the associated .wrl file appears in this text box. If you enter only the filename in this box, the software assumes that the .wrl file resides in the same directory as the model file.

Open VRML Viewer automatically — If you select this check box, the default VRML viewer displays the virtual world after loading the Simulink model.

Allow viewing from the Internet — If you select this check box, the virtual world is accessible for viewing on a client computer. If it is not selected, the world is visible only on the host computer. This is equivalent to the RemoteView property of a vrworld object. See MATLAB Interface.

Description — Description that is displayed in all virtual reality object listings, in the title bar of the Virtual Reality Toolbox viewer, and in the list of virtual worlds on the Virtual Reality Toolbox HTML page. This is equivalent to the Description property of a vrworld object. See MATLAB Interface.

Sample time — Enter the sample time or -1 for inherited sample time.

Show video output port — This enables a port to output an RGB video stream for further 2D video processing.

Video output signal dimensions — Dimensions ([vertical horizontal]) of the video output signal in pixels (default is [200 320])

Setup and preview video output — Opens a figure window for navigation and viewing.

VRML tree — This box shows the structure of the VRML file and the virtual world itself.

Nodes that have names are marked with red arrows and can be accessed from the MATLAB interface. Nodes without names, but whose children are named, are also marked with red arrows. This marking scheme makes it possible for you to find all accessible nodes by traversing the tree using arrows. Other nodes have a blue dot before their names.

Fields with settable values have check boxes. Use these check boxes to select the fields you want the Simulink software to output values to. For every selected field, an input port is created in the block. Input ports are assigned to the selected nodes and fields in the order corresponding to the VRML file.

Fields whose values cannot be written (because their parent nodes do not have names, or because they are not of VRML data class eventIn or exposedField) have an X-shaped icon.

Show node types — If you select this check box, node types are shown in the VRML tree.

Show field types — If you select this check box, field types are shown in the VRML tree.

For an example of how to use the VR Sink block, see Foucault Pendulum Model with Virtual Reality Scene.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS