Skip to content

Commit 0b80176

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/supertone_tts
2 parents 170f7c5 + b16d3e7 commit 0b80176

142 files changed

Lines changed: 9294 additions & 3198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: scripts/make_basler.sh --ci
3333

3434
- name: Set up workspace
35-
uses: prefix-dev/setup-pixi@v0.9.4
35+
uses: prefix-dev/setup-pixi@v0.9.5
3636
with:
3737
pixi-version: v0.63.1
3838
cache: true

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v6
1212

1313
- name: Set up workspace
14-
uses: prefix-dev/setup-pixi@v0.9.4
14+
uses: prefix-dev/setup-pixi@v0.9.5
1515
with:
1616
pixi-version: v0.59.0
1717
cache: true

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,20 @@ All code is written as individual ROS 2 packages.
1515

1616
The workspace is managed using the [pixi](https://pixi.sh) package manager. This allows us to have reproducible builds and easy user space dependency management similar to tools like `uv` or `cargo`. This also means that no system wide ROS installation or superuser privileges are required to install or run the code.
1717

18-
Full step-by-step instructions for installing the Bit-Bots software stack and ROS 2 can be found in our documentation [here](https://doku.bit-bots.de/meta/manual/tutorials/install_software_ros2.html).
18+
Full step-by-step instructions for installing the Bit-Bots software stack and ROS 2 can be found in our [documentation](https://docs.bit-bots.de/meta/manual/tutorials/install_software_ros2.html).
1919

20-
21-
Run the following command inside this repository to build the workspace. All dependencies will be installed automatically. Make sure you have [pixi](https://pixi.sh) installed. A few optional proprietary dependencies will be needed for full functionality, see the documentation for details.
20+
Run the following command inside this repository to build the workspace.
21+
All dependencies will be installed automatically.
22+
Make sure you have [pixi](https://pixi.sh) installed.
23+
A few optional proprietary dependencies will be needed for full functionality, see the documentation for details.
2224

2325
``` shell
2426
pixi run build
2527
```
2628

29+
The first build might fail due to missing dependencies.
30+
Run `pixi run basler` to install the Basler pylon camera driver.
31+
2732
## Using the workspace
2833

2934
To activate the workspace run the following command in the terminal you want to use:
@@ -38,7 +43,13 @@ alternatively, you can run individual commands inside the workspace without acti
3843
pixi run <command>
3944
```
4045

41-
To see some predefined / commands, run
46+
To build the workspace, run the following command in the terminal:
47+
48+
``` shell
49+
pixi run build
50+
```
51+
52+
To see some predefined tasks / commands, run
4253

4354
``` shell
4455
pixi task list
@@ -49,7 +60,7 @@ pixi task list
4960
To deploy the software to a robot, run
5061

5162
``` shell
52-
pixi run deploy <robot_ip|robot_name>
63+
pixi run deploy
5364
```
5465

5566
For more information on the deployment tooling, see [this documentation](scripts/README.md).

pixi.lock

Lines changed: 2376 additions & 2631 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ version = "0.1.0"
1414
[tasks]
1515
deploy = {cmd = "scripts/deploy_robots.py", description = "Deploys the current environment."}
1616
format = {cmd = "pre-commit run --all-files", description = "Runs code formatting and linting."}
17+
basler = {cmd = "scripts/make_basler.sh", description = "Installs the Basler pylon camera driver using dpkg on x86-64 Linux."}
1718

1819
[tasks.build]
1920
cmd = "colcon build --symlink-install --cmake-args -G 'Unix Makefiles' "
@@ -25,7 +26,7 @@ args = [{ arg = "package", default = "" }]
2526
description = "Cleans build and install files for all ROS 2 packages or a specific one if given."
2627

2728
[tasks.test]
28-
cmd = "colcon test --event-handlers console_direct+ --return-code-on-test-failure "
29+
cmd = "colcon test --packages-ignore=audio_common --event-handlers console_direct+ --return-code-on-test-failure "
2930
description = "Runs tests for all ROS 2 packages. Add --packages-select <package names> to test specific packages."
3031

3132
[dependencies]
@@ -37,6 +38,7 @@ readline = ">=8.2.999" # This is needed because we want to install an empty rea
3738

3839
[feature.ros.dependencies]
3940
# Misc dependencies for our ROS 2 packages
41+
alsa-plugins = ">=1.2.12,<2"
4042
beartype = ">=0.22.6,<0.23"
4143
breathe = ">=4.36.0,<5"
4244
cmake = "<3.30" # Constraint to avoid issues with deprecated features in newer cmake versions
@@ -52,6 +54,7 @@ ipython = ">=9.7.0,<10"
5254
jaxtyping = ">=0.3.2,<0.4"
5355
jinja2 = ">=3.1.6,<4"
5456
libboost-devel = ">=1.86.0,<2"
57+
libflac = "==1.4.3"
5558
libnuma = ">=2.0.18,<3"
5659
libopencv = ">=4.11.0,<5"
5760
libprotobuf = ">=6.31.1,<7"
@@ -63,6 +66,7 @@ opencv = ">=4.11.0,<5"
6366
paramiko = ">=4.0.0,<5"
6467
pkg-config = ">=0.29.2,<0.30"
6568
playsound = ">=1.3.0,<2"
69+
portaudio = ">=19.7.0,<20"
6670
protobuf = ">=6.31.1,<7"
6771
psutil = ">=7.1.3,<8"
6872
pthread-stubs = ">=0.4,<0.5"
@@ -86,6 +90,7 @@ colcon-common-extensions = ">=0.3.0,<0.4"
8690
colcon-notification = ">=0.3.0,<0.4"
8791
ros-jazzy-action-msgs = ">=2.0.3,<3"
8892
ros-jazzy-ament-cmake = ">=2.5.4,<3"
93+
ros-jazzy-ament-cmake-clang-format = ">=0.17.3,<0.18"
8994
ros-jazzy-ament-cmake-mypy = ">=0.17.3,<0.18"
9095
ros-jazzy-ament-copyright = ">=0.17.3,<0.18"
9196
ros-jazzy-ament-flake8 = ">=0.17.3,<0.18"
@@ -133,6 +138,7 @@ ros-jazzy-rosbridge-suite = ">=2.3.0,<3"
133138
ros-jazzy-rosgraph-msgs = ">=2.0.3,<3"
134139
ros-jazzy-rosidl-default-generators = ">=1.6.0,<2"
135140
ros-jazzy-rosidl-default-runtime = ">=1.6.0,<2"
141+
ros-jazzy-rosidl-runtime-c = ">=4.6.7,<5"
136142
ros-jazzy-rqt-gui = ">=1.6.0,<2"
137143
ros-jazzy-rqt-gui-py = ">=1.6.0,<2"
138144
ros-jazzy-sensor-msgs = ">=5.3.6,<6"
@@ -167,11 +173,11 @@ ros-jazzy-bio-ik-msgs = ">=0.0.0,<0.0.1"
167173
ros-jazzy-biped-interfaces = ">=0.0.0,<0.0.1"
168174
ros-jazzy-bitbots-tf-buffer = ">=1.0.0,<2"
169175
ros-jazzy-ros2-python-extension = ">=1.0.0,<2"
170-
ros-jazzy-audio-common = ">=0.3.15,<0.4"
171176
ros-jazzy-dynamic-stack-decider = ">=0.5.3,<0.6"
172177
ros-jazzy-dynamic-stack-decider-visualization = ">=0.2.1,<0.3"
173-
ros-jazzy-game-controller-hl = ">=1.1.0,<2"
174-
ros-jazzy-game-controller-hl-interfaces = ">=0.0.1,<0.0.2"
178+
# To be replaced with ros-jazzy-game-controller-hsl once the new version is released upstream
179+
# ros-jazzy-game-controller-hl = ">=1.1.0,<2"
180+
# ros-jazzy-game-controller-hl-interfaces = ">=0.0.1,<0.0.2"
175181
ros-jazzy-humanoid-base-footprint = ">=0.1.2,<0.2"
176182
ros-jazzy-ipm-image-node = ">=0.0.0,<0.0.1"
177183
ros-jazzy-ipm-interfaces = ">=0.0.0,<0.0.1"
@@ -239,6 +245,7 @@ RMW_IMPLEMENTATION = "rmw_cyclonedds_cpp"
239245
COLCON_LOG_LEVEL = "30"
240246
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"
241247
WEBOTS_HOME = "$CONDA_PREFIX/share/webots"
248+
ALSA_PLUGIN_DIR = "/usr/lib/x86_64-linux-gnu/alsa-lib"
242249

243250
[feature.ros.activation]
244251
scripts = [

scripts/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ This tool is also callable via `pixi run deploy <arguments>`.
88

99
Deploy, configure, and launch the Bit-Bots software remotely on a robot.
1010
This tool can target all, multiple, or single robots at once, specified by their hostname, robot name, or IP address.
11-
Five different tasks can be performed:
11+
These different tasks can be performed:
1212

1313
1. Synchronize the local source code to the target workspace
14-
3. Configure game-settings and wifi on the target
15-
4. Build (compile) the workspace on the target
16-
5. Launch the teamplayer software on the target
14+
2. Configure game-settings and wifi on the target
15+
3. Build (compile) the workspace on the target
16+
4. Launch the teamplayer software on the target
1717

1818
### Example usage
1919

scripts/deploy/tasks/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def _build(self, connections: Group) -> GroupResult:
6262
:return: The results of the task.
6363
"""
6464
print_debug("Building packages")
65-
cmd = f"cd {self._remote_workspace} && pixi run --environment robot build {self._package}"
65+
66+
cmd = f"cd {self._remote_workspace} && chrt -r 1 taskset -c 0-9 pixi run --environment robot build {self._package}"
6667

6768
print_debug(f"Calling '{cmd}'")
6869
try:

scripts/make_basler.sh

Lines changed: 84 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,106 @@ set -eEo pipefail
88
PYLON_DOWNLOAD_URL="https://data.bit-bots.de/pylon_7_4_0_14900_linux_x86_64_debs.tar.gz.gpg"
99
PYLON_VERSION="7.4.0"
1010

11+
CI=false
12+
SKIP_OS_CHECK=false
13+
SHOW_PROGRESS="--show-progress"
14+
UNKNOWN_ARGS=()
15+
16+
print_help() {
17+
echo "Usage: $0 [--ci] [--skip-os-check] [--help]"
18+
echo
19+
echo " --ci Run non-interactively for CI (skips confirmation and progress)"
20+
echo " --skip-os-check Skip the Ubuntu version/OS check"
21+
echo " -h, --help Show this help message and exit"
22+
}
23+
24+
# Parse arguments position-independently
25+
for arg in "$@"; do
26+
case "$arg" in
27+
--ci)
28+
CI=true
29+
SHOW_PROGRESS=""
30+
;;
31+
--skip-os-check)
32+
SKIP_OS_CHECK=true
33+
;;
34+
-h|--help)
35+
print_help
36+
exit 0
37+
;;
38+
*)
39+
UNKNOWN_ARGS+=("$arg")
40+
;;
41+
esac
42+
done
43+
44+
# If unknown arguments were passed, warn and show help
45+
if [[ ${#UNKNOWN_ARGS[@]} -gt 0 ]]; then
46+
echo "Unknown argument(s): ${UNKNOWN_ARGS[*]}"
47+
echo
48+
print_help
49+
exit 1
50+
fi
51+
1152
# Check let the user confirm that they read the license agreement on the basler website and agree with it.
1253
echo "You need to confirm that you read the license agreements for pylon $PYLON_VERSION on the basler download page (https://www.baslerweb.com/en/downloads/software-downloads/) and agree with it."
13-
14-
# Check --ci flag for automatic confirmation in the ci
15-
if [[ $1 == "--ci" ]]; then
16-
echo "Running in a CI environment, continuing..."
17-
SHOW_PROGRESS=""
18-
else
19-
# Ask the user if they want to continue and break if they don't
54+
# If not running in CI, ask the user to confirm license agreement
55+
if [[ "$CI" != true ]]; then
2056
read -p "Do you want to continue? [y/N] " -n 1 -r
21-
57+
echo
2258
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
2359
echo "Aborting..."
2460
exit 1
2561
fi
26-
SHOW_PROGRESS="--show-progress"
2762
fi
2863

64+
check_os_is_required_ubuntu_version () {
65+
# Check if the OS is ubuntu
66+
echo "Checking for compatible OS..."
67+
if [[ "$(lsb_release -is)" != "Ubuntu" ]]; then
68+
echo "This driver package only supports Ubuntu (and some Debian derivatives)."
69+
echo "Please install Ubuntu >= 18.04 and try again OR try it on a compatible Debian derivative with --skip-os-check."
70+
exit 1
71+
fi
72+
}
73+
2974
check_internet_connection () {
3075
# Check if we have an internet connection, except in the ci as azure does not support ping by design
31-
if [[ $1 != "--ci" ]] && ! ping -q -c 1 -W 1 google.com > /dev/null; then
76+
if [[ "$CI" != true ]] && ! ping -q -c 1 -W 1 google.com > /dev/null; then
3277
echo "No internet connection. Please check your internet connection to install the basler drivers."
3378
exit 1
3479
fi
3580
}
3681

37-
# Check if the correct pylon driver PYLON_VERSION is installed (apt)
38-
if apt list pylon --installed | grep -q $PYLON_VERSION; then
82+
# Check if the correct pylon driver PYLON_VERSION is installed (use dpkg-query)
83+
INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' pylon 2>/dev/null || true)
84+
if [[ -n "$INSTALLED_VERSION" && "$INSTALLED_VERSION" == *"$PYLON_VERSION"* ]]; then
3985
echo "Pylon driver $PYLON_VERSION is already installed."
86+
exit 0
87+
fi
88+
89+
echo "Pylon driver $PYLON_VERSION is not installed. Installing..."
90+
# Check if the OS is the required ubuntu version
91+
if [[ "$SKIP_OS_CHECK" != true ]]; then
92+
check_os_is_required_ubuntu_version
4093
else
41-
echo "Pylon driver $PYLON_VERSION is not installed. Installing..."
42-
# Check if we have an internet connection
43-
check_internet_connection "$1"
44-
# Check if the url exist
45-
if ! curl --output /dev/null --silent --head --fail "$PYLON_DOWNLOAD_URL"; then
46-
echo "Pylon download url does not exist. Please check the url and update the 'PYLON_DOWNLOAD_URL' variable in the 'make_basler.sh' script. The website might have changed."
47-
exit 1
48-
fi
49-
# Download the pylon driver to temp folder
50-
wget --no-verbose $SHOW_PROGRESS $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz.gpg
51-
# Extract the pylon driver
52-
mkdir /tmp/pylon
53-
# Decrypt the pylon driver
54-
gpg --batch --yes --passphrase "12987318371043223" -o /tmp/pylon_${PYLON_VERSION}.tar.gz -d /tmp/pylon_${PYLON_VERSION}.tar.gz.gpg
55-
# Extract the pylon driver
56-
tar -xzf /tmp/pylon_${PYLON_VERSION}.tar.gz -C /tmp/pylon/
57-
# Install the pylon driver
58-
sudo apt-get install /tmp/pylon/pylon_${PYLON_VERSION}*.deb -y
94+
echo "Skipping OS check."
95+
fi
96+
97+
# Check if we have an internet connection
98+
check_internet_connection
99+
# Check if the url exist
100+
if ! curl --output /dev/null --silent --head --fail "$PYLON_DOWNLOAD_URL"; then
101+
echo "Pylon download url does not exist. Please check the url and update the 'PYLON_DOWNLOAD_URL' variable in the 'make_basler.sh' script. The website might have changed."
102+
exit 1
59103
fi
104+
# Download the pylon driver to temp folder
105+
wget --no-verbose $SHOW_PROGRESS $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz.gpg
106+
# Extract the pylon driver
107+
mkdir -p /tmp/pylon
108+
# Decrypt the pylon driver
109+
gpg --batch --yes --passphrase "12987318371043223" -o /tmp/pylon_${PYLON_VERSION}.tar.gz -d /tmp/pylon_${PYLON_VERSION}.tar.gz.gpg
110+
# Extract the pylon driver
111+
tar -xzf /tmp/pylon_${PYLON_VERSION}.tar.gz -C /tmp/pylon/
112+
# Install the pylon driver
113+
sudo apt-get install /tmp/pylon/pylon_${PYLON_VERSION}*.deb -y

0 commit comments

Comments
 (0)