Skip to content

benef23/RoboyVR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#roboyVR™

RoboyVR techdemo

How it works:
Roboy and its behavior is simulated on the virtual machine via ROS. Important information
regarding roboy's movement are then sent through a ROSbridge(e.g. messages) towards Unity.
In Unity roboy is rendered and constantly updated concerning positions, rotations, etc.
With the help of a VR-Headset you can watch roboy move around in a virtual space.

Check out the whole large-scale documentation of roboyVR here: http://roboyvr.readthedocs.io/en/latest/

Setup

This tutorial will help you setup roboyVR with all necessities it comes with.

Part 1.1: Setup Virtualbox with Ubuntu

  1. Download and install Virtualbox for your OS https://www.virtualbox.org/

  2. Download Ubuntu 16.04 (64bit) https://www.ubuntu.com/download/desktop

  3. Mount the .iso and setup Virtualbox with the following settings (if available):

  • 4 cores (Settings->System->Processor)
  • 6 GB of RAM (Settings->System->Motherboard)
  • 128 MB of VRAM (Settings->Display->Screen)
  • 30 GB HDD space (Settings->Storage)
  1. Set network settings to Bridged-Adapter or Host-Only Adapter

Part 1.2: Install ROS & Roboy on Ubuntu

  1. Open Terminal and install the following packages
#!bash
sudo add-apt-repository -y ppa:letrend/libcmaes
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-get update
sudo apt install libcmaes
sudo apt-get install ros-kinetic-desktop-full
sudo apt install ros-kinetic-controller-interface ros-kinetic-controller-manager ros-kinetic-gazebo-ros-control ros-kinetic-ros-controllers
sudo apt install ros-kinetic-ecl-geometry
sudo apt install libncurses-dev
sudo apt-get install catkin
sudo apt-get install git
  1. Clone the git repository into a ros working space
#!bash
mkdir -p ~/ros_ws/src
cd ~/ros_ws/src
git clone https://github.com/Roboy/roboy-ros-control --recursive
  1. Get additional dependencies
#!bash
cd roboy-ros-control
git submodule update --init --recursive
cd src/flexrayusbinterface
sudo dpkg -i lib/libftd2xx_1.1.12_amd64.deb
  1. Source the setup.bash
source /opt/ros/kinetic/setup.bash
cd ~/ros_ws
catkin_make
  1. OPTIONAL: add this to your bash script (otherwise you have to type this commands in every new terminal window)
echo 'source /opt/ros/kinetic/setup.bash' >> ~/.bashrc
echo 'source ~/ros_ws/devel/setup.bash' >> ~/.bashrc
  1. Create symlinks for gazebo to your roboy models
#!bash
cd ~
mkdir -p ~/.gazebo/models
ln -s ~/ros_ws/src/roboy-ros-control/src/roboy_models/legs_with_upper_body ~/.gazebo/models/
  1. Install rosbridge
#!bash
sudo apt install ros-kinetic-rosbridge-suite

Part 1.3: Run rosbridge and roboySimulation

#!bash
roslaunch rosbridge_server rosbridge_websocket.launch
rosrun roboy_simulation VRRoboy

Part 2.1: Install Unity3D

  1. Download Unity
    (latest working version with roboyVR is 5.4.3: https://unity3d.com/de/get-unity/download/archive)

  2. Install Unity
    During the install process make sure to check also the standalone build option.
    Visual studio is recommended to use with Unity3D, as it is free and more user friendly than
    MonoDevelop (standard option).

  3. Open the project in Unity
    Download or clone this github repository (master branch) to your system on open it in Unity via Open Project (git clone -b master https://github.com/sheveg/roboyVR.git). Unity is organized in Scenes. In order to watch the simulation in Unity which is running on the VM (in gazebo), open the SimulationScene.
    Scene overview

Part 2.2: SimulationScene

In the SimulationScene you can observe the simulation from the VM within Unity. To do that you need to communicate the IP adress of your VM towards RoboyManager. The IP information is quickly found in Ubuntu by clicking on the two arrows pointing in opposite directions, right next to the system time. Afterwards a drop down menu will open, click on connection information. Remember the IP and paste it in the respective field in Unity.
IP address

You also need to drag the roboy prefab onto the RoboyManager if it is not already done. Each roboy model is tagged as a RoboyPart. If you import new models for roboy you need to change the tag accordingly and change the roboy prefab.

Tag assignment

You can reset the simulation with the R key, you can also change the key in RoboyManager. To get a better view of the simulation we recommend to set the simulation to slow motion in rviz in the VM:

  • If you want to start rviz, open a terminal (in the VM) and simply type rviz
  • Set Fixed Frame to World (Displays->Fixed Frame)
  • Add a marker (Add(Button)->marker)
  • Add walking plugin (Panels->Add New Panel->WalkingPlugin)
  • Turn slow motion on (within the walking plugin, it is a toggle button)

Part 2.3: ViveScene

In the ViveScene you can view roboy with the HTC Vive™ in virtual reality. You can select each roboy part individually with the controller through a raycast. In the Hierarchy window you can see the SelectorTool attached to the right controller.
Selector ToolThis object has a line renderer component attached to it so know where you are pointing the device at. Currently you can select a roboy part with the trigger on the back of the controller. Each roboy part has a Selectable Object script attached to it. You can choose from two materials for visual feedback.
Materials selection

Update roboy models

In /roboyVR/Assets/RoboyModel/OriginModels there is a script meshDownloadScript.py. When executed, it downloads roboy models from a given location. It's important to use a path to the "raw" models, NOT a path with "tree" in it.

After the download process is complete the models will be converted by blender so that they work fine with unity (.fbx format). Obviously you need blender and python installed on your system so that the script can do it's work. You can use the template runScript bat file for Windows.

The format:

start "" "pathToBlender/blender.exe" -P "pathToScript\meshDownloadScript.py" "gitPathToMeshes\" **meshes you want to update WITHOUT .STL or .fbx and without whitespace: torso,hip,thigh_left,oberarm_right OR you can update all meshes by putting "" as last parameter**

Example:

start "" "C:\Programs\Blender\blender.exe" -P "C:\Documents\roboyVR\Assets\RoboyModel\OriginModels\meshDownloadScript.py" "https://github.com/Roboy/roboy_models/raw/master/legs_with_upper_body/cad" hip,torso,thigh_left,head
start "" "C:\Programs\Blender\blender.exe" -P "C:\Documents\roboyVR\Assets\RoboyModel\OriginModels\meshDownloadScript.py" "https://github.com/Roboy/roboy_models/raw/master/PaBiRoboy/meshes" ""

About

roboy goes virtual

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 91.2%
  • CSS 1.6%
  • HTML 1.4%
  • JavaScript 1.4%
  • ShaderLab 0.9%
  • GLSL 0.9%
  • Other 2.6%