Simulation of match_pm_robot in Unity.
The simulation encompasses all relevant functionalities of the real robot and therefore enables offline-programming.
Make sure you have Unity and ros2-for-unity installed.
You can find detailed instructions here: Installation
Open the project in Unity.
To start the simulation, do the following:
-
Start the opcua-server
ros2 run opcua_server opcua_server -
Start the unity simulation by entering the play mode
-
Start ros2
ros2 launch pm_robot_bringup pm_robot_unity_HW.launch.py
If the robot movements are not executed in the simulation, restart the simulation (game-mode on/off).
If the real robot has been modified, the simulation has to be adapted.
If hardware has been changed, you have to build a new model. You can find a detailed instruction here: Update Robot
To add new ros2-services, you find an instruction here: Add new Services
To build the project using OPC UA Newtonsoft.json package for Unity is required.
- Installation:
- Open Unity
- Open "Window" dropdown menu and open "Package Manager"
- In package manager click on "+" symobl and choose "Add package by name..."
- Enter "com.unity.nuget.newtonsoft-json" as package name, and "3.0.1" as version
- Click "add"
- Start Unity project from terminal
- With your Unity project open, click on the File tab at the top of the Unity window. Select Build Settings.
- A new window will open where you can specify the Platform of your game.
- In the Scenes In Build panel, select the scenes that you would like to include in your published game.
- At the bottom-left of the Build Settings window, click on Player Settings.
- Open the Player tab. Specify the company name, product name, and game version.
- Expand the Resolution and Presentation section and chose Fullscreen window under Fullscreen mode.
- Close Project settings window.
- Click on Build and specify build directory.