Skip to content

Commit

Permalink
Make_basler: make progress optional and fix flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jaagut committed Jan 26, 2024
1 parent d8264f2 commit 1c567e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
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"
run: make install HTTPS=true ARGS="--ci"

- name: Set up colcon workspace
run: |
Expand Down
12 changes: 10 additions & 2 deletions scripts/deploy/tasks/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ def _run(self, connections: Group) -> GroupResult:
:return: The results of the task.
"""
internet_available_results = self._internet_available_on_target(connections)

if not internet_available_results.succeeded:
return internet_available_results

# Some hosts have an internet connection, make updates and installs
apt_upgrade_results = self._apt_upgrade(get_connections_from_succeeded(internet_available_results))
if not apt_upgrade_results.succeeded:
return apt_upgrade_results

basler_install_results = self._install_basler(get_connections_from_succeeded(apt_upgrade_results))
if not basler_install_results.succeeded:
return basler_install_results

rosdep_results = self._install_rosdeps(get_connections_from_succeeded(basler_install_results))
if not rosdep_results.succeeded:
return rosdep_results

pip_upgrade_results = self._pip_upgrade(get_connections_from_succeeded(rosdep_results))
return pip_upgrade_results

Expand Down Expand Up @@ -100,7 +108,7 @@ def _install_basler(self, connections: Group) -> GroupResult:
"""
print_debug("Installing basler drivers")

cmd = f"{self._remote_workspace}/src/scripts/make_basler.sh -ci"
cmd = f"{self._remote_workspace}/src/scripts/make_basler.sh --ci"
print_debug(f"Calling {cmd}")
try:
install_results = connections.sudo(cmd, hide=hide_output(), password=self._sudo_password)
Expand Down
10 changes: 6 additions & 4 deletions scripts/make_basler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ BLAZE_VERSION="1.5.0"
# Check let the user confirm that they read the license agreement on the basler website and agree with it.
echo "You need to confirm that you read the license agreements for pylon $PYLON_VERSION and the blaze supplementary package $BLAZE_VERSION on the basler download page (https://www.baslerweb.com/en/downloads/software-downloads/) and agree with it."

# Check -ci flag for automatic confirmation in the ci
if [[ $1 == "-ci" ]]; then
# Check --ci flag for automatic confirmation in the ci
if [[ $1 == "--ci" ]]; then
echo "Running in a CI environment, continuing..."
SHOW_PROGRESS=""
else
# Ask the user if they want to continue and break if they don't
read -p "Do you want to continue? [y/N] " -n 1 -r
Expand All @@ -25,6 +26,7 @@ else
echo "Aborting..."
exit 1
fi
SHOW_PROGRESS="--show-progress"
fi

# Create function to check if we have an internet connection
Expand All @@ -49,7 +51,7 @@ else
exit 1
fi
# Download the pylon driver to temp folder
wget --no-verbose --show-progress $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz
wget --no-verbose $SHOW_PROGRESS $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz
# Extract the pylon driver
tar -xzf /tmp/pylon_${PYLON_VERSION}.tar.gz -C /tmp
# Install the pylon driver
Expand All @@ -69,7 +71,7 @@ else
exit 1
fi
# Download the blaze supplementary package to temp folder
wget --no-verbose --show-progress $BLAZE_DOWNLOAD_URL -O /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}.deb
wget --no-verbose $SHOW_PROGRESS $BLAZE_DOWNLOAD_URL -O /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}.deb
# Install the blaze supplementary package
sudo apt install /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}*.deb -y
fi

0 comments on commit 1c567e1

Please sign in to comment.