rmanky / Gopher-In-Unity-Base

Gopher nursing robot in Unity simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gopher In Unity Simulation

This package simulates Gopher nursing robot in Unity, which could provide better graphic performance and interface design. Thanks to Unity Robotics Hub, ROS-Unity connection is also provided in this repository for utilizing packages based on ROS.

image

Dependencies

This repository has been developed and tested in Ubuntu 18.04 and ROS Melodic, with the Unity 2020.3 LTS.

Before running this package, it is highly recommended to go through the tutorial of Unity Robotics Hub demo first. They provided a very detailed instruction to set up a robot arm in Unity. Also, you should try this tutorial on how to set up a mobile robot. The second tutorial provides more robot sensors and ROS publishers and subscribers examples. After these two tutorials, you should be able to understand how to set up a robot in Unity and how to communicate between ROS and Unity.

Setup and Run

Download and install the proper Unity version via Unity Hub. In the folder for your unity project, git clone this repository for Unity simulation. Also, git clone the related ROS repository in your catkin workspace and run catkin_make.

cd <Unity_Path>/Unity/Projects
git clone git@github.com:hiro-wpi/Gopher-In-Unity-Simulation.git
cd ~/catkin_ws/src
git clone git@github.com:hiro-wpi/Gopher-ROS-Unity.git
On the Unity side:

Open Unity Hub and in the Projects tab, select ADD to add the "Gopher-In-Unity-Simulation" folder. Select Unity version to be 2021.1 and open the project. The first time usually takes a longer time.

After launching the project, please navigate to the Scenes folder and open the Hospital scene.

image

You can toggle the visibility of the ceiling in the game object hierarchy.

To set up your own environment or modify the current one, you can find all the models we use in the Prefabs folder. If you would like to import your own models, you could put them in the Models folder and create your own prefab. The only human model used in this simulation is a nurse model, which has simple walking function to move to a desired location. You can find the nurse prefab in Character/Nurse folder.

To import a robot in the simulation, please navigate to Prefabs/Robot folder. There are three robot prefabs ready to use, a mobile base, a 7-DOF robot arm and the Gopher. You can simply drag them into the scene and hit play. You should be able to control them using just keyboard and mouse.

On the ROS side:

It's worth mention that if you don't need to use any ROS packages, you don't have to connect the simulation with ROS. You could simply complete a UI and manually control the robots in Unity.

If you need to use ROS packages, some examples of publishers and subscribers are provided in the Script/ROSCommunication folder. To use these scripts to talk to ROS, you need to launch the endpoint server on the ROS side by simply

roslaunch gopher_unity_endpoint gopher_presence_server.launch
roslaunch gopher_unity_endpoint gopher_server.launch
roslaunch gopher_unity_endpoint kinova_server.launch

More

  • This Unity simulation uses URP in stead of the default render pipeline for better graphical performance. But we may switch to Bakery in the future.
  • RGB-D camera sensor is still under development.
  • Some warning messages are constantly showing up on the ROS side.

About

Gopher nursing robot in Unity simulation

License:MIT License


Languages

Language:C# 58.4%Language:ShaderLab 32.9%Language:HLSL 5.7%Language:CMake 3.0%