-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaoi.install.bash
35 lines (29 loc) · 1.22 KB
/
aoi.install.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# This script installs custom Python dependencies to
# the ament folder structure. This script is meant to be used
# for package development. Ensure to run `colcon build` first
# to initialize the required folder structure. Python packages
# will be available using the global interpreter after running
# the following commands (packages are not installed globally,
# only added to the Python path, see `echo $PYTHONPATH`):
# >>> source /opt/ros/foxy/setup.bash && source install/setup.bash
# Variables
SITE_PACKAGES="install/open_aoi_core/lib/python3.8/site-packages"
REQUIREMENTS="requirements.txt"
# Function to install Python dependencies
install_dependencies() {
echo "Installing Python dependencies for AOI ROS services"
pip3 install -r $REQUIREMENTS --target=$SITE_PACKAGES
pip3 install pyopenssl --upgrade --target=$SITE_PACKAGES
}
# Check if the site-packages directory exists
if [[ -d $SITE_PACKAGES ]]; then
install_dependencies
else
echo "Unable to install dependencies - ament workspace is not initialized. Directory not found: $SITE_PACKAGES"
exit 1
fi
# Source ROS 2 and workspace setup scripts
source /opt/ros/foxy/setup.bash
source install/setup.bash
echo "Setup and installation complete."