CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/CAN/can_sitl_nodev.sh
Views: 1799
1
#!/usr/bin/env bash
2
3
# once run, you can configure SITL for CAN just like a real board, with the CAN parameters
4
#
5
# CAN_P1_DRIVER=1
6
# CAN_D1_PROTOCOL=1
7
8
# once running you can also attach uavcan_gui_tool to vcan0 to monitor the CAN bus
9
10
set -e
11
set -x
12
13
# cleanup from a previous run
14
sudo killall -9 slcand 2> /dev/null || true
15
for m in slcan can-gw vcan can_raw can; do
16
sudo rmmod $m 2> /dev/null || true
17
done
18
19
sudo modprobe vcan
20
sudo ip link add dev vcan0 type vcan
21
sudo ip link set up vcan0
22
sudo ip link set vcan0 mtu 72
23
sudo modprobe can-gw
24
25