-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_pc.sh
More file actions
54 lines (44 loc) · 1.89 KB
/
build_pc.sh
File metadata and controls
54 lines (44 loc) · 1.89 KB
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
set -e
# ======================================================================
# build_pc.sh Build rover workspace on the main PC (Noetic)
# ======================================================================
WS=~/rover_wse
SRC=$WS/src
LOG="$WS/build_pc.log"
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${GREEN}=== Rover Build Script (PC / Simulation + MoveIt) ===${NC}"
echo -e "Log: $LOG"
echo -e "Workspace: $WS"
# ----------------------------------------------------------------------
# 1. Validate workspace
# ----------------------------------------------------------------------
if [ ! -d "$WS/src" ]; then
echo -e "${RED}ERROR: $WS/src does not exist.${NC}"
exit 1
fi
# ----------------------------------------------------------------------
# 2. Environment setup
# ----------------------------------------------------------------------
source /opt/ros/noetic/setup.bash || true
[ -f "$WS/devel/setup.bash" ] && source "$WS/devel/setup.bash"
# ----------------------------------------------------------------------
# 3. Remove CATKIN_IGNORE files for PC
# ----------------------------------------------------------------------
echo "Unignoring all packages..."
find "$SRC" -name CATKIN_IGNORE -type f -delete
# ----------------------------------------------------------------------
# 4. Install missing dependencies
# ----------------------------------------------------------------------
echo -e "${GREEN}Installing ROS dependencies...${NC}"
rosdep install --from-paths "$SRC" --ignore-src -r -y | tee "$LOG"
# ----------------------------------------------------------------------
# 5. Build workspace
# ----------------------------------------------------------------------
echo -e "${GREEN}Building (full sim + MoveIt)...${NC}"
cd "$WS"
catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo 2>&1 | tee -a "$LOG"
echo ""
echo -e "${GREEN}=== Build completed successfully on PC ===${NC}"