Ultrasonic sensor integration with px4

Hello there I am looking for to use ultrasonic sensors ( I got two models in my hand, srf02 and hc sr04) with pixhawk flight controller. I couldn’t find a definitive tutorial on how to do it. I could find the driver for the devices on the official github but unlike some of the sensors that are listed in the parameters to be enabled, I couldn’t find the srf05 - it is the name of the driver in the github repo. So my question is how it should be done? Should I change something in the firmware and upload it to my fcu?

Do you know the interfaces of these sensors? E.g. analog/voltage, or UART or I2C?

1 Like

Thank you for your response, I figured it out. You have to make some changes to the firmware, that the drivers are there but not all of the available on some boards because of the resource restrictions. And I have another question to ask you, when I make changes to the default.px4 file for the sitl build I get error on the srf02 driver. But when I make the same changes for the firmware for cube black it compiles without any errors. So what might be the cause? Should I open another thread for this?

The solution is that the driver was available on the firmware files, but not included in the version that you upload to board. You have to make changes to the default.px4 file for the board you want to upload and include the drivers. Then build the firmware and upload it.