Simulating Mobile Robots (Robotics Module)

LabVIEW 2014 Robotics Module Help

Edition Date: June 2014

Part Number: 372983F-01

»View Product Info
Download Help (Windows Only)

Simulating a mobile robot that runs an embedded application allows you to design and debug the application without depending on the physical robot. When you simulate a robot, you can validate the mechanical structure of the robot, test algorithms that control it, and visualize the robot in an environment before you deploy and run the application on real hardware. In the LabVIEW Robotics Module, use the built-in robotics simulator to render a 3D simulation scene and model the motion of real robots in a real-world environment. You create robotics applications to run in the simulator similarly to how you design LabVIEW applications that run on real robots.

The following steps describe the process you use to simulate robots in LabVIEW.

  1. Design a simulated robot that you can use in a simulation scene.
  2. Design the simulation scene with the environment and robots you want to simulate.
  3. Write VIs to start the simulator and control simulated components.
  4. Run a master simulation VI to display the simulation as it runs.
  5. (Optional) Create an executable that displays the simulation so you can distribute it to other users.
  6. (Optional) Deploy the same VIs to a real hardware target

Overview of Robotics Simulation in LabVIEW

Robotics simulation programs in LabVIEW include the following items:

  • Robotics simulator—The simulator reads and displays simulation scenes you design, calculates realistic, physics-based properties of simulated components as they interact, and advances the time in the simulation. You start the simulator in a VI you write.
  • Simulation program—You create programs to run in the simulator. These programs contain the following components:
    • Manifest file—When you design a simulation environment and components, you save their definitions in a .xml file, called a manifest file. The simulator reads from manifest files to render the components they define.
      • Simulation scene—Each manifest file defines one simulation scene, a combination of simulated components and their properties. You can render one simulation scene at a time in the simulator. Simulation scenes contain the following components:
        • Environment—Each simulation instance must have an environment that describes the ground and any attached features. The environment also has associated physical properties, such as the surface material and force of gravity.
        • Robots—Robots can contain simulated sensors and actuators. Because sensors and actuators are not synchronous to the simulation programs, robots containing sensors and actuators do not act deterministically. The same input may result in different outputs.
        • Obstacles—Environments can contain obstacles that are separate from the environment and have their own associated properties.
    • VIs—You write VIs to control the simulator and simulated components. The VIs contain the same code to control simulated robots that embedded applications running on real robots might contain.
    • ID List—When you create a simulation project using the Robotics Environment Simulator Wizard, the project includes an ID list file under the simulation target. The ID list file is a .txt file that contains ID names of the simulated robot, the components of the robot, and the obstacles in the environment.
  • Display window—When you start the simulator, the simulation displays in a 3D picture control.

Overview of a Simulation Project

You might find it useful to organize simulation programs in LabVIEW projects. Projects group files and allow you to deploy them to hardware. Use the Robotics Environment Simulator Wizard to automatically generate a project similar to the one in the following screenshot, or create a similar project manually.

Note  You do not need to use a LabVIEW project to run the simulator and display a simulation scene. However, to use the Robotics Environment Simulator Wizard or create an executable you can distribute, you must use a project.

The previous LabVIEW project shows the following items:

  • Robotics Environment Simulator ()—Organizes the files that define and control components in a particular simulation scene. LabVIEW adds this item to a project when you use the Robotics Environment Simulator Wizard to create a simulation scene. Right-click this item in the Project Explorer window and select Properties from the shortcut menu to launch the wizard and modify components in the current simulation scene.
  • Robotics Environment Simulator ID List.txt—Contains the ID names of the components in the simulation scene you create. LabVIEW adds this item to a project when you use the Robotics Environment Simulator Wizard to create a simulation scene.
  • Robotics Environment—Starts and stops the simulator, serves as a user interface for the simulation, and calls LabVIEW code that manipulates components in the simulation.
  • Robotics Environment Simulator.xml—Serves as the manifest file that contains definitions for components in the simulation scene you create. LabVIEW adds this item to a project when you use the Robotics Environment Simulator Wizard to create a simulation scene.
    Note  Do not directly edit the contents of this manifest file to change the simulation scene. Instead, use the Robotics Environment Simulator Wizard or the Offline Configuration VIs to modify the scene.
  • subVIs—Organizes subVIs and any additional files you include to control the simulation scene.
  • Dependencies—Contains device driver VIs and other items that VIs in the project require. You cannot add items directly to Dependencies. Dependencies updates automatically when you add, remove, or save an item in the project.
  • Build Specifications—Includes build configurations for stand-alone applications.

In the simulation project folder, LabVIEW creates a resource (RSC) folder to store the resource files for simulation. When you rename the simulation target (), the names of the manifest file and the ID list file automatically change to match the target name. However, you need to manually update the resource folder. To create a new resource folder for the updated simulation target, select the target in the Project Explorer window, right-click the target, and select Properties from the shortcut menu to launch the wizard. Save the simulator from the wizard and LabVIEW creates a NewNameRSC folder in the same directory that you save the manifest file.

Recommendations for Simulating Robots

The following list describes some of the caveats and recommendations to consider when you run the robotics simulator:

  • Run only one simulation program at a time. If you start the simulator when another simulation program is running, LabVIEW returns error code –310192.
  • If you experience performance issues when you run a simulation on a single-core CPU, run the simulation on a multicore CPU to improve the performance.
  • Use step sizes to balance the performance of the simulator with its accuracy. When you start the simulator, you must specify a step size, in milliseconds, that defines the amount of time that elapses in the environment between updates the simulator makes to physical properties. Large step sizes result in less accurate real-world behavior. Smaller step sizes result in a simulation that more accurately models real-world behavior, but they require more processor resources.
  • Maintain a constant step size when you run a simulation.


Not Helpful