Skip to content

Commit

Permalink
Merge branch 'fix_meta_name' into feature/ros_sports_gc
Browse files Browse the repository at this point in the history
  • Loading branch information
Flova committed Jan 24, 2024
2 parents cdddc29 + 0289944 commit 423c766
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
uses: actions/checkout@v3

- name: Configure git to trust repository
run: git config --global --add safe.directory /__w/bitbots_meta/bitbots_meta
run: git config --global --add safe.directory /__w/bitbots_main/bitbots_main

- name: Pull source code for libraries and install dependencies
run: make install HTTPS=true ARGS="-ci"

- name: Set up colcon workspace
run: |
mkdir -p /colcon_ws/src
ln -s $(realpath .) /colcon_ws/src/bitbots_meta
ln -s $(realpath .) /colcon_ws/src/bitbots_main
- name: Build packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Bit-Bots Software Stack

[![Test if all packages build](https://github.com/bit-bots/bitbots_meta/actions/workflows/build.yml/badge.svg)](https://github.com/bit-bots/bitbots_meta/actions/workflows/build.yml)
[![Test if all packages build](https://github.com/bit-bots/bitbots_main/actions/workflows/build.yml/badge.svg)](https://github.com/bit-bots/bitbots_main/actions/workflows/build.yml)

This git repository contains all RoboCup-related code and documentation from the Hamburg Bit-Bots team.
All code is written as individual ROS 2 packages targeting Ubuntu.
Expand Down
12 changes: 6 additions & 6 deletions bitbots_misc/bitbots_containers/hlvs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ RUN sudo rosdep init
# pip3 install -U PyYAML construct defusedxml filterpy matplotlib numpy opencv-python \
# protobuf psutil pytorchyolo setuptools sklearn transforms3d

ADD --chown=robot:robot https://raw.githubusercontent.com/bit-bots/bitbots_meta/master/requirements/common.txt src/requirements_common.txt
ADD --chown=robot:robot https://raw.githubusercontent.com/bit-bots/bitbots_main/master/requirements/common.txt src/requirements_common.txt

RUN pip3 install -U -r src/requirements_common.txt --no-cache-dir && \
pip3 uninstall -y numpy

RUN cd src && \
git clone https://github.com/bit-bots/bitbots_meta.git && \
cd bitbots_meta && \
git clone https://github.com/bit-bots/bitbots_main.git && \
cd bitbots_main && \
make pull-init

# From here on, we don't want to cache anything. That's achieved by adding the current time.
ADD https://www.timeapi.io/api/Time/current/zone?timeZone=UTC /tmp/build-time

RUN cd src/bitbots_meta && \
RUN cd src/bitbots_main && \
make pull-all && \
rm -rf lib/udp_bridge bitbots_misc/bitbots_containers \
humanoid_league_visualization dynamic_stack_decider/dynamic_stack_decider_visualization bitbots_lowlevel \
Expand All @@ -69,13 +69,13 @@ RUN cd src/bitbots_meta && \

# Install ros dependencies with rosdep
RUN sudo apt update && rosdep update
RUN cd src/bitbots_meta && rosdep install --rosdistro=iron --from-paths . --ignore-src -r -y
RUN cd src/bitbots_main && rosdep install --rosdistro=iron --from-paths . --ignore-src -r -y

RUN . /opt/ros/iron/setup.sh && colcon build --cmake-args -DBUILD_TESTING=OFF

# TODO execute tests

RUN cp src/bitbots_meta/bitbots_wolfgang/wolfgang_robocup_api/scripts/start.sh .local/bin/start
RUN cp src/bitbots_main/bitbots_wolfgang/wolfgang_robocup_api/scripts/start.sh .local/bin/start

# Volume for logs
VOLUME /robocup-logs
Expand Down
2 changes: 1 addition & 1 deletion bitbots_misc/bitbots_docs/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and see if you can find something.

If you want to take a look at the code, our Github Organisation is also named `Bit-Bots
<https://github.com/bit-bots>`_.
The main repository is `bitbots_meta <https://github.com/bit-bots/bitbots_meta>`_ and everything is linked from there.
The main repository is `bitbots_main <https://github.com/bit-bots/bitbots_main>`_.

.. toctree::
:maxdepth: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
How to document
===============

Our documentation is published under `doku.bit-bots.de <https://doku.bit-bots.de>`_ and `docs.bit-bots.de <https://docs.bit-bots.de>`_ and will automatically be regenerated from the package `bitbots_meta/bitbots_misc/bitbots_docs <https://github.com/bit-bots/bitbots_meta/tree/master/bitbots_misc/bitbots_docs>`_.
Our documentation is published under `doku.bit-bots.de <https://doku.bit-bots.de>`_ and `docs.bit-bots.de <https://docs.bit-bots.de>`_ and will automatically be regenerated from the package `bitbots_main/bitbots_misc/bitbots_docs <https://github.com/bit-bots/bitbots_main/tree/master/bitbots_misc/bitbots_docs>`_.

Installation of dependencies
============================
Expand All @@ -23,7 +23,7 @@ How to build the documentation

.. code-block:: bash
cd bitbots_meta/bitbots_misc/bitbots_docs
cd bitbots_main/bitbots_misc/bitbots_docs
2. Build the sphinx docs for the given package.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ As such you can lookup some of the needed requirements there.

- have an LDAP mafiasi account for access to the CLs
- have ros2 aliases setup (see linked docs)
- have github ssh access setup for bitbots_meta (see linked docs)
- have GitHub ssh access setup for bitbots_main (see linked docs)

**1. Setup and download our software**

- SSH into the ``cl0*`` with your mafiasi user
- setup bitbots_meta in your home directory
- setup bitbots_main in your home directory

.. code-block:: bash
mkdir -p "~/colcon_ws/src"
cd "~/colcon_ws/src"
git clone git@github.com:bit-bots/bitbots_meta.git && cd bitbots_meta
git clone git@github.com:bit-bots/bitbots_main.git && cd bitbots_main
make install-no-root
- set PATH and COLCON_WS (see `section 5 <https://docs.bit-bots.de/meta/manual/tutorials/install_software_ros2.html>`_)

**2. Compile the packages**

If while testing you are changing code or updating ``bitbots_meta`` via ``make pull-all``,
If while testing you are changing code or updating ``bitbots_main`` via ``make pull-all``,
this step needs to be done again.
For compilation of the whole meta repository run ``cba``, which is an alias for:
``cd $COLCON_WS; colcon build --symlink-install --continue-on-error``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ At a competition, follow these steps:
This needs to be done before the competition at the team area (see :doc:`competition_wifi`)!

#. **Checkout the latest code:**
In your local `bitbots_meta <https://github.com/bit-bots/bitbots_meta>`_ repo run:
In your local `bitbots_main <https://github.com/bit-bots/bitbots_main>`_ repo run:

#. Check that you are on the ``master`` branch
#. ``git pull`` to get the latest changes
#. ``make fresh-libs`` to clean and update all third party libraries

#. **Sync, configure, compile and launch software:**
In the ``bitbots_meta`` directory call the ``deploy_robots.py`` tool:
In the ``bitbots_main`` directory call the ``deploy_robots.py`` tool:

.. code-block:: bash
./scripts/deploy_robots.py <nuc* | robot_name | ALL>
This does the 5 following tasks:
- Synchronize/Copy the current state of your local bitbots_meta directory to the robot(s)
- Synchronize/Copy the current state of your local bitbots_main directory to the robot(s)
- Install ROS 2 dependencies using `rosdep` on the robot(s), if internet is available
- Configure game specific settings and the Wi-Fi connection on the robot(s)
- Build/Compile the source code you just synchronized to the robot(s)
- Launch the teamplayer software on the robot(s)

If you need help with this tool, or want other options, look at `this README <https://github.com/bit-bots/bitbots_meta/blob/master/scripts/README.md#deploy_robotspy>`_ for example usages or call:
If you need help with this tool, or want other options, look at `this README <https://github.com/bit-bots/bitbots_main/blob/master/scripts/README.md#deploy_robotspy>`_ for example usages or call:

.. code-block:: bash
Expand Down Expand Up @@ -116,9 +116,9 @@ Ansible will execute the playbook with the ``bitbots`` user on the robots and wi
LEGACY: Sync/Build the software using the ``robot_compile`` tool:
-----------------------------------------------------------------

We utilize a python script located in ``bitbots_meta/scripts/robot_compile.py`` to allow doing the following:
We utilize a python script located in ``bitbots_main/scripts/robot_compile.py`` to allow doing the following:

- sync the local code of the whole ``bitbots_meta`` or a single package onto a robot
- sync the local code of the whole ``bitbots_main`` or a single package onto a robot
- build the synced code on the robot afterwards
- automatically install required dependencies with ``rosdep install`` if the robot has an active internet connection
- clean the whole ``~/colcon_ws`` on a robot
Expand All @@ -131,7 +131,7 @@ A full overview all the options are viewable with the ``-h`` flag.

.. code-block:: bash
# full sync/build of bitbots_meta
# full sync/build of bitbots_main
./scripts/robot_compile.py nuc1
# rm everything before full sync/compile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ If you are not already using Ubuntu 22.04, consider installing it on your system
- Add your SSH key to GitHub to access and sync our repositories
- If you don't know what I am talking about or you don't yet have a SSH key, follow this guide: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys
- Go to your account settings and add your SSH key (the ``.pub`` file) for `GitHub <https://github.com/settings/keys>`_ AND `Gitea <https://git.mafiasi.de/user/settings/keys>`_
- Now, you can clone (download) our main code repository (repo) called `bitbots_meta <https://github.com/bit-bots/bitbots_meta>`_:
- Now, you can clone (download) our main code repository (repo) called `bitbots_main <https://github.com/bit-bots/bitbots_main>`_:
- Open a terminal and go to the directory where you want to download our code (typically ``~/git/bitbots/``)
- Create the directory with: ``mkdir -p ~/git/bitbots``
This is were your source code will live and grow.
- Move to this directory with: ``cd ~/git/bitbots``
- Clone the code repository with: ``git clone git@github.com:bit-bots/bitbots_meta.git``
- Clone the code repository with: ``git clone git@github.com:bit-bots/bitbots_main.git``
Confirm the host key by typing ``yes``, if asked.
- Move into the newly created directory with: ``cd bitbots_meta``
- Move into the newly created directory with: ``cd bitbots_main``
- Clone all code and other files by running: ``make install``
This will take a while, as it downloads all the code and other files from our repositories and additionally installs all missing dependencies (using rosdep and pip).
Finally, it will register pre-commit hooks (automatic code-formatting and warnings), which will be run every time you commit code to our repositories.
Expand All @@ -61,7 +61,7 @@ The colcon workspace is where your source code gets build and where we use colco

- Create colcon workspace directory (typically ``~/colcon_ws/``)
- Create directory with: ``mkdir -p ~/colcon_ws/src``
- Link our software contained in the bitbots_meta repo to the newly created ``src`` directory with: ``ln -s ~/git/bitbots/bitbots_meta/ ~/colcon_ws/src/bitbots_meta``
- Link our software contained in the bitbots_main repo to the newly created ``src`` directory with: ``ln -s ~/git/bitbots/bitbots_main/ ~/colcon_ws/src/bitbots_main``

**5. Final touches**

Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy/deploy_robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

class DeployRobots:
def __init__(self):
self._bitbots_meta_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
print_debug(f"Bit-Bots meta path: {self._bitbots_meta_path}")
os.chdir(self._bitbots_meta_path)
self._bitbots_main_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
print_debug(f"Bit-Bots meta path: {self._bitbots_main_path}")
os.chdir(self._bitbots_main_path)

# Handle arguments
self._args = self._parse_arguments()
Expand Down Expand Up @@ -159,7 +159,7 @@ def _register_tasks(self) -> list[AbstractTask]:
if self._args.sync:
tasks.append(
Sync(
self._bitbots_meta_path,
self._bitbots_main_path,
self._args.workspace,
self._args.package,
self._args.clean_src,
Expand Down
6 changes: 3 additions & 3 deletions scripts/robot_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LOGLEVEL:
ERR_SUCCESS = 0


BITBOTS_META = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BITBOTS_MAIN = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


def print_err(msg):
Expand Down Expand Up @@ -157,7 +157,7 @@ def __init__(self, ip, ssh_target, hostname=None, robot_name=None):

self.workspace = getattr(self.Workspaces, self.robot_name) # type: str

self.sync_includes_file = os.path.join(BITBOTS_META, f"sync_includes_wolfgang_{self.hostname[:-1]}.yaml")
self.sync_includes_file = os.path.join(BITBOTS_MAIN, f"sync_includes_wolfgang_{self.hostname[:-1]}.yaml")


def parse_arguments():
Expand Down Expand Up @@ -345,7 +345,7 @@ def sync(target, package="", pre_clean=False):
cmd.append("--verbose")

cmd.extend(get_includes_from_file(target.sync_includes_file, package))
cmd.extend([BITBOTS_META + "/", f"bitbots@{target.ssh_target}:{target.workspace}/src/"])
cmd.extend([BITBOTS_MAIN + "/", f"bitbots@{target.ssh_target}:{target.workspace}/src/"])

print_debug("Calling {}".format(" ".join(cmd)))
sync_result = subprocess.run(cmd)
Expand Down

0 comments on commit 423c766

Please sign in to comment.