Skip to content

Deprecated: Setup pyuavcan

generationmake edited this page Jan 1, 2021 · 2 revisions

This is kept for legacy reasons and to understand what was done in the past ...

After the installation of yakut the command pyuavcan is no longer available.

Install pyuavcan

  • Install libatlas sudo apt-get install libatlas-base-dev
  • python3 is already installed, link to python 3
  • update pip pip3 install —upgrade pip get the latest version of pyuavcan directly from its github repository and install it.
git clone https://github.com/UAVCAN/pyuavcan
cd pyuavcan
python3 -m pip install .

This should install the pyuavcan including pyuavcan-cli in /home/pi/.local/bin.

To access pyuavcan easily the path should be added to PATH. On raspbian this is done by default. Otherwise update $PATH in .profile and add the line:

$PATH="$PATH:/home/pi/.local/bin"

Generate DSDL:

cd ~
pyuavcan dsdl-gen-pkg https://github.com/UAVCAN/public_regulated_data_types/archive/master.zip

Send test string:

pyuavcan publish uavcan.diagnostic.Record.1.0 '{"text": "Hello world!"}' --tr='CAN(can.media.socketcan.SocketCANMedia("vcan0",8),59)'

59 is the node number and can be changed to any desired value.

The text string should be visable in a second window running candump.

Now the installation of pyuavcan is finished.

commands

publish disgnostic record

pyuavcan

pyuavcan publish uavcan.diagnostic.Record.1.0 '{"text": "Hello world!"}' --tr='CAN(can.media.socketcan.SocketCANMedia("vcan0",8),59)'

yakut

yakut --transport='CAN(can.media.socketcan.SocketCANMedia("vcan0",8),59)' publish uavcan.diagnostic.Record.1.0 '{"text": "Hello world!"}'

subscribe heartbeat

pyuavcan

pyuavcan sub uavcan.node.Heartbeat.1.0 -M --tr='CAN(can.media.socketcan.SocketCANMedia("can0",8),59)'

yakut

yakut --transport='CAN(can.media.socketcan.SocketCANMedia("can0",8),59)' sub uavcan.node.Heartbeat.1.0

publish to Subject-ID

pyuavcan

pyuavcan pub 1620.uavcan.primitive.scalar.Bit.1.0 'value: true' --tr='CAN(can.media.socketcan.SocketCANMedia("can0",8),59)'

yakut

yakut -i 'CAN(can.media.socketcan.SocketCANMedia("can0",8),59)' pub 1620.uavcan.primitive.scalar.Bit.1.0 'value: true'

subscribe to Subject-ID

pyuavcan

pyuavcan sub 1624.uavcan.primitive.scalar.Bit.1.0 -M --tr='CAN(can.media.socketcan.SocketCANMedia("can0",8),59)'

yakut

yakut -i 'CAN(can.media.socketcan.SocketCANMedia("can0",8),59)' sub 1624.uavcan.primitive.scalar.Bit.1.0