Tutorial using ROS for ver.3

Overview

A human and a robot log in to the same virtual space. The human can give a cleanup instruction to the robot by pointing.

The human logs in to the virtual space using Windows + VR Headset.
The robot logs in to the virtual space using Windows + Ubuntu (ROS: Robot Operating System).

Humans and robots (ROS) are connected via the Internet and can communicate in the same virtual space.

CleanupUsingCloudAndVR_Overview.png

Prerequisites

Common prerequisites

Using networks is a common prerequisite for humans and robots.

Photon Unity Networking is used for the cloud, and the port numbers listed on the following page are used when connecting to the Internet.
Check whether the port is available beforehand.
https://doc.photonengine.com/en-us/realtime/current/connection-and-authentication/tcp-and-udp-port-numbers

Instead of the cloud, you can also build a Photon Server on your local network and use that.
Photon Server can only be installed on Windows.
https://doc.photonengine.com/en-us/server/current/operations/requirements

* Make sure that anti-virus software does not block communication.

Prerequisites for Human (VR)

Windows environment

Basic requirements for using SIGVerse assets are needed.

VR Headset

You need to meet the system requirements for the VR headset to work.
It has been tested with Oculus Quest 2 and VIVE Cosmos.
For VR devices other than these, you may need to do the SteamVR binding.
https://valvesoftware.github.io/steamvr_unity_plugin/tutorials/SteamVR-Input.html#binding-actions

You will also need to install Steam and SteamVR on your PC.
Download the installer from the official website and install it.

Please install Oculus Software to use Oculus Headsets. Oculus Link is also required.
Please install VIVE Software to use VIVE Headsets.

Prerequisites for Robot (ROS)

  • Windows environment and Ubuntu environment
    See here for details.

Environment Construction

The procedure on the human (VR) side and the procedure on the robot (ROS) side are the same.

When using the cloud, follow 4a.Build Cloud environment procedure.
When using a local server, follow 4b. Build Local server environment procedure.

1. Create Photon account

First you need to create a Photon account.
Create it according to the following procedure.

  1. Go to Photon official site.
  2. Create a Photon account.

2. Import Unity Assets

Import the required Unity assets.
For detailed instructions on how to import, please refer to the following link.
https://docs.unity3d.com/2020.2/Documentation/Manual/upm-ui-import.html

Import the SteamVR Plugin

  1. Go to the following page.
    https://assetstore.unity.com/packages/tools/integration/steamvr-plugin-32647
  2. Download and import the asset.
    Confirmed with version 2.7.3.
  3. Click [Ignore All] in the Valve.VR.SteamVR_UnitySettingsWindow.
    * Ignore is recommended at least for Color Space; setting it to Linear may change the color of the robot's sensor image.
    * The Color Space can be changed in [Edit]-[Project Settings...]-[Player]-[Other Settings]-[Rendering]-[Color Space].
    SteamVR_UnitySettingsWindow.png
  4. Click [Yes, Ignore All] in the Ignore All window.
  5. Click [Edit]-[Project Settings...].
  6. Check [XR Plug-in Management]-[Plug-in Providers]-[OpenVR Loader].
    * Do NOT check the [Initialize XR on Startup] checkbox.

Import the PUN 2 - FREE (Photon Unity Networking)

  1. Go to the following page.
    https://assetstore.unity.com/packages/tools/network/pun-2-free-119922
  2. Download and import the asset.
    Confirmed with version 2.33.3.
    The following should be unchecked when importing because these conflicts with other libraries.
    • Photon/PhotonLibs/WebSocket/websocket-sharp.dll
    • PhotonUnityNetworking/Demos
    • SteamVR
      ImportPUN.png
  3. In the "PUN Setup" window, please [Skip] and then [Close].

3. Using SteamVR and PUN libraries

  1. Click [SIGVerse]-[SIGVerse Settings] to open the SIGVerse settings.
  2. Check [Use SteamVR] and [Use PUN] in [Define symbols Settings].
SIGVerseSettingsSteamVRPUN.png

4a. Build Cloud environment

The free plan of Photon Cloud can connect up to 20 people at the same time. See the next page for details.
https://www.photonengine.com/en-US/pun/pricing

The cloud environment construction procedure is as follows:

  1. Sign in to Photon official site.
  2. Get application ID.
    1. Click [CREATE A NEW APP] button on the dashboard after signing in.
    2. Set [Photon Type] to "Photon PUN" and set the application name. (For example, the application name is "CleanupVR")
    3. Click [CREATE] button.
    4. Check that the PUN app is added to the dashboard app list, and write down the "App ID".
      (The App ID is 36 digits. Click to display all digits.)
      PhotonAppId.png
  3. Configure the PUN settings.
    1. Open the SIGVerse project in Unity.
    2. Click [Window]-[Photon Unity Networking]-[PUN Wizard].
    3. Click [Locate PhotonServerSettings].
    4. Enter the above "App ID" in the "App Id PUN" field.
      PhotonServerSettingsForCloud.png
  4. Click [Assets]-[Reimport All] in the Unity menu.
  5. Click [Reimport] button to rebuild.

4b. Build Local server environment

You can also use Photon Server on a local network instead of the cloud.

  1. Sign in to Photon official site.
  2. Install Photon Server.
    1. Access Photon Server page.
    2. Click the version number to the right of "Download SDK" to download the zip file.
    3. Extract the downloaded file to the directory you want to install.
    4. Go to the following page and download the license file for a "100 CCU" license.
      https://dashboard.photonengine.com/selfhosted
    5. Copy the downloaded license file ([Mail Address].Photon-vX.free.100-ccu.license) to the "\deploy\bin_Win64" folder in the Photon server folder.
    6. If you want to provide the service to external machines, please set the PublicIPAddress in GameServer.xml.config.
      (If you are using the service only on your local machine, do not make the following settings)
      Set the PublicIPAddress in \deploy\LoadBalancing\GameServer\bin\GameServer.xml.config.
      If you set PublicIPAddress to blank, the IP address will be recognized automatically. Please refer to the following URL for details.
      https://doc.photonengine.com/en-us/server/current/applications/loadbalancing/application#deploying_a_game_server
  3. Start Photon Server. (After restarting Windows, you will need to start the Photon Server again.)
    1. Double-click PhotonControl.exe in the "\deploy\bin_Win64" folder to start the application.
      (App icon appears on the Windows taskbar)
    2. Click [LoadBalancing (MyCloud)]-[Start as application] to start Photon Server.
  4. Configure the PUN settings.
    1. Open the SIGVerse project in Unity.
    2. Click [Window]-[Photon Unity Networking]-[PUN Wizard].
    3. Click [Locate PhotonServerSettings].
    4. Make the following settings.
      • Uncheck [Use Name Server]
      • Enter the IP address of Photon Server in [Server]
      • Enter "5055" in [Port].
        PhotonServerSettingsForLocalServer.png
  5. Click [Assets]-[Reimport All] in the Unity menu.
  6. Click [Reimport] button to rebuild.

Execution Procedure

If you want to run as a human (VR), please follow here.

If you want to run as a robot (ROS), please follow here.

It doesn't matter which one you run first, but if you want to use a local server, please Launch Photon Server first.

Note

If you try to use VMware to run the human side and the robot side on a single PC, the app may crash.
This is because the built executable will try to use VR even when running the robot side. (As of July 15, 2021)
https://github.com/ValveSoftware/unity-xr-plugin/issues/80

To solve this problem, you may need to run the robot side in the Unity editor or remove "xrsdk-pre-init-library=XRSDKOpenVR" from boot.config.

Human (VR) Execution procedure

Startup Procedure

* If you want to use a local server, please Launch Photon Server first.

Windows startup procedure

  1. Launch SteamVR and the VR software to make the VR headset ready for use.
  2. Start the [Assets/SIGVerse/ExampleScenes/HSR/HsrCleanupVR(.unity)] scene with reference to here.
  3. Click the [Human] button to log in as a human.
  4. If the robot is not logged in, wait for the robot to log in.

Windows (Login Screen)

HSRCleanupVRLogin.png

Run

Operate the human avatar and give cleanup instructions to the robot.

The basic flow is as follows.

  1. Send the message "Pick it up!" to the robot while pointing at the target object.
  2. Send the message "Clean up!" to the robot while pointing at the destination.

The operation of the VR controller is as follows.

  • When pull the trigger, the avatar's hand will be in the pointing position.
  • When the front button is pressed, the message "Pick it up!" is sent to the robot. (A or X button for Oculus Touch)
  • When the back button is pressed, the message "Clean up!" is sent to the robot. (B or Y button for Oculus Touch)
  • When you tilt the left stick, the avatar moves in the tilted direction.
  • When the right stick is pressed, the message "Good!" is sent to the robot.
  • When the left stick is pressed, the message "Bad!" is sent to the robot.

Windows (The details may differ from the latest version)

HSRCleanupVRHuman.png

Reference Video

Robot (ROS) Execution procedure

Startup Procedure

* If you want to use a local server, please Launch Photon Server first.

Start the Ubuntu side and then the Windows side.

Ubuntu side startup procedure

Open a new terminal and run the following command:

$ roslaunch sigverse_hsr_teleop_key teleop_key.launch

To start rviz, execute the following command.

$ roslaunch sigverse_hsr_teleop_key teleop_key_with_rviz.launch

Windows startup procedure

  1. Start the [Assets/SIGVerse/ExampleScenes/HSR/HsrCleanupVR(.unity)] scene with reference to here.
  2. Click the [Robot] button to log in as a robot.
  3. If a human is not logged in, wait for the human to log in.

Windows (Login Screen)

HSRCleanupVRLogin.png

Run

You can control HSR by keyboard operation on the teleop_key.launch terminal.

Operate the robot and grasp one of the objects on the desk, then bring it to the place where the human points.

* Check the terminal for details of the operation.

If you want to finish, stop the Unity side and then the ROS side.

Ubuntu side (The details may differ from the latest version)

HSRCleanupVRRobotUbuntu.png

Windows side (Logged in) (The details may differ from the latest version)

HSRCleanupVRRobotWindows.png

Reference Video


Counter: 1378, today: 8, yesterday: 0

Tutorial for ver.3


Attach file: fileSteamVR_UnitySettingsWindow.png 34 download [Information] fileImportPUN.png 25 download [Information] fileSIGVerseSettingsSteamVRPUN.png 32 download [Information] fileCleanupUsingCloudAndVR_Overview.png 18 download [Information] filePhotonServerSettingsForLocalServer.png 20 download [Information] filePhotonServerSettingsForCloud.png 19 download [Information] fileHSRCleanupVRRobotWindows.png 255 download [Information] filePhotonAppId.png 313 download [Information] fileHSRCleanupVRRobotUbuntu.png 293 download [Information] fileHSRCleanupVRLogin.png 323 download [Information] fileHSRCleanupVRHuman.png 300 download [Information]

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2021-08-19 (Thu) 04:23:47 (29d)