From c32d95cbfc55f6317de8138f3bb87c4a274119c6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 27 Aug 2023 07:45:58 +1000 Subject: [PATCH] AP_CANManager: update docs --- libraries/AP_CANManager/README.md | 40 +++++-------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/libraries/AP_CANManager/README.md b/libraries/AP_CANManager/README.md index 67fd1352f1..9ce85ac00b 100644 --- a/libraries/AP_CANManager/README.md +++ b/libraries/AP_CANManager/README.md @@ -2,38 +2,10 @@ **Testing under SITL** -https://github.com/linux-can/can-utils contains a nice set of utility to do CAN related testings on Linux system. I used Ubuntu for this development, for Ubuntu systems you can simply download this tool using `sudo apt-get install can-utils` +A wide range of DroneCAN peripherals are supported in the SITL +simulation system. The simplest way of starting a DroneCAN enabled +simulated vehicle is to use sim_vehicle.py. -Following are the common commands that can be used while testing or developing: -* Create Virtual CAN Interface: -``` -sudo modprobe vcan -sudo ip link add dev vcan0 type vcan -sudo ip link set up vcan0 -sudo ip link add dev vcan1 type vcan -sudo ip link set up vcan1 -``` -* Route one CANSocket to another -``` -sudo modprobe can-gw -sudo cangw -A -s vcan0 -d vcan1 -e -sudo cangw -A -s vcan1 -d vcan0 -e -``` -* Delete routes -``` -sudo cangw -D -s vcan0 -d vcan1 -e -sudo cangw -D -s vcan1 -d vcan0 -e -``` -* Route SLCAN to VCAN, this allows connecting CAN devices to SITL run via CAN Adapter like the one running in Ardupilot itself. -``` -sudo modprobe slcan -sudo slcan_attach -f -s8 -o /dev/ttyACM0 -sudo slcand ttyACM0 slcan0 -sudo ifconfig slcan0 up -sudo cangw -A -s vcan0 -d slcan0 -e -sudo cangw -A -s slcan0 -d vcan0 -e -``` -* Dump can messages: -``` -sudo candump vcan0 -``` +For a quadplane use: sim_vehicle.py with the option -f quadplane-can + +For a quadcopter use: sim_vehicle.py with the option -f quad-can