Virtual Reality Toolbox    

Running a Simulink Interface Example

In the demo directory for the Virtual Reality Toolbox, there is a Simulink model for a two-dimensional inverted pendulum. This model, which you can view in three dimensions with the toolbox, has an interactive set point and trajectory graph.

Before you can run this demo, you have to install MATLAB, Simulink, and the Virtual Reality Toolbox:

  1. In the MATLAB Command Window, type
  1. A Simulink window opens with the model for an inverted pendulum.

    The Virtual Reality Toolbox viewer opens with a 3-D model of the pendulum.

    Note Right-clicking in a virtual world displays a floating menu. From this menu, you can choose viewer settings and navigation modes. These settings include graphic quality and speed.

  1. In the Simulink window, from the Simulation menu, click Start. A Trajectory Graph window opens, and a simulation starts running.

  2. In the Virtual Reality Toolbox viewer window, point to a position on the blue surface and left-click.
  1. The pendulum set point, represented by the green cone, moves to a new location. Next, the path is drawn on the trajectory graph, and then the pendulum itself moves to the new location.

    In the Virtual Reality Toolbox viewer window you see the animated movement of the pendulum. Use the viewer controls to navigate through the virtual world, change the viewpoints, and move the set point. For more information about using the Virtual Reality Toolbox viewer controls, see Virtual Reality Toolbox Viewer.

  1. In the Simulink window, double-click the Trajectory Graph block.
  1. The Block Parameters: Trajectory Graph dialog box opens.

  1. From the Setpoint mode list, choose Mouse, then click OK.

  1. You can now use the trajectory graph as a 2-D input device to set the position of the pendulum.

  1. Move the mouse pointer into the graph area and click.
  1. The set point (red circle) for the pendulum position moves to a new location, and its trajectory is displayed as a blue line.

  1. In the Simulink window, from the Simulation menu, click Stop. Close the Virtual Reality Toolbox viewer window and close the Simulink window.

You can try other examples in Simulink Interface Examples, or you can start working on your own projects.


  Testing the Installation Running a MATLAB Interface Example