Hello. I am trying to setup collision prevention using distance information from ultrasonic sensors. I have a flight management unit (FMU) running PX4 and a microcontroller sending MAVLink messages to the FMU. I have yet to decide how I would connect the microcontroller to the FMU (by UART or SPI).
I am following instructions on the this page (https://docs.px4.io/v1.9.0/en/computer_vision/collision_prevention.html). The only thing it mentions to be done at the PX4 side is to configure the MPC_COL_PREV_D parameter. I am wondering if there is anything else that I need to add at the PX4 side. For example, how does PX4 know where the MAVLink messages of distance information is coming from? I suppose that the code for receiving MAVLink messages from UART could be different from the code for receiving MAVLink messages from SPI. Does PX4 already has code to receive MAVLink messages from any ports and decode the messages?
I apologize if my question is not clear or if it is too naive. I am quite new to PX4 and any help will be appreciated.