Skip to content

Commit 2c28b4b

Browse files
authored
Merge pull request #464 from tiiuae/release_candidate_2.2.0
Release candidate 2.2.0 to main
2 parents b383dd4 + 74c76dc commit 2c28b4b

File tree

415 files changed

+77682
-659
lines changed

Some content is hidden

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

415 files changed

+77682
-659
lines changed

.github/workflows/tii-mesh-com.yaml

+18-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,27 @@ on:
1616
jobs:
1717
tii-mesh-com:
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
1922
steps:
23+
- name: Free Disk Space (Ubuntu)
24+
uses: jlumbroso/free-disk-space@main
25+
with:
26+
tool-cache: false
27+
28+
- uses: actions/checkout@v4
2029

21-
- uses: actions/checkout@v2
30+
- uses: docker/setup-buildx-action@v3
2231

23-
- uses: docker/setup-buildx-action@v1
32+
- name: Setup QEMU
33+
uses: docker/setup-qemu-action@v3
34+
with:
35+
platforms: amd64,arm64,riscv64
2436

2537
- name: Docker meta
2638
id: meta
27-
uses: docker/metadata-action@v3
39+
uses: docker/metadata-action@v5
2840
with:
2941
images: ghcr.io/tiiuae/tii-mesh-com
3042
tags: |
@@ -34,16 +46,17 @@ jobs:
3446
type=raw,value=latest
3547
3648
- name: Login to GitHub Container Registry
37-
uses: docker/login-action@v1
49+
uses: docker/login-action@v3
3850
with:
3951
registry: ghcr.io
4052
username: ${{ github.actor }}
4153
password: ${{ secrets.GITHUB_TOKEN }}
4254

4355
- name: Build tii-mesh-com image and push
44-
uses: docker/build-push-action@v2
56+
uses: docker/build-push-action@v5
4557
with:
4658
context: .
59+
platforms: linux/amd64,linux/arm64,linux/riscv64
4760
file: ./modules/mesh_com/Dockerfile
4861
push: true
4962
tags: ${{ steps.meta.outputs.tags }}

common/scripts/default-mesh.sh

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash -eu
2+
3+
# Check if proper default mesh class is set
4+
if [[ "$MESH_CLASS" != "gs" && "$MESH_CLASS" != "edge" ]]; then
5+
echo "Wrong mesh class, check container env parameters"
6+
exit 1
7+
else
8+
echo "Mesh class: " "$MESH_CLASS"
9+
fi
10+
11+
# Function to check if drone is provisioned
12+
check_drone_provisioned() {
13+
echo "INFO: Checking if drone is provisioned..."
14+
while true; do
15+
if [ "$DRONE_DEVICE_ID" = "bootstrap" ]; then
16+
sleep 10
17+
else
18+
echo "INFO: Drone is provisioned, continuing"
19+
break
20+
fi
21+
done
22+
}
23+
24+
# Function to start mesh executor to publish ROS topic
25+
start_mesh_executor() {
26+
sleep 120
27+
echo "INFO: Starting ROS topic"
28+
ros-with-env /opt/ros/"${ROS_DISTRO}"/lib/mesh_com/mesh_executor
29+
}
30+
31+
#Function to start mesh-11s.sh
32+
start_mesh-11s() {
33+
/opt/ros/"${ROS_DISTRO}"/share/bin/mesh-11s.sh "$MESH_MODE" "$MESH_IP" "$MESH_MASK" "$MESH_MAC" "$MESH_KEY" "$MESH_ESSID" "$MESH_FREQ" "$MESH_TX" "$MESH_COUNTRY"
34+
echo "mesh setup done"
35+
}
36+
37+
38+
# Set IP based on drone role/type.
39+
if [[ "$DRONE_TYPE" == "recon" ]]; then
40+
# 192.168.240.1-192.168.246.255
41+
MESH_IP="$EDGE_IP"
42+
start_mesh-11s
43+
gateway_ip="$FOG_GW_VIP" # VRRP FOG virtual IP for the Default mesh
44+
route add default gw "$gateway_ip" bat0
45+
check_drone_provisioned
46+
# Start executor. Required to publish ROS2 topic.
47+
start_mesh_executor
48+
elif [ "$DRONE_TYPE" == "groundstation" ]; then
49+
MESH_IP="$GS_IP"
50+
start_mesh-11s
51+
check_drone_provisioned
52+
# Start executor. Required to publish ROS2 topic.
53+
start_mesh_executor
54+
elif [[ "$DRONE_TYPE" == "fog" || "$DRONE_TYPE" == "cm-fog" ]]; then
55+
if [ "$MESH_CLASS" == "edge" ]; then # mesh class is edge
56+
MESH_IP=$EDGE_IP
57+
else
58+
# mesh class is gs; single cm-fog or fog: 192.168.248.10; multiple cm-fog: 192.168.248.2-9
59+
MESH_IP=$FOG_IP_IN_GS_MESH
60+
fi
61+
start_mesh-11s
62+
if [ "$MESH_CLASS" == "gs" ]; then
63+
gateway_ip="$GS_GW_VIP" # VRRP GS virtual IP for the Default mesh
64+
route add default gw "$gateway_ip" bat0
65+
fi
66+
check_drone_provisioned
67+
# Start executor. Required to publish ROS2 topic.
68+
start_mesh_executor
69+
elif [[ "$DRONE_TYPE" == "singlemesh" ]]; then
70+
# singlemesh: 192.168.248.11-254
71+
MESH_IP="$RECON_IP_IN_GS_MESH"
72+
start_mesh-11s
73+
# mesh class is gs
74+
gateway_ip="$GS_GW_VIP" # VRRP GS virtual IP for the Default mesh
75+
route add default gw "$gateway_ip" bat0
76+
check_drone_provisioned
77+
# Start executor. Required to publish ROS2 topic.
78+
start_mesh_executor
79+
else
80+
echo "drone type not implemented: $DRONE_TYPE"
81+
exit 1
82+
fi

0 commit comments

Comments
 (0)