Is dronecan / uavcan data displayed in QGC?

Hi, I have some ARKcan canNodes, its a basic can node with an inbuilt IMU.

I’m not sure if i’ve got them working properly as I don’t actually know what a successful connection is supposed to look like. Am I able to actually view the IMU data in QGC, or even a device like an external IMU or servo. Or is this something that gets logged and I can look post flight?

I can view parameters for them in QGC, but I’m not sure where else to go from there, and there isn’t too much documentation saying what to do with it after setup, which makes me think either I don’t actually understand the device or somethings gone wrong somewhere.

Also, documentation of the ARK CANnode itself is also unhelpful for my situation (maybe just outdated), I thought the LED status colour may help me, mine flashes green with the occasional blue… they never mention green, only red and blue

Any help is great as I don’t have much knowledge or experience with the can bus.
Thanks
Owen

One thing that you can do to get more insights is uavcan status in “Analyze Tools → MAVLink shell”.

hi @JulianOes ,

Thanks for the reply

I’ve had a look at uavcan status , I get some information, most of it is the non-specific “usual stuff”. The only specific thing I could see was the device ID of the node, so I suppose that confirms that its on, but what about the IMU on board, or the components I have plugged in on the I2C ports of the node, should they be showing up here as well?

I also get a list of sensors that seem to change every time I try this command, I’ve had sensors such as mag, IMU, gyros, gnss and ‘gnss_relative’, none of which have ever given any data when attempted to read, likely because they never existed!

Are there other ways/places to view the data, MAVLink for example, or is can something read using other methods not relying on QGC? Still not entirely convinced I understand the way the can bus works, or perhaps I’m not understanding how its integrated with PX4/QGC?

If this is more to do with PX4 I may open a new question on that section instead, would be more sensible there.

Thanks
Owen

Hi Owen, what do you want to accomplish with the CANnode?

Hi @AlexKlimaj

So essentially I want to have servos and some I2C IMU sensors connected to the CANnode. I would like to know where/how to get the data from the sensors and the inbuilt IMU as well, whether it be via MAVLink message or something that is simply logged etc.

I have not actually played around with servos yet but that seems like it should be a bit more straight forwards

Note: The IMUs I am using are not supported by PX4 by default, I have some custom drivers for them and if my understanding is correct these drivers can also be used on the CANnode? I have also tested with other I2C devices that are supported still with no luck.

You will need to build the custom drivers into the CANnode firmware.

Here is the PR for transmitting IMU data over Dronecan from the CANnode.

This PR can only send IMU data from one IMU FYI. If you add extra I2C IMUs.

For servos, you will need to configure the Control allocator params on the CANnode and the Dronecan/UAVCAN params on the flight controller.

Ahh I see thankyou for this, this will be very helpful.

I’ll have a play around and see what I can do :slight_smile:

When it comes to building the firmware with the driver is it as simple as adding the “CONFIG_DRIVER_IMU…” bit to the default.px4board file or is there a little more to it?

Yes, that is all you need for an I2C IMU driver.

1 Like

Hi @AlexKlimaj ,
I’ve had a play around with everything and I still don’t see any sort of data from any sensors whether it be the onboard IMU or one of the external I2C sensors I have (both supported and custom)

Any ideas as to what I’m doing wrong?

Did you cherry pick that PR into your branch? To publish the IMU data?
You can check the CANnode debug console to check if your sensors are running.

Yep I’ve put that PR in my branch.

How might I check the debug console, I’m quite new to the debug process. Or do you just mean running uavcan status to check?

No, the debug console on the CANnode itself. The 6 pin jst-sh. With a serial connection.

Ah okay thank you, that is completely new to me, is there some documentation written anywhere so I can learn what to do, don’t want to waste your time asking if its already explained somewhere : )

Edit: I think I just generally don’t understand debugging/ what it is, doing some research now, feel free to point me any specific directions that you think might be helpful.

1 Like

Hi @AlexKlimaj

I’ve done a lot of reading and a lot of testing and have made some solid progress and understanding, however I’m still having issues, particularly with the I2C part.

I’ve got the onboard IMU working, turns out the firmware with the PR on never properly uploaded to the node despite everything looking like it had. Also one of the params you mention in that PR is not up to date if you weren’t aware. So got that all sorted and can now see them in the mavlink shell.

So with I2C, I am confused as to how I only need to add the driver to the build file for it to work, I was expecting to need some sort of parameter to enable the IMU similar I the onboard one or any other sensor found in the sens tab eg SENS_EN_MS4525DO? But I don’t get anything at all. Surely I need something to tell the node to start the driver and receive data?

I’ve also noticed that my custom driver does not publish IMU data in the same way, it publishes the final vehicle attitude with its own uORB topic - sensor_attitude. From reading how the code is written am I right in saying I will need to add something new in for this, perhaps in the uavcan and the uavcannode sections of PX4.

And then even the ASI that is supported already by PX4 still doesn’t work like before

I didn’t have any luck with debugging, couldn’t seem to get anything to work, any ideas on any of the above?
thanks
Owen

Hello again,

I’m revisiting the debugging side of things, the documents show a few different methods for debugging, just wanted to confirm ive got the right method. Previously I attempted to debug using an FTDI cable but have now switched

Ive got an STLink-V3MINIE, have wired it up to the debug port on the node, installed OpenOCD and will run the following.

openocd -f interface/stlink.cfg -f target/stm32f4x.cfg

is this the correct path to be going down?

Hello again…

So I figured out the debug stuff, turns out the driver is not running. How to I get it to start on boot for I2C devices?

I think I’m right with needing a custom CAN message, I’ve begun writing but I think I still need some guidance for the receiving end on PX4 if you can help with that at all

For anyone following along or visiting this with the same problems, I have figured it all out and will write findings here at some point in the next week!!!

Doing this slightly later than I said I would but oh well!!

So the original question was “Can I view data from dronecan in QGC?” - short answer is yes you can.

In my case with custom sensors however it is a bit more involved.

Rough guide

  • As listed in the docs you will need to include your custom driver into the ARK node firmware.
  • Your sensor data will be published to a uORB topic, if this is not a topic that is already supported in the CAN messages, you will need to write your own. The process of doing this is not too complicated and should be self explanatory from the current messages. Examples
  • After that you also will also need to write a driver for px4 to receive the message and then publish to a uorb topic of your chosing. Again not too difficult to do. Examples

After that using the normal listener your_uorb_name command you can see your data down from the bus