Clone this repository and execute the script install_first_time.sh
(turbot_stack)$ ./install_first_time.sh
Wait for the code to download.
Install dependencies
$ sudo apt install libgeographic-dev ros-melodic-geographic-msgs ros-melodic-rosbridge-server
$ sudo pip install ruamel.yaml
pose_cov_ops has been included in the stack because the latest version of this package does not switch correctly between ROS1 and ROS2. For computers that have a working version of pose_cov_ops installed in /opt/ros/melodic a CATKIN_IGNORE must be included in the stack package, otherwise pose_cov_ops must be compiled.
- Pull twice: On the main repository execute
git pull && git submodule foreach git pull
. - Push twice: Work with the code in any submodule as usual. Commit and push as usual. At the end, go to the main repository and check what a
git status
shows. It will normally show that a particular repo has changed. For example:
Say we have a main repo called robot and a submodule called sensor. If we update it, we have to commit twice, one for the submodule and another for the main repo.
$ ls robot/
./
../
sensor/
$ cd sensor
$ git touch test.txt
$ git add test.txt
$ git commit -m "added file test"
$ git push
$ cd ..
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: sensor (modified content)
no changes added to commit (use "git add" and/or "git commit -a")
$ git add sensor
$ git commit -m "updated sensor reference"
$ git push
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule