Skip to content

Commit b6b20dc

Browse files
committed
Add docs
1 parent cdbb50b commit b6b20dc

6 files changed

Lines changed: 37 additions & 113 deletions

File tree

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ Five different tasks can be performed:
4949

5050
## `make_basler.sh`
5151

52-
Downloads and installs the Basler Pylon SDK for Linux. This is needed to communicate with our camera. Normally called by the `just install-basler` or other `just` recipes.
52+
Downloads and installs the Basler Pylon SDK for Linux. This is needed to communicate with our camera.

src/bitbots_misc/bitbots_docs/docs/manual/testing/test_robot_hardware.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ Do the test in the provided order, to find out which part is faulty.
1414
#. Check if all cables are correctly connected
1515
#. Open diagnostic view in rqt, it will provide a lot of information
1616

17-
Test hardware and ros_control
18-
-----------------------------
19-
20-
The easiest way to do this is using the semi automatic script for this. Just start it and follow the instructions
21-
22-
``rosrun bitbots_bringup check_robot.py``
23-
24-
2517

2618
Manual procedure
2719
~~~~~~~~~~~~~~~~

src/bitbots_misc/bitbots_docs/docs/manual/tutorials/cl_simulation_testing_setup.rst

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,27 @@ As such you can lookup some of the needed requirements there.
1616
- Add your SSH key to GitHub to access and sync our repositories
1717
- 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
1818
- Go to your account settings and add your SSH key (the ``.pub`` file) to `GitHub <https://github.com/settings/keys>`_
19-
- setup bitbots_main in your home directory
19+
- Make sure you have [pixi](https://pixi.sh) installed for your user.
20+
- Setup bitbots_main in your home directory
2021

2122
.. code-block:: bash
2223
git clone git@github.com:bit-bots/bitbots_main.git && cd bitbots_main
23-
just install-no-root
24-
25-
- set PATH and COLCON_WS (see `section 5 <https://docs.bit-bots.de/meta/manual/tutorials/install_software_ros2.html>`_)
26-
27-
**2. Compile the packages**
28-
29-
If while testing you are changing code or updating ``bitbots_main`` via ``just update-no-root``,
30-
this step needs to be done again.
31-
For compilation of the whole meta repository run ``just build``, which is an alias for:
32-
``cd $COLCON_WS; colcon build --symlink-install --continue-on-error``
33-
After a successful run, before we are able to use any ros commands we now need to source colcon built sources
34-
with ``sa``, which is an alias for:
35-
``source "/opt/ros/jazzy/setup.$SHELL" && source "$COLCON_WS/install/setup.$SHELL"``
24+
pixi run build
3625
3726
**3. Run Webots Simulation**
3827

3928
We can start the Webots simulator with the following command:
40-
``rl bitbots_bringup simulator_teamplayer.launch game_controller:=false``
29+
``pixi run ros2 launch bitbots_bringup simulator_teamplayer.launch game_controller:=false``
4130
This should start the simulation environment in the Webots simulator, while also starting all necessary
4231
nodes of the robot software (walking, vision, etc.).
4332
In the simulator we should see a field with a single robot.
44-
``rl`` is short for ``ros2 launch`` and can be used as an alias as described in `section 5 <https://docs.bit-bots.de/meta/manual/tutorials/install_software_ros2.html>`_.
33+
34+
Instead of doing `pixi run ...` you can also activate the pixi environment for the current terminal with
35+
``pixi shell`` and then run the command without the prefix ``pixi run``.
4536

4637
With ``game_controller:=false`` we ensure, that the game_controller_listener is not started as well, but instead
4738
we will simulate the current gamestate by our own script (in another terminal):
48-
``rr game_controller_hl sim_gamestate.py``
39+
``pixi run ros2 run game_controller_hl sim_gamestate.py``
4940

5041
Which allows us to simulate the current gamestate and different phases of the game.
5142
Now everything is ready for some simulation testing.
@@ -55,7 +46,7 @@ Now everything is ready for some simulation testing.
5546
By changing the simulated gamestate and seeing how the robot reacts, we can test our behavior.
5647
If there are issues with the robots behavior, they most likely have to do with DSD configuration or different
5748
parallelism handling in ROS 2.
58-
To be able to visualize the current DSD execution, we can start ``rqt`` and in the ``Plugins`` menu select
49+
To be able to visualize the current DSD execution, we can start ``pixi run rqt`` and in the ``Plugins`` menu select
5950
``RoboCup -> DSD-Visualization``. This will show us the current DSD execution and can help in finding deadlocks
6051
or behavior execution logic issues.
6152

src/bitbots_misc/bitbots_docs/docs/manual/tutorials/configure_and_flash_robot.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,17 @@ At a competition, follow these steps:
4343

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

4847
#. **Sync, configure, compile and launch software:**
49-
In the ``bitbots_main`` directory call the ``deploy_robots.py`` tool:
48+
In the ``bitbots_main`` directory run the deploy tool:
5049

5150
.. code-block:: bash
5251
53-
just deploy <nuc* | robot_name | ALL>
52+
pixi run deploy <nuc* | robot_name | ALL>
5453
5554
This does the 5 following tasks:
5655
- Synchronize/Copy the current state of your local bitbots_main directory to the robot(s)
57-
- Install ROS 2 dependencies using `rosdep` on the robot(s), if internet is available
56+
- Install necessary dependencies on the robot(s)
5857
- Configure game specific settings and the Wi-Fi connection on the robot(s)
5958
- Build/Compile the source code you just synchronized to the robot(s)
6059
- Launch the teamplayer software on the robot(s)
@@ -63,7 +62,7 @@ At a competition, follow these steps:
6362

6463
.. code-block:: bash
6564
66-
just deploy -h
65+
pixi run deploy -h
6766
6867
#. **Optional: Connect to the robot:**
6968
Simply copy-paste the command provided by the deploy-tool when its finished.

src/bitbots_misc/bitbots_docs/docs/manual/tutorials/install_software_ros2.rst

Lines changed: 19 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
Software installation with ROS2
22
===============================
33

4-
In this tutorial, we will learn how to install ROS2 Jazzy Jalisco on Ubuntu 24.04 and build our software stack.
4+
In this tutorial, we will learn how to install all dependencies and build our software stack.
55

66
You might want to look at the :doc:`vscode-dev-container` tutorial, if you want to use a preconfigured development environment with Visual Studio Code and devcontainers.
77

88
**TLDR**: single command setup
99
------------------------------
1010

1111
**Prerequirements**
12-
- You have a running Ubuntu 24.04 environment
1312
- You have an existing Github account and added a SSH key to your account
14-
- You have root access to your system (sudo)
1513

1614
If you have not previously set up any of our software stack, you can use the following command to install and setup everything in one go:
1715

@@ -25,105 +23,48 @@ If you have not previously set up any of our software stack, you can use the fol
2523
Manual steps with in depth explanation
2624
--------------------------------------
2725

28-
**0. Use Ubuntu 24.04**
26+
**0. Use any modern Linux distribution**
2927

30-
As ROS works best on Ubuntu, we are using this distribution.
31-
Currently, ROS2 Jazzy runs on Ubuntu 24.04.
28+
We mainly develop and test our software on Ubuntu so we recommend using Ubuntu for development as well.
29+
Due to the use of pixi other distributions as well as Mac OS might work as well, but might require some tweaks.
3230

33-
If you are not already using Ubuntu 24.04, consider installing it on your system (perhaps as a dual boot?).
3431
Alternatively you can use a devcontainer :doc:`vscode-dev-container`, with a preconfigured environment and follow those instructions, as these docs do not apply to the devcontainer.
3532

36-
**1. Setup and Install ROS 2**
33+
**1. Install Pixi**
3734

38-
- Follow this guide and when it comes to the section **Install ROS 2 packages**, install the recommended ``ros-jazzy-desktop-full``: https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html
39-
- Install additional dependencies:
35+
We manage our development environment with `pixi <https://pixi.sh>`_, which makes setting up and using our software stack much easier.
36+
Run the following command to install pixi for your user:
4037

4138
.. code-block:: bash
4239
43-
sudo apt install \
44-
clang-format \
45-
cppcheck \
46-
python3-colcon-clean \
47-
python3-colcon-common-extensions \
48-
python3-pip \
49-
python3-rosdep \
50-
python3-vcstool \
51-
ros-jazzy-plotjuggler-ros \
52-
ros-jazzy-rmw-cyclonedds-cpp \
53-
ros-jazzy-rqt-robot-monitor \
54-
ros-jazzy-rqt-runtime-monitor
55-
56-
**2. Download our software (if not already done)**
40+
curl -sSL https://pixi.sh/install.sh | bash
41+
42+
**2. Download our software**
5743

5844
- Create a GitHub account, if not already done (see `here <http://doku.bit-bots.de/private/manual/dienste_accounts.html>`_ for further information)
5945
- Add your SSH key to GitHub to access and sync our repositories
6046
- 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
6147
- Go to your account settings and add your SSH key (the ``.pub`` file) to `GitHub <https://github.com/settings/keys>`_
6248
- Now, you can clone (download) our main code repository (repo) called `bitbots_main <https://github.com/bit-bots/bitbots_main>`_:
63-
- Open a terminal and go to the directory where you want to download our code (typically ``~/git/bitbots/``)
64-
- Create the directory with: ``mkdir -p ~/git/bitbots``
65-
This is were your source code will live and grow.
66-
- Move to this directory with: ``cd ~/git/bitbots``
49+
- Open a terminal and go to the directory where you want to download our code, e.g. ``~/git/bitbots/``
6750
- Clone the code repository with: ``git clone git@github.com:bit-bots/bitbots_main.git``
6851
Confirm the host key by typing ``yes``, if asked.
6952
- Move into the newly created directory with: ``cd bitbots_main``
70-
- Clone all code and other files by running: ``just install``
71-
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).
72-
- Finally, you can register pre-commit hooks with ``just install-pre-commit`` (automatic code-formatting and warnings), which will be run every time you commit code to our repositories.
73-
74-
**3. Setup colcon workspace**
75-
76-
`Colcon <https://docs.ros.org/en/jazzy/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html>`_ is the tool provided by ROS 2 to build and install our ROS packages, so that they can be launched later.
77-
The colcon workspace is where your source code gets build and where we use colcon. Nowerdays, we just use the ``bitbots_main`` repository as our colcon workspace, so no further setup is needed.
78-
79-
**4. Final touches**
8053

81-
To let your system know where it should find all the ROS 2 dependencies and packages and to add colored output etc., we add a little bit of config to your ``~/.bashrc`` file, which will be run every time you open a new terminal.
82-
In case you are not using the bash shell, replace ``~/.bashrc`` and ``bash`` with your shell's configuration file. Adapt the colcon workspace path, if you have chosen a different location than ``~/git/bitbots/bitbots_main``.
54+
**3. Setup the workspace and build the software**
8355

84-
- Run the following command:
56+
Now that you have downloaded the code, you need to build it.
57+
A number of dependencies will be installed automatically during the build process.
58+
Make sure you have about 10 GB of free disk space available.
59+
Run the following command in the ``bitbots_main`` directory to build the software:
8560

8661
.. code-block:: bash
8762
88-
cat >> ~/.bashrc << EOF
89-
90-
# >>> bit-bots initialize >>>
91-
92-
# Add python pip bins to PATH
93-
export PATH="\$HOME/.local/bin:\$PATH"
94-
95-
# Ignore some deprecation warnings
96-
export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated"
97-
98-
# Limit ROS 2 communication to localhost (can be overridden when needed)
99-
export ROS_DOMAIN_ID=24
100-
export ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST
101-
102-
# Set the default colcon workspace
103-
export COLCON_WS="\$HOME/git/bitbots/bitbots_main"
104-
105-
# Set the default log level for colcon
106-
export COLCON_LOG_LEVEL=30
107-
108-
# Define a log layout
109-
export RCUTILS_COLORIZED_OUTPUT=1
110-
export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity}] [{name}]: {message}"
111-
112-
# Set the default Middleware
113-
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
114-
115-
# Load our ros plugin script containing useful functions and aliases for ROS 2 development
116-
if [[ -f \$COLCON_WS/scripts/ros.plugin.sh ]]; then
117-
source \$COLCON_WS/scripts/ros.plugin.sh
118-
fi
119-
120-
# <<< bit-bots initialize <<<
121-
122-
EOF
63+
pixi run build --packages-skip bitbots_basler_camera
12364
124-
source ~/.bashrc
65+
The compilation of the basler camera driver is skipped, as it requires the Pylon SDK to be installed manually.
66+
If you need the basler camera driver, install the Pylon SDK manually or run `bash scripts/make_basler.sh` if you are using Ubuntu 22.04 and have root access.
12567

126-
- Configure the robot hostnames, see :doc:`configure_hostnames`.
12768

12869
Notes
12970
-----

src/bitbots_misc/bitbots_docs/docs/manual/tutorials/vscode-dev-container.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ Setup VSCode Dev Container
2828
6. Open a terminal in VSCode, you should see a number of instructions on how to setup the container. Follow them.
2929
7. Install recommended extensions for the repository
3030

31-
You should now have a fully working development environment (IntelliSense, Build, ...) for the repository. You can source the workspace by running `sa`. Now all the commands should be available to you.
31+
You should now have a fully working development environment (IntelliSense, Build, ...) for the repository.
32+
You still need to setup your SSH keys in the container to be able to push.
33+
Instructions for that are shown in the terminal when the container starts.
34+
To activate the pixi environment in a terminal run `pixi shell` or prefix commands with `pixi run ...`.
3235

3336

3437
Known issues
3538
------------
3639

3740
- Rebuilding the container results in all modifications to the container being lost. This does not include the repository, which itself is persisted in the container.
38-
- Sometimes `just install` results in an `mktemp: failed to create file via template ‘/tmp/tmp.XXXXXXXXXX’: Permission denied`. I spend some time trying to fix this but couldn't find a solution. The workaround is to run `just install` again. This time it should work.
39-
- I did everything as stated, but my python IntelliSense does not pick up bit-bots related packages. To solve this open the command palette (Ctrl+Shift+P) and run `ROS: Update Python Path`. This should fix the issue.
4041
- GUI applications do not start. Run `xhost local:root` on the **host** machine to fix this.
4142
- I can not find my files in the home directory. The home directory is mounted at `/srv/host_home` in the container. You can find your files there.

0 commit comments

Comments
 (0)