title | subtitle | author | date | documentclass | colorlinks |
---|---|---|---|---|---|
Git repository for Unity-ROS2 projects |
README |
a.whit ([email](mailto:[email protected])) |
January 2022 |
scrartcl |
true |
This repository contains an empty Unity project that has been prepared for use with Git and ROS2. For recent versions of Unity, Git should mostly work out-of-the-box -- provided that there is an appropriate .gitignore file -- but the documentation is still a bit fragmented.1
To use this project, clone the repository and then open it in the Unity Editor.23 Make any desired changes to your project, and save to disk. Commit the changes as normal via a git command.
-
Create an empty project via Unity Hub and the Unity Editor.
-
Initialize Git in the project root:
git init
-
Initialize Git Large File Storage (LFS):2
git lfs install
-
Download the Unity .gitignore file from the GitHub gitignore template repository4 into the repository root:
wget -O .gitignore https://raw.githubusercontent.com/github/gitignore/main/Unity.gitignore
-
Download the .gitattributes file from the GitHub for Unity project into the repository root:
wget https://raw.githubusercontent.com/github-for-unity/Unity/master/.gitattributes
-
Create this README in the project root directory.
-
Add all files to the repository:
git add * .gitattributes .gitignore
. Commit. -
With the project open in the Unity Editor, add Unity's ROS-TCP-Connector to the package.
- For this repository, the package was added from this URL: https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector
-
Save the project.
Footnotes
-
The main issue to overcome is the problem of dealing with large (binary) files that Unity produces.] ↩
-
Assumes git LFS is installed. On Ubuntu:
sudo apt install git-lfs
. ↩ ↩2 -
To avoid accidentally attempting to push your project to this repository, be sure to modify the git remotes, after cloning. ↩
-
Other version of .gitignore and .gitattributes files are available. The versions from GitHub and GitHub for Unity were chosen because they are the closest thing that could be found to official versions. ↩