This project demonstrates the integration of Unity3D with ROS1 (Robot Operating System) to control a GameObject's movement within a Unity scene based on messages received from ROS1 topics. This integration is facilitated by the ROS# library, which provides the necessary tools and APIs to connect Unity with ROS via the rosbridge_suite.
The aim of this project is to showcase real-time communication between ROS1 and Unity3D, enabling the dynamic control of virtual objects in a simulated environment. This setup is particularly useful for robotics simulations, educational purposes, and development of control systems in a virtual setting before deploying them in real-world scenarios.
- ROS1 publisher node for sending movement commands.
- Unity subscriber using ROS# to receive movement commands from ROS1.
- Real-time control of a GameObject's movement in Unity based on ROS1 messages.
Before you begin, ensure you have met the following requirements:
- Unity3D: Version 2019.4 LTS or newer recommended.
- ROS1: Any ROS1 distribution compatible with your operating system (e.g., Melodic or Noetic).
- rosbridge_suite: For setting up a WebSocket connection between ROS1 and Unity.
- ROS#: A Unity package for ROS integration, available on GitHub.
- Python: For writing ROS1 publisher nodes. Version 2.7 for older ROS distributions (e.g., Kinetic), or Version 3.5+ for newer distributions (e.g., Melodic, Noetic).
- A computer running Ubuntu (for ROS1) and Windows/MacOS/Ubuntu (for Unity3D).
- ROS1 Setup: Install your chosen ROS1 distribution following the official ROS Installation Instructions.
- rosbridge_suite Installation: Install rosbridge_suite using the following command:
sudo apt-get install ros-<distro>-rosbridge-server