Skip to content

Commit

Permalink
expanded example README
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Jun 4, 2023
1 parent d62e8f1 commit e4a7814
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,27 @@ dronecan_dsdlc DSDL compiler

For more a more complete firmware framework please see the ArduPilot
AP_Periph firmware framework

## Building Examples

To build each of the examples cd to the subdirectory of the example
and type 'make'

You may need to install the following before building:
```
sudo pip install empy pydronecan pexpect
```

## Running Examples

Before you run the examples you need to start socketcan on Linux. See
the setup_socketcan.sh script in this directory for starting socketcan

After socketcan is setup you can run an example like this:
```
./esc_node vcan0
```
Then connect to vcan0 with the DroneCAN GUI Tool. For the esc_node and
servo_node you will need a dynamic node allocation server, which you
can start within the DroneCAN GUI tool using the rocket icon in the
bottom right corner
12 changes: 12 additions & 0 deletions examples/setup_socketcan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# this sets up a vcan0 network for use with socketcan

set -e
set -x

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
sudo ip link set vcan0 mtu 72
sudo modprobe can-gw

0 comments on commit e4a7814

Please sign in to comment.