Skip to content

Commit 0d53945

Browse files
committed
merge master and fix conflicts
2 parents 056dd08 + 1678e47 commit 0d53945

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2720
-365
lines changed

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,23 @@ jobs:
1919
- env: SERVICE=imagery
2020
- env: SERVICE=dashboard
2121
- env: SERVICE=image-rec-master
22+
- env: SERVICE=grafana
2223
- stage: test
2324
env: SERVICE_TEST=telemetry
2425
language: node_js
25-
node_js: '8'
26+
node_js: '12'
2627
- env: SERVICE_TEST=interop-proxy
2728
language: elixir
2829
elixir: '1.6'
2930
- env: SERVICE_TEST=pong
3031
language: node_js
31-
node_js: '8'
32+
node_js: '12'
3233
- env: SERVICE_TEST=forward-interop
3334
language: node_js
34-
node_js: '8'
35+
node_js: '12'
3536
- env: SERVICE_TEST=imagery
3637
language: node_js
37-
node_js: '8'
38+
node_js: '10'
3839
- env: SERVICE_TEST=image-rec-master
3940
language: python
4041
python: '3.7'

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.PHONY: all
44
all: mavproxy telemetry interop-proxy pong forward-interop imagery dashboard \
5-
image-rec-master
5+
image-rec-master grafana
66

77
.PHONY: test
88
test: telemetry-test interop-proxy-test pong-test forward-interop-test \
@@ -72,6 +72,10 @@ image-rec-auto:
7272
image-rec-auto-test:
7373
$(MAKE) -C services/image-rec-auto test
7474

75+
.PHONY: grafana
76+
grafana:
77+
$(MAKE) -C services/grafana
78+
7579
.PHONY: clean
7680
clean:
7781
$(MAKE) -C services/mavproxy clean
@@ -83,3 +87,4 @@ clean:
8387
$(MAKE) -C services/dashboard clean
8488
$(MAKE) -C services/image-rec-master clean
8589
$(MAKE) -C services/image-rec-auto clean
90+
$(MAKE) -C services/grafana clean

config/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# No .env files!
2+
.env

config/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configuration Files
2+
3+
Docker Compose + other miscellaneous files for our devices.
4+
5+
Currently, we've got:
6+
7+
```bash
8+
├── ground
9+
│   ├── 37-3dr.rules # udev rule for the 3DR (/dev/)
10+
│   ├── 38-rfd900.rules # udev rule for the RFD900 (/dev/)
11+
│   └── docker-compose.yml # Compose file for the ground server (portainer, mavproxy, telemetry, interop-proxy, pong, forward-interop, dashboard, imagery)
12+
├── plane
13+
│   ├── 51-pixhawk.rules # udev rule for the Pixhawk (USB FTDI) (/dev/pixhawk)
14+
│   ├── docker-compose.yml # Compose file for the plane's computer (mavproxy, telemetry, imagery)
15+
│   └── interfaces # Network config that sets up a bridge for the camera (usb2)
16+
17+
```
18+
19+
udev rules go in `/etc/udev/rules.d`; after you copy the files over, run `udevadm control --reload-rules && udevadm trigger` to reload the rules.
20+
21+
`interfaces` should go in `/etc/network/interfaces`.
22+
23+
`docker-compose -f <compose config file> up` for Docker Compose files.

config/ground/37-3dr.rules

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", GROUP="dialout", MODE="0666", SYMLINK+="3dr"

config/ground/38-rfd900.rules

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", GROUP="dialout", MODE="0666", SYMLINK+="rfd900"

config/ground/docker-compose.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
version: '3'
2+
3+
services:
4+
portainer:
5+
image: portainer/portainer
6+
command: -H unix:///var/run/docker.sock
7+
ports:
8+
- '9000:9000'
9+
networks:
10+
- ground-net
11+
volumes:
12+
- /var/run/docker.sock:/var/run/docker.sock
13+
- portainer-data:/data
14+
restart: unless-stopped
15+
16+
mavproxy-ground:
17+
image: uavaustin/mavproxy
18+
command: --master udpout:mavproxy-plane:14551
19+
--master /dev/antenna
20+
--out udpin:0.0.0.0:14550
21+
--out udpin:0.0.0.0:14551
22+
--nowait
23+
--daemon
24+
ports:
25+
- '14550:14550/udp'
26+
extra_hosts:
27+
- mavproxy-plane:${PLANE_IP}
28+
networks:
29+
- ground-net
30+
devices:
31+
- /dev/rfd900:/dev/antenna
32+
restart: unless-stopped
33+
34+
telemetry-ground:
35+
image: uavaustin/telemetry
36+
environment:
37+
- PLANE_HOST=mavproxy-ground
38+
- PLANE_PORT=14551
39+
networks:
40+
- ground-net
41+
restart: unless-stopped
42+
43+
interop-proxy:
44+
image: uavaustin/interop-proxy
45+
environment:
46+
- INTEROP_URL=${INTEROP_URL}
47+
- USERNAME=${INTEROP_USERNAME}
48+
- PASSWORD=${INTEROP_PASSWORD}
49+
- MISSION_ID=${INTEROP_MISSION_ID}
50+
networks:
51+
- ground-net
52+
restart: unless-stopped
53+
54+
pong:
55+
image: uavaustin/pong
56+
environment:
57+
- PING_SERVICES=interop-server,${INTEROP_URL},/
58+
interop-proxy,interop-proxy:8000
59+
telemetry-plane,telemetry-plane:5000
60+
telemetry-ground,telemetry-ground:5000
61+
forward-interop,forward-interop:4000
62+
imagery-plane,image-plane:8081
63+
imagery-ground,image-ground:8081
64+
pong,pong:7000
65+
extra_hosts:
66+
- telemetry-plane:${PLANE_IP}
67+
- imagery-plane:${PLANE_IP}
68+
networks:
69+
- ground-net
70+
restart: unless-stopped
71+
72+
forward-interop:
73+
image: uavaustin/forward-interop
74+
environment:
75+
- TELEMETRY_HOST=telemetry-plane
76+
- INTEROP_PROXY_HOST=interop-proxy
77+
extra_hosts:
78+
- telemetry-plane:${PLANE_IP}
79+
networks:
80+
- ground-net
81+
restart: unless-stopped
82+
83+
dashboard:
84+
image: uavaustin/dashboard
85+
tty: true
86+
environment:
87+
- INTEROP_PROXY_URL=interop-proxy:8000
88+
- FORWARD_INTEROP_URL=forward-interop:4000
89+
- PONG_URL=pong:7000
90+
networks:
91+
- ground-net
92+
restart: unless-stopped
93+
94+
imagery-ground:
95+
image: uavaustin/imagery
96+
environment:
97+
- BACKEND=sync
98+
- IMAGERY_SYNC_HOST=imagery-plane
99+
- IMAGERY_SYNC_PORT=8081
100+
extra_hosts:
101+
- imagery-plane:${PLANE_IP}
102+
networks:
103+
- ground-net
104+
volumes:
105+
- ./imagery:/opt/imagery
106+
restart: unless-stopped
107+
108+
networks:
109+
ground-net:
110+
111+
volumes:
112+
portainer-data:

config/plane/51-pixhawk.rules

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ATTRS{idVendor}=="2dae", ATTRS{idProduct}=="1011", GROUP="dialout", MODE="0666", SYMLINK+="pixhawk"
2+

config/plane/docker-compose.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: '3'
2+
3+
services:
4+
portainer-agent-plane:
5+
image: portainer/agent
6+
ports:
7+
- '9001:9001'
8+
networks:
9+
- plane-net
10+
volumes:
11+
- /var/run/docker.sock:/var/run/docker.sock
12+
- /var/lib/docker/volumes:/var/lib/docker/volumes
13+
restart: unless-stopped
14+
15+
mavproxy-plane:
16+
image: uavaustin/mavproxy
17+
command: --master=/dev/pixhawk
18+
--out udpin:0.0.0.0:14550
19+
--out udpin:0.0.0.0:14551
20+
--daemon
21+
--nowait
22+
ports:
23+
- '14550:14550/udp'
24+
- '14551:14551/udp'
25+
networks:
26+
- plane-net
27+
devices:
28+
- /dev/pixhawk:/dev/pixhawk
29+
restart: unless-stopped
30+
31+
telemetry-plane:
32+
image: uavaustin/telemetry
33+
environment:
34+
- PLANE_HOST=mavproxy-plane
35+
- PLANE_PORT=14550
36+
ports:
37+
- '5000:5000'
38+
networks:
39+
- plane-net
40+
restart: unless-stopped
41+
42+
imagery-plane:
43+
image: uavaustin/imagery
44+
environment:
45+
- BACKEND=z-cam-e1
46+
- TELEMETRY_HOST=telemetry-plane
47+
- TELEMETRY_PORT=5000
48+
- CAMERA_HOST=192.168.168.1
49+
- CAMERA_PORT=80
50+
- MAX_IMAGES=2048
51+
ports:
52+
- '8081:8081'
53+
networks:
54+
- plane-net
55+
volumes:
56+
- './imagery:/opt/imagery'
57+
restart: unless-stopped
58+
59+
networks:
60+
plane-net:

config/plane/interfaces

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# interfaces(5) file used by ifup(8) and ifdown(8)
2+
# Include files from /etc/network/interfaces.d:
3+
source-directory /etc/network/interfaces.d
4+
5+
auto usb2
6+
allow-hotplug usb2
7+
iface usb2 inet static
8+
address 192.168.168.2
9+
netmask 255.255.255.0
10+
gateway 192.168.168.1

services/common/messages/interop.proto

+27-7
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,30 @@ message AerialPosition {
3030
double alt_msl = 3;
3131
}
3232

33-
// Mission on the interop server.
34-
//
35-
// Note the lack of an active field, as all missions passed into the
36-
// stack will be assumed to be active.
33+
// Lists the opponent teams telemetry provided by the interop server
34+
message Teams {
35+
message Team {
36+
message TeamTelem {
37+
uint32 id = 1;
38+
double age_sec = 2;
39+
string timestamp = 3;
40+
AerialPosition pos = 4;
41+
double yaw = 5;
42+
}
43+
44+
uint32 id = 1;
45+
string username = 2;
46+
string name = 3;
47+
string university = 4;
48+
bool in_air = 5;
49+
TeamTelem telem = 6;
50+
}
51+
52+
double time = 1;
53+
repeated Team teams = 2;
54+
}
55+
56+
// Mission on the interop server with the desired mission ID.
3757
message InteropMission {
3858
message FlyZone {
3959
double alt_msl_max = 1;
@@ -42,11 +62,11 @@ message InteropMission {
4262
}
4363

4464
double time = 1;
45-
// If there even is an active mission or not.
65+
// If the mission with given id exists.
4666
bool current_mission = 2;
4767
Position air_drop_pos = 3;
4868
repeated FlyZone fly_zones = 4;
49-
Position home_pos = 5;
69+
// 5 reserved.
5070
repeated AerialPosition waypoints = 6;
5171
Position off_axis_pos = 7;
5272
Position emergent_pos = 8;
@@ -68,7 +88,7 @@ message Obstacles {
6888

6989
double time = 1;
7090
repeated StationaryObstacle stationary = 2;
71-
repeated MovingObstacle moving = 3;
91+
// 3 reserved.
7292
}
7393

7494
// Telemetry to upload to the server.

services/dashboard/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
ARG BASE=node:8-slim
2-
31
# Compile our js source
4-
FROM ${BASE} AS builder
2+
FROM node:12-slim AS builder
53

64
WORKDIR /builder
75

@@ -19,7 +17,7 @@ COPY dashboard .
1917
RUN npm run build
2018

2119
# Making the actual image now
22-
FROM ${BASE}
20+
FROM node:12-slim
2321

2422
WORKDIR /app
2523

services/forward-interop/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
ARG BASE=node:8-alpine
2-
31
# Compile our js source.
4-
FROM ${BASE} AS builder
2+
FROM node:12-alpine AS builder
53

64
WORKDIR /builder
75

@@ -22,7 +20,7 @@ COPY forward-interop .
2220
RUN npm run build
2321

2422
# Make the actual image now.
25-
FROM ${BASE}
23+
FROM node:12-alpine
2624

2725
WORKDIR /app
2826

services/forward-interop/Dockerfile.test

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
ARG BASE=node:8-alpine
2-
3-
FROM ${BASE}
1+
FROM node:12-alpine
42

53
ENV NODE_ENV=test
64

services/grafana/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM grafana/grafana
2+
3+
COPY grafana/provisioning /etc/grafana/provisioning
4+
5+
# Grafana's Dockerfile uses ENTRYPOINT so we have to override
6+
# ENTRYPOINT ourselves instead of using CMD. Sigh.
7+
ENTRYPOINT envsubst "$INFLUX_HOST $INFLUX_PORT $DB_NAME" \
8+
< /etc/grafana/provisioning/datasources/datasource.yaml \
9+
> /etc/grafana/provisioning/datasources/datasource.yaml && \
10+
/run.sh

0 commit comments

Comments
 (0)