-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_system.sh
More file actions
executable file
·88 lines (72 loc) · 2.06 KB
/
setup_system.sh
File metadata and controls
executable file
·88 lines (72 loc) · 2.06 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
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
#!/bin/bash
# System setup for OpenArm bimanual + leader arm module
set -e
echo "=== OpenArm System Setup ==="
echo "Installing OpenArm system packages..."
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:openarm/main
sudo apt-get update
sudo apt-get install -y \
can-utils \
iproute2 \
libopenarm-can-dev \
openarm-can-utils
echo "OpenArm CLI tools installed"
echo "Setting up systemd-networkd CAN configuration..."
sudo tee /etc/systemd/network/can0.network > /dev/null <<'EOF'
[Match]
Name=can0
[CAN]
BitRate=1000000
DataBitRate=5000000
FDMode=yes
RestartSec=100ms
EOF
sudo tee /etc/systemd/network/can1.network > /dev/null <<'EOF'
[Match]
Name=can1
[CAN]
BitRate=1000000
DataBitRate=5000000
FDMode=yes
RestartSec=100ms
EOF
sudo tee /etc/systemd/network/can2.network > /dev/null <<'EOF'
[Match]
Name=can2
[CAN]
BitRate=1000000
DataBitRate=5000000
FDMode=yes
RestartSec=100ms
EOF
sudo tee /etc/systemd/network/can3.network > /dev/null <<'EOF'
[Match]
Name=can3
[CAN]
BitRate=1000000
DataBitRate=5000000
FDMode=yes
RestartSec=100ms
EOF
echo "Enabling systemd-networkd..."
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd
echo "Reloading networkd config..."
sudo networkctl reload
echo ""
echo "=== CAN Interface Status ==="
for iface in can0 can1 can2 can3; do
ip link show $iface 2>/dev/null && echo "$iface is up" || echo "$iface not found (plug in USB adapter)"
done
echo ""
echo "Setup complete! CAN interfaces will now auto-configure on every boot and USB plug."
echo ""
echo "Next steps:"
echo " 1. Verify CAN: ip link show can0 can1 can2 can3"
echo " 2. Calibrate hardware:"
echo " openarm-can-zero-position-calibration --canport can0 --arm-side right_arm # follower right"
echo " openarm-can-zero-position-calibration --canport can1 --arm-side left_arm # follower left"
echo " openarm-can-zero-position-calibration --canport can2 --arm-side right_arm # leader right"
echo " openarm-can-zero-position-calibration --canport can3 --arm-side left_arm # leader left"