forked from wengmister/Apex-Putter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource_installs_zkw.sh
executable file
·54 lines (42 loc) · 1.36 KB
/
source_installs_zkw.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Script to set up ROS2 environment with Apex-Putter and Franka workspace
# This script sources the necessary setup files for the project
# Function to check if sourcing was successful
source_and_check() {
local setup_file="$1"
local description="$2"
if [ ! -f "$setup_file" ]; then
echo "Error: $description setup file not found at: $setup_file"
return 1
fi
echo "Sourcing $description..."
. "$setup_file"
if [ $? -ne 0 ]; then
echo "Error: Failed to source $description"
return 1
fi
echo "Successfully sourced $description"
return 0
}
# Directory paths
APEX_PUTTER_DIR="$HOME/me495/final_project/Apex-Putter"
FRANKA_WS_DIR="$HOME/ws/franka"
VENV_ROS_DIR="$HOME/venv_ros"
CALIBRATION_ROS_DIR="$HOME/easy_handeye2_ws"
# Source Apex-Putter setup
if ! source_and_check "$APEX_PUTTER_DIR/install/setup.bash" "Apex-Putter"; then
exit 1
fi
# Source Franka workspace setup
if ! source_and_check "$FRANKA_WS_DIR/install/setup.bash" "Franka workspace"; then
exit 1
fi
# Source ROS virtual environment setup
if ! source_and_check "$VENV_ROS_DIR/install/setup.bash" "ROS virtual environment"; then
exit 1
fi
# Source easy handeye
if ! source_and_check "$CALIBRATION_ROS_DIR/install/setup.bash" "easy handeye"; then
exit 1
fi
echo "All environments successfully sourced!"