-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (49 loc) · 1.34 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
all: sim
# ---------------------------------- Native ---------------------------------- #
# Launch on the raspberry pi
nav:
$(MAKE) nav-connect
$(MAKE) nav-run
nav-connect:
./start_can.sh
nav-run:
./build/source/quadson
nav-pause:
./build/source/quadson -p
nav-disconnect:
./stop_can.sh
nav-clean:
make -C ./build clean
# --------------------------------- Emulation -------------------------------- #
# C++ build, run for real time control on PC (x86) using docker
emu:
$(MAKE) emu-build
$(MAKE) emu-start
emu-build:
docker buildx build -f Dockerfile.emu \
--platform linux/arm/v7 \
--load -t quadson-emu:latest .
emu-start:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -it \
--platform linux/arm/v7 \
--name quadson-emu \
--network=host \
--cap-add=NET_ADMIN \
--device /dev/:/dev/ \
-v /tmp/:/tmp/ \
-v /run/udev/:/run/udev/ \
--mount type=bind,source=$(CURDIR)/quadson,target=/quadson \
quadson-emu:latest
# -------------------------------- Simulation -------------------------------- #
# Python build, run for simulation
sim:
$(MAKE) sim-build
$(MAKE) sim-start
sim-build:
docker build -f Dockerfile.sim -t quadson-sim:latest .
sim-start:
docker run -it --rm \
--name quadson-sim \
--mount type=bind,source=$(CURDIR)/quadson-sim,target=/quadson-sim \
quadson-sim:latest