-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
102 lines (82 loc) · 3.01 KB
/
Makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.PHONY : basler webots install install-no-root pip pre-commit install-git-filters format pull-all pull-init pull-repos pull-files fresh-libs remove-libs setup-libs rosdep status update update-no-root
HTTPS := ""
REPO:=$(dir $(abspath $(firstword $(MAKEFILE_LIST))))
basler:
# Install Basler Pylon SDK
scripts/make_basler.sh $(ARGS)
webots:
# Install Webots Simulation environment
scripts/make_webots.sh $(ARGS)
install: pull-init basler update
install-no-root: pull-init update-no-root
pip:
# Install and upgrade pip dependencies
pip install --upgrade -r requirements/dev.txt --user
pre-commit:
# Install pre-commit hooks for all submodules that have a .pre-commit-config.yaml file
pre-commit install
install-git-filters:
# Install git filters
# The vscode settings file gets updated by the ros extension and contains the full path to the current user's home directory.
# We don't want to commit this path, so we use a git filter to remove it when git adds the file to the staging area.
# This does not affect the file on disk, so vscode will still work as expected.
git config filter.removeFullHomePath.clean "sed '/\/\(home\|root\).*\(install\|build\)/d'"
format:
# Format all files in the repository
pre-commit run --all-files
pull-all: pull-repos pull-files
pull-init: fresh-libs pull-files
pull-repos:
# Pull all repositories
vcs pull . --nested
pull-files:
# Pull all large files (mainly neural network weights) from the http server
wget \
--no-verbose \
--show-progress \
--timeout=15 \
--tries=2 \
--recursive \
--timestamping \
--no-parent \
--no-host-directories \
--directory-prefix=$(REPO)/bitbots_vision \
--reject "index.html*" \
"https://data.bit-bots.de/models/"
wget \
--no-verbose \
--show-progress \
--timeout=15 \
--tries=2 \
--recursive \
--timestamping \
--no-parent \
--no-host-directories \
--directory-prefix=$(REPO)/bitbots_motion/bitbots_rl_motion \
--reject "index.html*" \
"https://data.bit-bots.de/rl_walk_models/"
fresh-libs: remove-libs setup-libs
remove-libs:
# Removes the lib directory and all its contents
rm -rf lib/*
# Also remove the generated protobuf files, as they are not needed anymore
rm bitbots_team_communication/bitbots_team_communication/robocup_extension_pb2.py 2> /dev/null || true
setup-libs:
# Clone lib repositories in workspace.repos into the lib directory
ifeq ($(HTTPS), true)
# Replace git@ with https:// to allow cloning without ssh keys
awk '{sub("[email protected]:", "https://github.com/"); print " " $$0}' workspace.repos | vcs import .
else
vcs import . < workspace.repos
endif
rosdep:
# Initialize rosdep if not already done
[ -f /etc/ros/rosdep/sources.list.d/20-default.list ] || sudo rosdep init
# Update rosdep and install dependencies from meta directory
rosdep update
rosdep install --from-paths . --ignore-src --rosdistro iron -y
status:
# Show status of all repositories
vcs status . --nested
update: pull-all rosdep pip install-git-filters pre-commit
update-no-root: pull-all pip install-git-filters pre-commit