Adding a new CAN bus device

Hello,

I’m trying to add communication between ardupilot and a CAN bus device with custom data frames that do not follow UAVCAN protocol. Has anyone done this before and can point me to an example? Does anyone know of an example on how to read raw CAN bus data in ardupilot?

Thank you!

https://dronecan.github.io/Examples/Simple_sensor_node/

Thank you that’s very helpful, but I’m running ChibiOS. Have you seen how it’s done on ChibiOS?

Assuming your device already works, and you just need ArduPilot to read it, two options.

  1. Add the CAN protocol to ArduPilot (ardupilot/libraries/AP_KDECAN at master · ArduPilot/ardupilot · GitHub is an example); or
  2. Use a Lua script to parse the can packets (example: ardupilot/CAN_read.lua at master · ArduPilot/ardupilot · GitHub).