UART rangefinder integration with VOXL 2 Mini
-
I have a UART distance sensor from ARK Electronics that I'd like to integrate with VOXL 2 mini. First of all I have a question on wiring: Can this be wired to J10 on VOXL or it has to be connected to an expansion board (we have M0188)? and second question is do I need to add driver to voxl-px4 for this sensor to work?
-
@psafi Which sensor is it?
-
@psafi J10 is a UART mapped to the applications processor (Linux). Most of PX4 runs on the DSP and uses UARTs mapped to the DSP. To use J10 you would have to include the driver module into the applications processor build and then start it in the start script.
-
@Eric-Katzfey ARK FLOW with some customization to enable UART
-
@psafi So which driver do you use in PX4 then? Do you have a custom driver since you modified it to use UART instead of UAVCAN?
-
@Eric-Katzfey My expectation is that I am going to receive mavlink messages from it. There is no driver for this product in mainstream PX4. I have never integrated UART version only CAN (which was plug and play with px4, i.e. I was receiving DISTANCE_SENSOR message with some parameter configuration). UART version should technically work the same from software standpoint since it is going to send mavlink messages. I guess the title of my post might be misleading. I am trying to integrate a "mavlink" device and I want it to connect to VOXL over UART.
-
@psafi Ah, okay, then you will need to set up a new mavlink instance in /usr/bin/voxl-px4-start. It would be something like
mavlink start -x -d /dev/ttyHS0
-
@Eric-Katzfey Ok great. This is working now. It would be great if you can give me some idea of the underlying architecture for troubleshooting in the future and also making sure this is not going to have any side effects on the entire system. What is the role of voxl-mavlink-server in all of this? I understand we are telling voxl-px4 to expect mavlink messages on ttyHS0.
I see messages 132 and 106 start showing up in output of "mavlink-server -k" which is "show debug info on messages coming from autopilot" and they stop showing up when I unplug the sensor. It'd be great if you can give me some idea of flow of information.
-
@psafi Some of it is just standard PX4 stuff so you can take a look at their documentation. For voxl-mavlink-server this may help: https://docs.modalai.com/mavlink/
-
@psafi In this case we don't use voxl-mavlink-server directly because we are essentially setting up a "mavlink device" straight into px4.